Skip to content

Commit

Permalink
Merge branch 'trunk' into update/rename-align-attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinan committed Dec 30, 2022
2 parents 9112eda + 0b8030d commit 2def1cc
Show file tree
Hide file tree
Showing 2,156 changed files with 77,077 additions and 41,333 deletions.
325 changes: 201 additions & 124 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,162 @@ const typedFiles = glob( 'packages/*/package.json' )
.filter( ( fileName ) => require( join( __dirname, fileName ) ).types )
.map( ( fileName ) => fileName.replace( 'package.json', '**/*.js' ) );

const restrictedImports = [
{
name: 'framer-motion',
message:
'Please use the Framer Motion API through `@wordpress/components` instead.',
},
{
name: 'lodash',
importNames: [
'camelCase',
'capitalize',
'castArray',
'chunk',
'clamp',
'cloneDeep',
'compact',
'concat',
'countBy',
'debounce',
'deburr',
'defaults',
'defaultTo',
'delay',
'difference',
'differenceWith',
'dropRight',
'each',
'escape',
'escapeRegExp',
'every',
'extend',
'filter',
'find',
'findIndex',
'findKey',
'findLast',
'first',
'flatMap',
'flatten',
'flattenDeep',
'flow',
'flowRight',
'forEach',
'fromPairs',
'has',
'identity',
'includes',
'invoke',
'isArray',
'isBoolean',
'isEqual',
'isFinite',
'isFunction',
'isMatch',
'isNil',
'isNumber',
'isObject',
'isObjectLike',
'isPlainObject',
'isString',
'isUndefined',
'keyBy',
'keys',
'last',
'lowerCase',
'mapKeys',
'maxBy',
'memoize',
'negate',
'noop',
'nth',
'omit',
'omitBy',
'once',
'orderby',
'overEvery',
'partial',
'partialRight',
'pick',
'random',
'reduce',
'reject',
'repeat',
'reverse',
'size',
'snakeCase',
'some',
'sortBy',
'startCase',
'startsWith',
'stubFalse',
'stubTrue',
'sum',
'sumBy',
'take',
'throttle',
'times',
'toString',
'trim',
'truncate',
'unionBy',
'uniq',
'uniqBy',
'uniqueId',
'uniqWith',
'upperFirst',
'values',
'without',
'words',
'xor',
'zip',
],
message:
'This Lodash method is not recommended. Please use native functionality instead. If using `memoize`, please use `memize` instead.',
},
{
name: 'reakit',
message:
'Please use Reakit API through `@wordpress/components` instead.',
},
{
name: 'redux',
importNames: [ 'combineReducers' ],
message: 'Please use `combineReducers` from `@wordpress/data` instead.',
},
{
name: 'puppeteer-testing-library',
message: '`puppeteer-testing-library` is still experimental.',
},
{
name: '@emotion/css',
message:
'Please use `@emotion/react` and `@emotion/styled` in order to maintain iframe support. As a replacement for the `cx` function, please use the `useCx` hook defined in `@wordpress/components` instead.',
},
{
name: '@wordpress/edit-post',
message:
"edit-post is a WordPress top level package that shouldn't be imported into other packages",
},
{
name: '@wordpress/edit-site',
message:
"edit-site is a WordPress top level package that shouldn't be imported into other packages",
},
{
name: '@wordpress/edit-widgets',
message:
"edit-widgets is a WordPress top level package that shouldn't be imported into other packages",
},
{
name: '@wordpress/edit-navigation',
message:
"edit-navigation is a WordPress top level package that shouldn't be imported into other packages",
},
];

module.exports = {
root: true,
extends: [
Expand Down Expand Up @@ -70,129 +226,7 @@ module.exports = {
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'framer-motion',
message:
'Please use the Framer Motion API through `@wordpress/components` instead.',
},
{
name: 'lodash',
importNames: [
'camelCase',
'capitalize',
'chunk',
'clamp',
'cloneDeep',
'compact',
'concat',
'countBy',
'debounce',
'deburr',
'defaults',
'defaultTo',
'delay',
'difference',
'differenceWith',
'dropRight',
'each',
'escapeRegExp',
'extend',
'findIndex',
'findKey',
'findLast',
'first',
'flatMap',
'flatten',
'flattenDeep',
'flow',
'flowRight',
'forEach',
'fromPairs',
'has',
'identity',
'invoke',
'isArray',
'isBoolean',
'isFinite',
'isFunction',
'isMatch',
'isNil',
'isNumber',
'isObject',
'isObjectLike',
'isPlainObject',
'isString',
'isUndefined',
'keyBy',
'keys',
'last',
'lowerCase',
'mapKeys',
'maxBy',
'memoize',
'negate',
'noop',
'nth',
'once',
'overEvery',
'partial',
'partialRight',
'random',
'reject',
'repeat',
'reverse',
'size',
'snakeCase',
'sortBy',
'startCase',
'startsWith',
'stubFalse',
'stubTrue',
'sum',
'sumBy',
'take',
'throttle',
'times',
'toString',
'trim',
'truncate',
'unionBy',
'uniq',
'uniqBy',
'uniqueId',
'uniqWith',
'upperFirst',
'values',
'words',
'xor',
'zip',
],
message:
'This Lodash method is not recommended. Please use native functionality instead. If using `memoize`, please use `memize` instead.',
},
{
name: 'reakit',
message:
'Please use Reakit API through `@wordpress/components` instead.',
},
{
name: 'redux',
importNames: [ 'combineReducers' ],
message:
'Please use `combineReducers` from `@wordpress/data` instead.',
},
{
name: 'puppeteer-testing-library',
message:
'`puppeteer-testing-library` is still experimental.',
},
{
name: '@emotion/css',
message:
'Please use `@emotion/react` and `@emotion/styled` in order to maintain iframe support. As a replacement for the `cx` function, please use the `useCx` hook defined in `@wordpress/components` instead.',
},
],
paths: restrictedImports,
},
],
'@typescript-eslint/no-restricted-imports': [
Expand Down Expand Up @@ -314,11 +348,31 @@ module.exports = {
],
},
},
{
files: [ 'packages/components/src/**/*.[tj]s?(x)' ],
excludedFiles: [ ...developmentFiles ],
rules: {
'react-hooks/exhaustive-deps': 'error',
},
},
{
files: [ 'packages/jest*/**/*.js', '**/test/**/*.js' ],
excludedFiles: [ 'test/e2e/**/*.js' ],
extends: [ 'plugin:@wordpress/eslint-plugin/test-unit' ],
},
{
files: [ '**/test/**/*.[tj]s?(x)' ],
excludedFiles: [
'**/*.@(android|ios|native).[tj]s?(x)',
'packages/react-native-*/**/*.[tj]s?(x)',
'test/native/**/*.[tj]s?(x)',
'test/e2e/**/*.[tj]s?(x)',
],
extends: [
'plugin:jest-dom/recommended',
'plugin:testing-library/react',
],
},
{
files: [ 'packages/e2e-test*/**/*.js' ],
excludedFiles: [ 'packages/e2e-test-utils-playwright/**/*.js' ],
Expand Down Expand Up @@ -357,7 +411,7 @@ module.exports = {
},
},
{
files: [ 'bin/**/*.js', 'packages/env/**' ],
files: [ 'bin/**/*.js', 'bin/**/*.mjs', 'packages/env/**' ],
rules: {
'no-console': 'off',
},
Expand Down Expand Up @@ -386,5 +440,28 @@ module.exports = {
plugins: [ 'ssr-friendly' ],
extends: [ 'plugin:ssr-friendly/recommended' ],
},
{
files: [ 'packages/block-editor/**' ],
rules: {
'no-restricted-imports': [
'error',
{
paths: [
...restrictedImports,
{
name: '@wordpress/api-fetch',
message:
"block-editor is a generic package that doesn't depend on a server or WordPress backend. To provide WordPress integration, consider passing settings to the BlockEditorProvider components.",
},
{
name: '@wordpress/core-data',
message:
"block-editor is a generic package that doesn't depend on a server or WordPress backend. To provide WordPress integration, consider passing settings to the BlockEditorProvider components.",
},
],
},
],
},
},
],
};
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
/packages/compose @ajitbohra
/packages/element @ajitbohra
/packages/notices @ajitbohra
/packages/nux @ajitbohra
/packages/viewport @ajitbohra
/packages/base-styles
/packages/icons
Expand Down
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ https://github.com/WordPress/gutenberg/blob/trunk/CONTRIBUTING.md -->
<!-- 2. Insert a Heading Block. -->
<!-- 3. etc. -->

### Testing Instructions for Keyboard
<!-- How can you test the changes by using the keyboard only? Please note, this is required for PRs that change the user interface (UI). This ensures the PR can be tested for any possible accessibility regressions. -->

## Screenshots or screencast <!-- if applicable -->
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Configure Dependabot scanning.
version: 2

updates:
# Check for updates to GitHub Actions.
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
open-pull-requests-limit: 10
labels:
- 'GitHub Actions'
- 'Automated Testing'
- '[Type] Build Tooling'
Loading

1 comment on commit 2def1cc

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3806466128
📝 Reported issues:

Please sign in to comment.