diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9fd6f9d5a3471..1134ab867b6a3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4746,9 +4746,6 @@ importers: eslint-plugin-import: specifier: 2.29.1 version: 2.29.1(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0) - eslint-plugin-inclusive-language: - specifier: 2.2.1 - version: 2.2.1 eslint-plugin-jest: specifier: 27.9.0 version: 27.9.0(@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0)(typescript@5.0.4))(eslint@8.57.0)(jest@29.7.0)(typescript@5.0.4) @@ -4782,9 +4779,6 @@ importers: eslint-plugin-testing-library: specifier: 6.2.2 version: 6.2.2(eslint@8.57.0)(typescript@5.0.4) - eslint-plugin-wpcalypso: - specifier: 8.0.0 - version: 8.0.0(@babel/core@7.24.7)(eslint-plugin-inclusive-language@2.2.1)(eslint-plugin-jsdoc@46.10.1(eslint@8.57.0))(eslint-plugin-react-hooks@4.6.2(eslint@8.57.0))(eslint-plugin-react@7.34.2(eslint@8.57.0))(eslint@8.57.0) glob: specifier: 10.4.1 version: 10.4.1 @@ -9692,9 +9686,6 @@ packages: '@typescript-eslint/parser': optional: true - eslint-plugin-inclusive-language@2.2.1: - resolution: {integrity: sha512-RL6avDWXCS0Dcp9axhvHRUp65qG07qjOrh6J4BNNahPvRY3PuYGnAd0H1strZ9cob79JiEW4Bq0j3gEuzbv0/A==} - eslint-plugin-jest-dom@5.4.0: resolution: {integrity: sha512-yBqvFsnpS5Sybjoq61cJiUsenRkC9K32hYQBFS9doBR7nbQZZ5FyO+X7MlmfM1C48Ejx/qTuOCgukDUNyzKZ7A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0, npm: '>=6', yarn: '>=1'} @@ -9787,22 +9778,6 @@ packages: peerDependencies: eslint: ^7.5.0 || ^8.0.0 - eslint-plugin-wpcalypso@8.0.0: - resolution: {integrity: sha512-V1BqCzy1TpQGMxEId1ZudTszaRBAfjgHav9aCDdzlY1AwOjvVojhxqAk1Ir4AqIDddoz39RKfvJ9SdKpq3S+/Q==} - engines: {node: '>=v14.21.3'} - peerDependencies: - '@babel/core': '>=7.17.5' - eslint: '>=8.48.0' - eslint-plugin-inclusive-language: ^2.2.0 - eslint-plugin-jsdoc: ^46.5.1 - eslint-plugin-react: ^7.33.2 - eslint-plugin-react-hooks: ^4.3.0 - peerDependenciesMeta: - eslint-plugin-react: - optional: true - eslint-plugin-react-hooks: - optional: true - eslint-scope@5.1.1: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} engines: {node: '>=8.0.0'} @@ -10510,9 +10485,6 @@ packages: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} - humps@2.0.1: - resolution: {integrity: sha512-E0eIbrFWUhwfXJmsbdjRQFQPrl5pTEoKlz163j1mTqqUnU9PgR4AgB8AIITzuB3vLBdxZXyZ9TDIrwB2OASz4g==} - husky@8.0.3: resolution: {integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==} engines: {node: '>=14'} @@ -22199,10 +22171,6 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-plugin-inclusive-language@2.2.1: - dependencies: - humps: 2.0.1 - eslint-plugin-jest-dom@5.4.0(eslint@8.57.0): dependencies: '@babel/runtime': 7.24.7 @@ -22329,16 +22297,6 @@ snapshots: - supports-color - typescript - eslint-plugin-wpcalypso@8.0.0(@babel/core@7.24.7)(eslint-plugin-inclusive-language@2.2.1)(eslint-plugin-jsdoc@46.10.1(eslint@8.57.0))(eslint-plugin-react-hooks@4.6.2(eslint@8.57.0))(eslint-plugin-react@7.34.2(eslint@8.57.0))(eslint@8.57.0): - dependencies: - '@babel/core': 7.24.7 - eslint: 8.57.0 - eslint-plugin-inclusive-language: 2.2.1 - eslint-plugin-jsdoc: 46.10.1(eslint@8.57.0) - optionalDependencies: - eslint-plugin-react: 7.34.2(eslint@8.57.0) - eslint-plugin-react-hooks: 4.6.2(eslint@8.57.0) - eslint-scope@5.1.1: dependencies: esrecurse: 4.3.0 @@ -23226,8 +23184,6 @@ snapshots: human-signals@5.0.0: {} - humps@2.0.1: {} - husky@8.0.3: {} iconv-lite@0.4.24: diff --git a/projects/js-packages/publicize-components/changelog/remove-calypso-eslint b/projects/js-packages/publicize-components/changelog/remove-calypso-eslint new file mode 100644 index 0000000000000..eb5c427bd2da5 --- /dev/null +++ b/projects/js-packages/publicize-components/changelog/remove-calypso-eslint @@ -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. + + diff --git a/projects/js-packages/publicize-components/src/components/connection-management/disconnect.tsx b/projects/js-packages/publicize-components/src/components/connection-management/disconnect.tsx index 0088d19d5d154..c41a1ba2ec2c3 100644 --- a/projects/js-packages/publicize-components/src/components/connection-management/disconnect.tsx +++ b/projects/js-packages/publicize-components/src/components/connection-management/disconnect.tsx @@ -1,6 +1,5 @@ import { Button } from '@automattic/jetpack-components'; -// eslint-disable-next-line wpcalypso/no-unsafe-wp-apis -import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components'; +import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components'; // eslint-disable-line @wordpress/no-unsafe-wp-apis import { useDispatch, useSelect } from '@wordpress/data'; import { createInterpolateElement, useCallback, useReducer } from '@wordpress/element'; import { __, _x, sprintf } from '@wordpress/i18n'; diff --git a/projects/js-packages/publicize-components/src/components/manage-connections-modal/confirmation-form/index.tsx b/projects/js-packages/publicize-components/src/components/manage-connections-modal/confirmation-form/index.tsx index ee578ef4b0349..820bc1bee8afa 100644 --- a/projects/js-packages/publicize-components/src/components/manage-connections-modal/confirmation-form/index.tsx +++ b/projects/js-packages/publicize-components/src/components/manage-connections-modal/confirmation-form/index.tsx @@ -2,8 +2,7 @@ import { Button, useGlobalNotices } from '@automattic/jetpack-components'; import { BaseControl, FlexBlock, - // eslint-disable-next-line wpcalypso/no-unsafe-wp-apis - __experimentalHStack as HStack, + __experimentalHStack as HStack, // eslint-disable-line @wordpress/no-unsafe-wp-apis } from '@wordpress/components'; import { useDispatch, useSelect } from '@wordpress/data'; import { useCallback, useMemo } from '@wordpress/element'; diff --git a/projects/js-packages/publicize-components/src/components/social-image-generator/panel/index.js b/projects/js-packages/publicize-components/src/components/social-image-generator/panel/index.js index 30d0af363963e..fd5f7ec71fd26 100644 --- a/projects/js-packages/publicize-components/src/components/social-image-generator/panel/index.js +++ b/projects/js-packages/publicize-components/src/components/social-image-generator/panel/index.js @@ -1,10 +1,9 @@ -/* eslint-disable wpcalypso/no-unsafe-wp-apis */ import { useGlobalNotices } from '@automattic/jetpack-components'; import { PanelBody, ToggleControl, Button, - __experimentalHStack as HStack, + __experimentalHStack as HStack, // eslint-disable-line @wordpress/no-unsafe-wp-apis } from '@wordpress/components'; import { useCallback, useState, Fragment } from '@wordpress/element'; import { __, _x } from '@wordpress/i18n'; diff --git a/projects/packages/forms/changelog/remove-calypso-eslint b/projects/packages/forms/changelog/remove-calypso-eslint new file mode 100644 index 0000000000000..eb5c427bd2da5 --- /dev/null +++ b/projects/packages/forms/changelog/remove-calypso-eslint @@ -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. + + diff --git a/projects/packages/forms/changelog/remove-calypso-eslint#2 b/projects/packages/forms/changelog/remove-calypso-eslint#2 new file mode 100644 index 0000000000000..04510d8568b5c --- /dev/null +++ b/projects/packages/forms/changelog/remove-calypso-eslint#2 @@ -0,0 +1,5 @@ +Significance: patch +Type: removed +Comment: Remove `wpcalypso/jsx-classname-namespace` from eslint config, eslint-plugin-wpcalypso is being removed. + + diff --git a/projects/packages/forms/src/blocks/.eslintrc.js b/projects/packages/forms/src/blocks/.eslintrc.js index 02e6db853d18e..840d017a63a3e 100644 --- a/projects/packages/forms/src/blocks/.eslintrc.js +++ b/projects/packages/forms/src/blocks/.eslintrc.js @@ -23,7 +23,6 @@ module.exports = { 'react/react-in-jsx-scope': 0, 'space-unary-ops': 0, 'space-before-function-paren': 0, - 'wpcalypso/jsx-classname-namespace': 0, // eslint 6.x migration 'react-hooks/rules-of-hooks': 1, diff --git a/projects/packages/forms/src/blocks/contact-form/edit.js b/projects/packages/forms/src/blocks/contact-form/edit.js index afb53ddcb9070..e055c3bf60d1c 100644 --- a/projects/packages/forms/src/blocks/contact-form/edit.js +++ b/projects/packages/forms/src/blocks/contact-form/edit.js @@ -9,8 +9,8 @@ import { InnerBlocks, InspectorControls, URLInput, - __experimentalBlockVariationPicker as BlockVariationPicker, // eslint-disable-line wpcalypso/no-unsafe-wp-apis - __experimentalBlockPatternSetup as BlockPatternSetup, // eslint-disable-line wpcalypso/no-unsafe-wp-apis + __experimentalBlockVariationPicker as BlockVariationPicker, // eslint-disable-line @wordpress/no-unsafe-wp-apis + __experimentalBlockPatternSetup as BlockPatternSetup, // eslint-disable-line @wordpress/no-unsafe-wp-apis } from '@wordpress/block-editor'; import { createBlock, registerBlockVariation } from '@wordpress/blocks'; import { diff --git a/projects/packages/jetpack-mu-wpcom/changelog/remove-calypso-eslint b/projects/packages/jetpack-mu-wpcom/changelog/remove-calypso-eslint new file mode 100644 index 0000000000000..eb5c427bd2da5 --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/remove-calypso-eslint @@ -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. + + diff --git a/projects/packages/jetpack-mu-wpcom/src/features/block-inserter-modifications/index.js b/projects/packages/jetpack-mu-wpcom/src/features/block-inserter-modifications/index.js index 2604cc6dc6fd3..93ac2eae68e90 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/block-inserter-modifications/index.js +++ b/projects/packages/jetpack-mu-wpcom/src/features/block-inserter-modifications/index.js @@ -1,5 +1,4 @@ -// eslint-disable-next-line wpcalypso/no-unsafe-wp-apis -import { __unstableInserterMenuExtension as InserterMenuExtension } from '@wordpress/block-editor'; +import { __unstableInserterMenuExtension as InserterMenuExtension } from '@wordpress/block-editor'; // eslint-disable-line @wordpress/no-unsafe-wp-apis import { useState } from '@wordpress/element'; import { registerPlugin } from '@wordpress/plugins'; import { debounce } from 'lodash'; diff --git a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-blocks/event-countdown/edit.js b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-blocks/event-countdown/edit.js index beff45ec078be..6c937f5921544 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-blocks/event-countdown/edit.js +++ b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-blocks/event-countdown/edit.js @@ -1,8 +1,7 @@ import { useBlockProps } from '@wordpress/block-editor'; import { Button, DateTimePicker, Dropdown, Placeholder } from '@wordpress/components'; import { useInstanceId } from '@wordpress/compose'; -// eslint-disable-next-line wpcalypso/no-unsafe-wp-apis -import { dateI18n, __experimentalGetSettings } from '@wordpress/date'; +import { dateI18n, __experimentalGetSettings } from '@wordpress/date'; // eslint-disable-line @wordpress/no-unsafe-wp-apis import { __ } from '@wordpress/i18n'; import clsx from 'clsx'; import moment from 'moment'; diff --git a/projects/packages/search/changelog/remove-calypso-eslint b/projects/packages/search/changelog/remove-calypso-eslint new file mode 100644 index 0000000000000..eb5c427bd2da5 --- /dev/null +++ b/projects/packages/search/changelog/remove-calypso-eslint @@ -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. + + diff --git a/projects/packages/search/src/customberg/components/sidebar/color-control.jsx b/projects/packages/search/src/customberg/components/sidebar/color-control.jsx index 51a59ac7d1159..a1090708da952 100644 --- a/projects/packages/search/src/customberg/components/sidebar/color-control.jsx +++ b/projects/packages/search/src/customberg/components/sidebar/color-control.jsx @@ -1,5 +1,5 @@ // NOTE: Expect this import to break when the exported value is renamed! -import { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor'; // eslint-disable-line wpcalypso/no-unsafe-wp-apis +import { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor'; // eslint-disable-line @wordpress/no-unsafe-wp-apis import { useSelect } from '@wordpress/data'; import { __ } from '@wordpress/i18n'; diff --git a/projects/packages/videopress/changelog/remove-calypso-eslint b/projects/packages/videopress/changelog/remove-calypso-eslint new file mode 100644 index 0000000000000..eb5c427bd2da5 --- /dev/null +++ b/projects/packages/videopress/changelog/remove-calypso-eslint @@ -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. + + diff --git a/projects/packages/videopress/src/client/block-editor/blocks/video/components/color-panel/index.tsx b/projects/packages/videopress/src/client/block-editor/blocks/video/components/color-panel/index.tsx index f3b6c4a2c2cc7..e51ab5fbfc076 100644 --- a/projects/packages/videopress/src/client/block-editor/blocks/video/components/color-panel/index.tsx +++ b/projects/packages/videopress/src/client/block-editor/blocks/video/components/color-panel/index.tsx @@ -5,8 +5,7 @@ import { PanelColorSettings } from '@wordpress/block-editor'; import { PanelRow, ToggleControl, - // eslint-disable-next-line wpcalypso/no-unsafe-wp-apis - __experimentalToolsPanelItem as ToolsPanelItem, + __experimentalToolsPanelItem as ToolsPanelItem, // eslint-disable-line @wordpress/no-unsafe-wp-apis } from '@wordpress/components'; import { useDebounce } from '@wordpress/compose'; import { useCallback, useState } from '@wordpress/element'; diff --git a/projects/packages/videopress/src/client/components/timestamp-control/index.tsx b/projects/packages/videopress/src/client/components/timestamp-control/index.tsx index 784816769f9a1..fc6bf56bdec40 100644 --- a/projects/packages/videopress/src/client/components/timestamp-control/index.tsx +++ b/projects/packages/videopress/src/client/components/timestamp-control/index.tsx @@ -2,8 +2,7 @@ * External dependencies */ import { - // eslint-disable-next-line wpcalypso/no-unsafe-wp-apis - __experimentalNumberControl, + __experimentalNumberControl, // eslint-disable-line @wordpress/no-unsafe-wp-apis TextControl, RangeControl, BaseControl, diff --git a/projects/plugins/jetpack/changelog/remove-calypso-eslint b/projects/plugins/jetpack/changelog/remove-calypso-eslint new file mode 100644 index 0000000000000..42a2ff0e3d1f2 --- /dev/null +++ b/projects/plugins/jetpack/changelog/remove-calypso-eslint @@ -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. + + diff --git a/projects/plugins/jetpack/changelog/remove-calypso-eslint#2 b/projects/plugins/jetpack/changelog/remove-calypso-eslint#2 new file mode 100644 index 0000000000000..48a91c2c25532 --- /dev/null +++ b/projects/plugins/jetpack/changelog/remove-calypso-eslint#2 @@ -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. + + diff --git a/projects/plugins/jetpack/changelog/remove-calypso-eslint#3 b/projects/plugins/jetpack/changelog/remove-calypso-eslint#3 new file mode 100644 index 0000000000000..bd169330990fa --- /dev/null +++ b/projects/plugins/jetpack/changelog/remove-calypso-eslint#3 @@ -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. + + diff --git a/projects/plugins/jetpack/extensions/.eslintrc.js b/projects/plugins/jetpack/extensions/.eslintrc.js index d400fbaaee9d2..dbd57d2a62cf1 100644 --- a/projects/plugins/jetpack/extensions/.eslintrc.js +++ b/projects/plugins/jetpack/extensions/.eslintrc.js @@ -23,7 +23,6 @@ module.exports = { 'react/react-in-jsx-scope': 0, 'space-unary-ops': 0, 'space-before-function-paren': 0, - 'wpcalypso/jsx-classname-namespace': 0, // eslint 6.x migration 'react-hooks/rules-of-hooks': 1, diff --git a/projects/plugins/jetpack/extensions/blocks/button/button-colors-panel.js b/projects/plugins/jetpack/extensions/blocks/button/button-colors-panel.js index 27a72e7f37754..92dedf2a9923b 100644 --- a/projects/plugins/jetpack/extensions/blocks/button/button-colors-panel.js +++ b/projects/plugins/jetpack/extensions/blocks/button/button-colors-panel.js @@ -1,7 +1,7 @@ import { ContrastChecker, PanelColorSettings, - __experimentalPanelColorGradientSettings as PanelColorGradientSettings, // eslint-disable-line wpcalypso/no-unsafe-wp-apis + __experimentalPanelColorGradientSettings as PanelColorGradientSettings, // eslint-disable-line @wordpress/no-unsafe-wp-apis } from '@wordpress/block-editor'; import { __ } from '@wordpress/i18n'; diff --git a/projects/plugins/jetpack/extensions/blocks/button/constants.js b/projects/plugins/jetpack/extensions/blocks/button/constants.js index 927c08badd8f0..75a3f53dfd140 100644 --- a/projects/plugins/jetpack/extensions/blocks/button/constants.js +++ b/projects/plugins/jetpack/extensions/blocks/button/constants.js @@ -1,4 +1,4 @@ -import { __experimentalUseGradient as useGradient } from '@wordpress/block-editor'; // eslint-disable-line wpcalypso/no-unsafe-wp-apis +import { __experimentalUseGradient as useGradient } from '@wordpress/block-editor'; // eslint-disable-line @wordpress/no-unsafe-wp-apis export const IS_GRADIENT_AVAILABLE = !! useGradient; diff --git a/projects/plugins/jetpack/extensions/blocks/button/edit.js b/projects/plugins/jetpack/extensions/blocks/button/edit.js index 1f96508222527..40b991494d7c5 100644 --- a/projects/plugins/jetpack/extensions/blocks/button/edit.js +++ b/projects/plugins/jetpack/extensions/blocks/button/edit.js @@ -1,7 +1,7 @@ import { InspectorControls, RichText, - __experimentalUseGradient as useGradient, // eslint-disable-line wpcalypso/no-unsafe-wp-apis + __experimentalUseGradient as useGradient, // eslint-disable-line @wordpress/no-unsafe-wp-apis withColors, } from '@wordpress/block-editor'; import { compose } from '@wordpress/compose'; diff --git a/projects/plugins/jetpack/extensions/blocks/button/save.js b/projects/plugins/jetpack/extensions/blocks/button/save.js index 8e93191fced68..69a5fd861fc96 100644 --- a/projects/plugins/jetpack/extensions/blocks/button/save.js +++ b/projects/plugins/jetpack/extensions/blocks/button/save.js @@ -1,6 +1,6 @@ import { getColorClassName, - __experimentalGetGradientClass as getGradientClass, // eslint-disable-line wpcalypso/no-unsafe-wp-apis + __experimentalGetGradientClass as getGradientClass, // eslint-disable-line @wordpress/no-unsafe-wp-apis RichText, } from '@wordpress/block-editor'; import clsx from 'clsx'; diff --git a/projects/plugins/jetpack/extensions/blocks/button/test/edit.js b/projects/plugins/jetpack/extensions/blocks/button/test/edit.js index 99ba8e9feeb45..e70f4a2f43933 100644 --- a/projects/plugins/jetpack/extensions/blocks/button/test/edit.js +++ b/projects/plugins/jetpack/extensions/blocks/button/test/edit.js @@ -1,5 +1,5 @@ import { render, screen, within } from '@testing-library/react'; -import { __experimentalUseGradient } from '@wordpress/block-editor'; // eslint-disable-line wpcalypso/no-unsafe-wp-apis +import { __experimentalUseGradient } from '@wordpress/block-editor'; // eslint-disable-line @wordpress/no-unsafe-wp-apis import { ButtonEdit } from '../edit'; const defaultAttributes = { diff --git a/projects/plugins/jetpack/extensions/blocks/markdown/renderer.js b/projects/plugins/jetpack/extensions/blocks/markdown/renderer.js index a9faa59cbd5a1..6755a3da9979c 100644 --- a/projects/plugins/jetpack/extensions/blocks/markdown/renderer.js +++ b/projects/plugins/jetpack/extensions/blocks/markdown/renderer.js @@ -1,4 +1,4 @@ -import { __experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles } from '@wordpress/block-editor'; // eslint-disable-line wpcalypso/no-unsafe-wp-apis +import { __experimentalGetSpacingClassesAndStyles as getSpacingClassesAndStyles } from '@wordpress/block-editor'; // eslint-disable-line @wordpress/no-unsafe-wp-apis import { RawHTML } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import MarkdownIt from 'markdown-it'; diff --git a/projects/plugins/jetpack/extensions/blocks/payments-intro/pattern-picker.js b/projects/plugins/jetpack/extensions/blocks/payments-intro/pattern-picker.js index 72cc7b6569321..60597abac5a99 100644 --- a/projects/plugins/jetpack/extensions/blocks/payments-intro/pattern-picker.js +++ b/projects/plugins/jetpack/extensions/blocks/payments-intro/pattern-picker.js @@ -1,5 +1,5 @@ import { - __experimentalBlockPatternSetup as BlockPatternSetup, // eslint-disable-line wpcalypso/no-unsafe-wp-apis + __experimentalBlockPatternSetup as BlockPatternSetup, // eslint-disable-line @wordpress/no-unsafe-wp-apis } from '@wordpress/block-editor'; import { Button, Modal } from '@wordpress/components'; import { useState } from '@wordpress/element'; diff --git a/projects/plugins/jetpack/extensions/blocks/premium-content/logged-out-view/deprecated/v1/index.js b/projects/plugins/jetpack/extensions/blocks/premium-content/logged-out-view/deprecated/v1/index.js index fcdaf6b73386f..0fcc6e014619a 100644 --- a/projects/plugins/jetpack/extensions/blocks/premium-content/logged-out-view/deprecated/v1/index.js +++ b/projects/plugins/jetpack/extensions/blocks/premium-content/logged-out-view/deprecated/v1/index.js @@ -70,7 +70,6 @@ export default { }, save: () => ( - // eslint-disable-next-line wpcalypso/jsx-classname-namespace
diff --git a/projects/plugins/jetpack/extensions/blocks/premium-content/login-button/edit.js b/projects/plugins/jetpack/extensions/blocks/premium-content/login-button/edit.js index e24a38ab36c57..3ad72a912fce5 100644 --- a/projects/plugins/jetpack/extensions/blocks/premium-content/login-button/edit.js +++ b/projects/plugins/jetpack/extensions/blocks/premium-content/login-button/edit.js @@ -44,7 +44,6 @@ function LoginButtonEdit( props ) { return ( <> - { /* eslint-disable-next-line wpcalypso/jsx-classname-namespace */ }
{ * * @param {object} settings - Block settings. * @param {string} name - Block name. - * @return {object} Modified settings. + * @returns {object} Modified settings. */ function addVisibilityAttribute( settings, name ) { if ( blockHasVisibilitySettings( name ) && typeof settings.attributes !== 'undefined' ) { diff --git a/tools/js-tools/eslintrc/base.js b/tools/js-tools/eslintrc/base.js index d1cc43a271f7e..12f44bba338ce 100644 --- a/tools/js-tools/eslintrc/base.js +++ b/tools/js-tools/eslintrc/base.js @@ -31,8 +31,12 @@ module.exports = { parser: '@typescript-eslint/parser', extends: [ './preload', - 'plugin:wpcalypso/recommended', - 'plugin:@wordpress/eslint-plugin/i18n', + 'eslint:recommended', + // Can't just `@wordpress/recommended-with-formatting` because that includes React too and we only want that in ./react.js. + 'plugin:@wordpress/jsx-a11y', + 'plugin:@wordpress/custom', + 'plugin:@wordpress/esnext', + 'plugin:@wordpress/i18n', 'plugin:jsx-a11y/recommended', 'plugin:prettier/recommended', ], @@ -66,13 +70,18 @@ module.exports = { }, jsdoc: { preferredTypes: { - // Override wpcalypso, we'd rather follow jsdoc and typescript in this. + // Override @wordpress/eslint-plugin, we'd rather follow jsdoc and typescript in this. object: 'object', Object: 'object', 'object.<>': 'Object<>', 'Object.<>': 'Object<>', 'object<>': 'Object<>', }, + // Temporarily override plugin:@wordpress/esnext so we can clean up the jsdocs in a separate PR. + tagNamePreference: { + returns: 'returns', + yields: 'yields', + }, }, }, overrides: [ @@ -90,51 +99,84 @@ module.exports = { extends: [ require.resolve( 'jetpack-js-tools/eslintrc/jest' ) ], }, ], - plugins: [ 'import', 'prettier', 'jsx-a11y', 'lodash', 'jsdoc', '@typescript-eslint' ], + plugins: [ 'import', 'prettier', 'jsx-a11y', 'lodash', 'jsdoc' ], rules: { + // Dummy domain, projects should override this in their own .eslintrc.js. + '@wordpress/i18n-text-domain': [ + 'error', + { + allowedTextDomain: "no text domain is set in this in this project's .eslintrc.js", + }, + ], + // REST API objects include underscores - camelcase: 0, - 'comma-spacing': 2, - curly: 2, - 'computed-property-spacing': [ 2, 'always' ], - 'func-call-spacing': 2, + camelcase: 'off', + 'comma-spacing': 'error', + 'computed-property-spacing': [ 'error', 'always' ], + curly: 'error', + 'func-call-spacing': 'error', 'import/order': [ - 2, + 'error', { - 'newlines-between': 'never', alphabetize: { order: 'asc' }, groups: [ 'builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'type' ], + 'newlines-between': 'never', }, ], - 'jsx-quotes': [ 2, 'prefer-double' ], - 'key-spacing': 2, - 'keyword-spacing': 2, - 'lodash/import-scope': [ 2, 'member' ], - 'max-len': 0, // Ignored for Jetpack - 'new-cap': [ 2, { capIsNew: false, newIsCap: true } ], - 'no-else-return': 2, - 'no-extra-semi': 2, - 'no-multiple-empty-lines': [ 2, { max: 1 } ], - 'no-multi-spaces': 2, + + 'jsdoc/check-indentation': 'warn', + 'jsdoc/check-syntax': 'warn', + 'jsdoc/check-tag-names': [ 'error', { definedTags: [ 'jest-environment' ] } ], + 'jsdoc/check-values': 'warn', + 'jsdoc/no-multi-asterisks': [ 'error', { preventAtMiddleLines: true } ], + 'jsdoc/require-description': 'warn', + 'jsdoc/require-hyphen-before-param-description': 'warn', + 'jsdoc/require-jsdoc': 'warn', + 'jsdoc/require-param-description': 'warn', + 'jsdoc/require-returns': 'warn', + 'jsdoc/require-yields': 'warn', + + 'jsx-a11y/anchor-has-content': 'off', + 'jsx-a11y/anchor-is-valid': 'off', + 'jsx-a11y/label-has-for': [ + 'error', + { + required: { + some: [ 'nesting', 'id' ], + }, + }, + ], + // Redundant roles are sometimes necessary for screen reader support. For instance, VoiceOver + // on Safari requires `role=list` to announce the list if the style is overwritten. + 'jsx-a11y/no-redundant-roles': 'off', + + 'jsx-quotes': [ 'error', 'prefer-double' ], + 'key-spacing': 'error', + 'keyword-spacing': 'error', + 'lodash/import-scope': [ 'error', 'member' ], + 'new-cap': [ 'error', { capIsNew: false, newIsCap: true } ], + 'no-extra-semi': 'error', + 'no-multi-spaces': 'error', + 'no-multiple-empty-lines': [ 'error', { max: 1 } ], + 'no-new': 'error', + 'no-process-exit': 'error', 'no-restricted-imports': [ - 2, + 'error', { paths: restrictedPaths, }, ], 'no-restricted-modules': [ - 2, + 'error', { paths: restrictedPaths, }, ], - 'no-shadow': 2, - 'no-spaced-func': 2, - 'no-trailing-spaces': 2, - 'no-var': 2, - 'object-curly-spacing': [ 2, 'always' ], + 'no-spaced-func': 'error', + 'no-trailing-spaces': 'error', + 'object-curly-spacing': [ 'error', 'always' ], 'operator-linebreak': [ - 2, + 'error', 'after', { overrides: { @@ -143,123 +185,41 @@ module.exports = { }, }, ], - 'padded-blocks': [ 2, 'never' ], - 'prefer-const': 2, - semi: 2, - 'semi-spacing': 2, - 'space-before-blocks': [ 2, 'always' ], - 'space-in-parens': [ 2, 'always' ], - 'space-infix-ops': [ 2, { int32Hint: false } ], + 'padded-blocks': [ 'error', 'never' ], + 'prefer-const': [ 'error', { destructuring: 'any' } ], + semi: 'error', + 'semi-spacing': 'error', + 'space-before-blocks': [ 'error', 'always' ], + 'space-in-parens': [ 'error', 'always' ], + 'space-infix-ops': [ 'error', { int32Hint: false } ], 'space-unary-ops': [ - 2, + 'error', { overrides: { '!': true, }, }, ], - 'wpcalypso/i18n-no-this-translate': 2, - 'wpcalypso/i18n-mismatched-placeholders': 2, - 'wpcalypso/jsx-gridicon-size': 0, // Ignored for Jetpack - 'wpcalypso/jsx-classname-namespace': 0, // Ignored for Jetpack - 'jsx-a11y/label-has-for': [ - 2, - { - required: { - some: [ 'nesting', 'id' ], - }, - }, - ], - // Redundant roles are sometimes necessary for screen reader support. For instance, VoiceOver - // on Safari requires `role=list` to announce the list if the style is overwritten. - 'jsx-a11y/no-redundant-roles': 0, - // Disabled rules for now. Ideally we should resolve all the errors these rules create. - 'wpcalypso/redux-no-bound-selectors': 0, - 'jsx-a11y/anchor-has-content': 0, - 'react/no-string-refs': 0, - 'jsx-a11y/anchor-is-valid': 0, - - // Both wpcalypso and @wordpress/eslint-plugin offer these. We only need one copy. - 'wpcalypso/i18n-ellipsis': 0, - 'wpcalypso/i18n-no-collapsible-whitespace': 0, - 'wpcalypso/i18n-no-variables': 0, - - // Rules that only make sense for Calypso. - 'wpcalypso/i18n-unlocalized-url': 0, - - // Dummy domain, projects should override this in their own .eslintrc.js. - '@wordpress/i18n-text-domain': [ - 'error', - { - allowedTextDomain: "no text domain is set in this in this project's .eslintrc.js", - }, - ], - - // JSDoc plugin overrides - 'jsdoc/check-alignment': 1, // Recommended - 'jsdoc/check-examples': 0, // See https://github.com/eslint/eslint/issues/14745 - 'jsdoc/check-indentation': 1, - 'jsdoc/check-param-names': 1, // Recommended - 'jsdoc/check-syntax': 1, - 'jsdoc/check-tag-names': [ - 1, // Recommended - { definedTags: [ 'jest-environment' ] }, - ], - 'jsdoc/check-types': [ - 'error', - { - // See above, wpcalypso also sets this true for their "Object" preference. - unifyParentAndChildTypeChecks: false, - }, - ], - 'jsdoc/implements-on-classes': 1, // Recommended - 'jsdoc/no-defaults': 0, - 'jsdoc/no-undefined-types': [ - 1, - { - definedTypes: [ - 'Iterable', // https://github.com/jsdoc/jsdoc/issues/1009 and https://github.com/gajus/eslint-plugin-jsdoc/issues/280 - ], - }, - ], - 'jsdoc/require-description': 1, - 'jsdoc/require-hyphen-before-param-description': 1, - 'jsdoc/require-jsdoc': 1, // Recommended - 'jsdoc/require-param': 1, // Recommended - 'jsdoc/require-param-description': 1, // Recommended - 'jsdoc/require-param-name': 1, // Recommended - 'jsdoc/require-param-type': 1, // Recommended - 'jsdoc/require-returns': 1, // Recommended - 'jsdoc/require-returns-check': 1, // Recommended - 'jsdoc/require-returns-description': 1, // Recommended - 'jsdoc/require-returns-type': 1, // Recommended - 'jsdoc/tag-lines': [ - 'warn', - 'any', - { - startLines: null, - endLines: 0, - applyToEndTag: false, - }, - ], - 'jsdoc/valid-types': 1, // Recommended - 'jsdoc/check-values': 1, - - // eslint 6.x migration - 'no-unused-vars': 1, - 'no-useless-escape': 1, - 'no-extra-boolean-cast': 1, - 'no-case-declarations': 1, - 'no-class-assign': 1, - 'no-redeclare': 1, - - // Workaround for ESLint failing to parse files with template literals - // with this error: "TypeError: Cannot read property 'range' of null" - 'template-curly-spacing': 'off', + strict: [ 'error', 'never' ], - // Disabled pending #16099. - 'inclusive-language/use-inclusive-words': 0, - // Misc - 'no-use-before-define': 'off', + // Temporarily override plugin:@wordpress/* so we can clean up failing stuff in separate PRs. + 'array-callback-return': 'off', + eqeqeq: [ 'error', 'allow-null' ], + 'jsdoc/check-line-alignment': 'off', + 'jsx-a11y/label-has-associated-control': [ 'error', { assert: 'either' } ], + 'no-alert': 'off', + 'no-bitwise': 'off', + 'no-empty': [ 'error', { allowEmptyCatch: true } ], + 'no-fallthrough': 'off', + 'no-prototype-builtins': 'off', + 'no-undef-init': 'off', + 'no-unused-expressions': 'off', + 'no-useless-computed-key': 'off', + 'no-useless-return': 'off', + 'object-shorthand': 'off', + '@wordpress/no-base-control-with-label-without-id': 'off', + '@wordpress/no-global-active-element': 'off', + '@wordpress/no-global-get-selection': 'off', + '@wordpress/no-unused-vars-before-return': 'off', }, }; diff --git a/tools/js-tools/eslintrc/react.js b/tools/js-tools/eslintrc/react.js index 0a6f86c2cf92d..6c329596b5c27 100644 --- a/tools/js-tools/eslintrc/react.js +++ b/tools/js-tools/eslintrc/react.js @@ -4,8 +4,8 @@ module.exports = { extends: [ './preload.js', - 'plugin:wpcalypso/react', - // Re-extend our base to re-override wpcalypso. + 'plugin:@wordpress/react', + // Some configs currently don't load this otherwise. Sigh. './base.js', ], parserOptions: { @@ -17,17 +17,20 @@ module.exports = { }, }, rules: { - 'react/jsx-curly-spacing': [ 2, 'always' ], - 'react/jsx-no-bind': [ 2, { ignoreRefs: true } ], - // 'react/jsx-space-before-closing': 2, - 'react/jsx-tag-spacing': [ 2, { beforeSelfClosing: 'always' } ], - 'react/no-danger': 2, - 'react/no-did-mount-set-state': 2, - 'react/no-did-update-set-state': 2, - 'react/no-is-mounted': 2, - 'react/prefer-es6-class': 1, - 'react/no-string-refs': 0, - // suppress errors for missing 'import React' in files - 'react/react-in-jsx-scope': 'off', + 'react/jsx-curly-spacing': [ 'error', 'always' ], + 'react/jsx-no-bind': [ 'error', { ignoreRefs: true } ], + 'react/jsx-tag-spacing': [ 'error', { beforeSelfClosing: 'always' } ], + 'react/no-danger': 'error', + 'react/no-did-mount-set-state': 'error', + 'react/no-did-update-set-state': 'error', + 'react/prefer-es6-class': 'warn', + + // Temporarily override plugin:@wordpress/react so we can clean up failing stuff in separate PRs. + 'react-hooks/exhaustive-deps': [ 'warn', { additionalHooks: '' } ], + 'react/jsx-key': 'off', + 'react/no-direct-mutation-state': 'off', + 'react/no-find-dom-node': 'off', + 'react/no-unescaped-entities': 'off', + 'react/no-unknown-property': 'off', }, }; diff --git a/tools/js-tools/eslintrc/svelte.js b/tools/js-tools/eslintrc/svelte.js index daf0944e30be7..ec66f9727a664 100644 --- a/tools/js-tools/eslintrc/svelte.js +++ b/tools/js-tools/eslintrc/svelte.js @@ -23,6 +23,6 @@ module.exports = { // yet mounted in the DOM from attaching to the window directly. Not // relevant in a svelte project. // Ref: https://github.com/WordPress/gutenberg/pull/26810 - '@wordpress/no-global-event-listener': 0, + '@wordpress/no-global-event-listener': 'off', }, }; diff --git a/tools/js-tools/eslintrc/typescript.js b/tools/js-tools/eslintrc/typescript.js index 84f7268be6898..5f7aa0af9d09b 100644 --- a/tools/js-tools/eslintrc/typescript.js +++ b/tools/js-tools/eslintrc/typescript.js @@ -3,13 +3,13 @@ module.exports = { plugins: [ '@typescript-eslint' ], rules: { // This produces false positives with TypeScript types - 'no-duplicate-imports': 0, + 'no-duplicate-imports': 'off', // This rule is not recommended for TypeScript projects. According to // the Typescript-eslint FAQ, TypeScript handles this rule itself at // compile-time and does a better job than eslint can. // Ref: https://github.com/typescript-eslint/typescript-eslint/blob/main/docs/linting/TROUBLESHOOTING.md#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors - 'no-undef': 0, + 'no-undef': 'off', '@typescript-eslint/no-unused-vars': [ 'warn', { argsIgnorePattern: '^_' } ], }, diff --git a/tools/js-tools/eslintrc/wp-eslint-plugin/esnext.js b/tools/js-tools/eslintrc/wp-eslint-plugin/esnext.js index 80cdb2e577f85..6251eb001a432 100644 --- a/tools/js-tools/eslintrc/wp-eslint-plugin/esnext.js +++ b/tools/js-tools/eslintrc/wp-eslint-plugin/esnext.js @@ -1,3 +1,3 @@ module.exports = { - extends: [ '../preload', 'plugin:@wordpress/eslint-plugin/esnext' ], + extends: [ '../preload', 'plugin:@wordpress/esnext' ], }; diff --git a/tools/js-tools/eslintrc/wp-eslint-plugin/recommended-with-formatting.js b/tools/js-tools/eslintrc/wp-eslint-plugin/recommended-with-formatting.js index 1b16bbe0fe2f7..78ed457a7d62d 100644 --- a/tools/js-tools/eslintrc/wp-eslint-plugin/recommended-with-formatting.js +++ b/tools/js-tools/eslintrc/wp-eslint-plugin/recommended-with-formatting.js @@ -1,3 +1,3 @@ module.exports = { - extends: [ '../preload', 'plugin:@wordpress/eslint-plugin/recommended-with-formatting' ], + extends: [ '../preload', 'plugin:@wordpress/recommended-with-formatting' ], }; diff --git a/tools/js-tools/eslintrc/wp-eslint-plugin/recommended.js b/tools/js-tools/eslintrc/wp-eslint-plugin/recommended.js index de74ceb972638..8d1de5fd94bd1 100644 --- a/tools/js-tools/eslintrc/wp-eslint-plugin/recommended.js +++ b/tools/js-tools/eslintrc/wp-eslint-plugin/recommended.js @@ -1,3 +1,3 @@ module.exports = { - extends: [ '../preload', 'plugin:@wordpress/eslint-plugin/recommended' ], + extends: [ '../preload', 'plugin:@wordpress/recommended' ], }; diff --git a/tools/js-tools/package.json b/tools/js-tools/package.json index d1a610eeecf57..dda671734ee3f 100644 --- a/tools/js-tools/package.json +++ b/tools/js-tools/package.json @@ -33,7 +33,6 @@ "eslint-import-resolver-exports": "1.0.0-beta.5", "eslint-plugin-es-x": "7.7.0", "eslint-plugin-import": "2.29.1", - "eslint-plugin-inclusive-language": "2.2.1", "eslint-plugin-jest": "27.9.0", "eslint-plugin-jest-dom": "5.4.0", "eslint-plugin-jsdoc": "46.10.1", @@ -45,7 +44,6 @@ "eslint-plugin-react-hooks": "4.6.2", "eslint-plugin-svelte": "2.41.0", "eslint-plugin-testing-library": "6.2.2", - "eslint-plugin-wpcalypso": "8.0.0", "glob": "10.4.1", "ignore": "5.1.8", "jest": "29.7.0",