-
Notifications
You must be signed in to change notification settings - Fork 800
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eslint: Remove
eslint-plugin-wpcalypso
, add more @wordpress
rules…
…, and clean up (#38436) It turns out we're not making very much use of `eslint-plugin-wpcalypso`: * Three of its rules we disable as being redundant to `@wordpress` rules. * We already disable four more of its rules as not being applicable to Jetpack. * Of the seven still enabled, * `wpcalypso/i18n-no-this-translate` is apparently obsolete, see Automattic/i18n-calypso#59. * `wpcalypso/i18n-named-placeholders`, `wpcalypso/i18n-mismatched-placeholders`, and `wpcalypso/i18n-no-placeholders-only` only work with Calypso's `translate()` function (which we don't use), not `@wordpress/i18n`. * We don't use `@wordpress/react-i18n` anywhere so `wpcalypso/i18n-translate-identifier` has nothing to check. So let's drop it, and one of its dependencies that we're not using either. Dropping wpcalypso leaves us without configuration of various other eslint plugins we have been using. To make up the difference, let's also enable the "recommended-with-formatting" config from `@wordpress/eslint-plugin`. After adding back a few rules and removing some redundant overrides, this results in the following changes: New rules: * no-caller * no-eval * no-multi-str * no-useless-constructor * react/jsx-equals-spacing * react/jsx-indent * react/jsx-indent-props * react/jsx-no-comment-textnodes * react/jsx-uses-react * react/no-danger-with-children * react/no-render-return-value * react/require-render-return Removed rules: * no-negated-in-lhs (which is deprecated anyway) Neutral changes: * A bunch of checks switched between "warn" and "error". Since we don't differentiate in CI, this shouldn't make any difference. * `.parserOptions.sourceType` and `.parserOptions.babelOptions` get set. Since we always use TypeScript's parser, these options have no effect. Note none of the above are failing on our current codebase! To avoid this PR getting too big, the following changes that do fail on our current codebase are temporarily overridden. We'll either fix these in future PRs, or "promote" them to non-temporary overrides. Temporarily not added: * array-callback-return * jsdoc/check-line-alignment * no-alert * no-bitwise * no-fallthrough * no-prototype-builtins * no-undef-init * no-unused-expressions * no-useless-computed-key * no-useless-return * object-shorthand * react/jsx-key * react/no-direct-mutation-state * react/no-find-dom-node * react/no-unescaped-entities * react/no-unknown-property Changed rule configurations overridden: * eqeqeq: No longer allows non-strict comparison with `null`. * jsdoc now prefers `@return` and `@yield` rather than `@returns` and `@yields`. * jsx-a11y/label-has-associated-control: `assert` is now "htmlFor", formerly defaulted to "either". * no-empty: No longer allows empty `catch`. * react-hooks/exhaustive-deps: Applies to `useSelect` and `useSuspenseSelect` too.
- Loading branch information
Showing
54 changed files
with
203 additions
and
258 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
projects/js-packages/publicize-components/changelog/remove-calypso-eslint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: changed | ||
Comment: Replace eslint disable of `wpcalypso/no-unsafe-wp-apis` with `@wordpress/no-unsafe-wp-apis`. No change to functionality. | ||
|
||
|
3 changes: 1 addition & 2 deletions
3
...ects/js-packages/publicize-components/src/components/connection-management/disconnect.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...cts/js-packages/publicize-components/src/components/social-image-generator/panel/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: changed | ||
Comment: Replace eslint disable of `wpcalypso/no-unsafe-wp-apis` with `@wordpress/no-unsafe-wp-apis`. No change to functionality. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: removed | ||
Comment: Remove `wpcalypso/jsx-classname-namespace` from eslint config, eslint-plugin-wpcalypso is being removed. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
projects/packages/jetpack-mu-wpcom/changelog/remove-calypso-eslint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: changed | ||
Comment: Replace eslint disable of `wpcalypso/no-unsafe-wp-apis` with `@wordpress/no-unsafe-wp-apis`. No change to functionality. | ||
|
||
|
3 changes: 1 addition & 2 deletions
3
projects/packages/jetpack-mu-wpcom/src/features/block-inserter-modifications/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
projects/packages/jetpack-mu-wpcom/src/features/wpcom-blocks/event-countdown/edit.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: changed | ||
Comment: Replace eslint disable of `wpcalypso/no-unsafe-wp-apis` with `@wordpress/no-unsafe-wp-apis`. No change to functionality. | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
projects/packages/search/src/customberg/components/sidebar/color-control.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: changed | ||
Comment: Replace eslint disable of `wpcalypso/no-unsafe-wp-apis` with `@wordpress/no-unsafe-wp-apis`. No change to functionality. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: other | ||
Comment: Replace eslint disable of `wpcalypso/no-unsafe-wp-apis` with `@wordpress/no-unsafe-wp-apis`. No change to functionality. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: other | ||
Comment: Remove `wpcalypso/jsx-classname-namespace` from eslintrc and `eslint-disable` comments, `eslint-plugin-wpcalypso` is being removed. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: other | ||
Comment: Change one `@return` comment to `@returns`, which we'll probably change back soon while doing the same across the monorepo but it's not worth the effort of avoiding now. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
projects/plugins/jetpack/extensions/blocks/button/button-colors-panel.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
projects/plugins/jetpack/extensions/blocks/markdown/renderer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
projects/plugins/jetpack/extensions/blocks/payments-intro/pattern-picker.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
projects/plugins/jetpack/extensions/blocks/recipe/details/edit.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...gins/jetpack/extensions/blocks/subscriptions/deprecated/v3/get-subscriptions-shortcode.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
projects/plugins/jetpack/extensions/blocks/subscriptions/deprecated/v5/save.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
projects/plugins/jetpack/extensions/blocks/subscriptions/deprecated/v6/save.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
projects/plugins/jetpack/extensions/blocks/subscriptions/deprecated/v7/save.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.