33import { fixupConfigRules , fixupPluginRules } from '@eslint/compat' ;
44import { FlatCompat } from '@eslint/eslintrc' ;
55import eslint from '@eslint/js' ;
6+ import eslintCommentsPlugin from '@eslint-community/eslint-plugin-eslint-comments/configs' ;
67import tseslintInternalPlugin from '@typescript-eslint/eslint-plugin-internal' ;
7- import eslintCommentsPlugin from 'eslint-plugin-eslint-comments' ;
88import eslintPluginPlugin from 'eslint-plugin-eslint-plugin' ;
99import importPlugin from 'eslint-plugin-import' ;
1010import jestPlugin from 'eslint-plugin-jest' ;
@@ -36,7 +36,6 @@ export default tseslint.config(
3636 plugins : {
3737 [ '@typescript-eslint' ] : tseslint . plugin ,
3838 [ '@typescript-eslint/internal' ] : tseslintInternalPlugin ,
39- [ 'eslint-comments' ] : eslintCommentsPlugin ,
4039 [ 'eslint-plugin' ] : eslintPluginPlugin ,
4140 [ 'import' ] : importPlugin ,
4241 [ 'jest' ] : jestPlugin ,
@@ -46,6 +45,8 @@ export default tseslint.config(
4645 [ 'perfectionist' ] : perfectionistPlugin ,
4746 // https://github.com/facebook/react/issues/28313
4847 [ 'react' ] : reactPlugin ,
48+ // @ts -expect-error -- Temporary types incompatibility pending flat config support
49+ // https://github.com/facebook/react/pull/30774
4950 [ 'react-hooks' ] : fixupPluginRules ( reactHooksPlugin ) ,
5051 [ 'regexp' ] : regexpPlugin ,
5152 [ 'unicorn' ] : unicornPlugin ,
@@ -88,6 +89,7 @@ export default tseslint.config(
8889 } ,
8990
9091 // extends ...
92+ eslintCommentsPlugin . recommended ,
9193 eslint . configs . recommended ,
9294 tseslint . configs . strictTypeChecked ,
9395 tseslint . configs . stylisticTypeChecked ,
@@ -252,35 +254,9 @@ export default tseslint.config(
252254 // eslint-plugin-eslint-comment
253255 //
254256
255- // require a eslint-enable comment for every eslint-disable comment
256- 'eslint-comments/disable-enable-pair' : [
257+ '@eslint-community/eslint-comments/disable-enable-pair' : [
257258 'error' ,
258- {
259- allowWholeFile : true ,
260- } ,
261- ] ,
262- // disallow a eslint-enable comment for multiple eslint-disable comments
263- 'eslint-comments/no-aggregating-enable' : 'error' ,
264- // disallow duplicate eslint-disable comments
265- 'eslint-comments/no-duplicate-disable' : 'error' ,
266- // disallow eslint-disable comments without rule names
267- 'eslint-comments/no-unlimited-disable' : 'error' ,
268- // disallow unused eslint-disable comments
269- 'eslint-comments/no-unused-disable' : 'error' ,
270- // disallow unused eslint-enable comments
271- 'eslint-comments/no-unused-enable' : 'error' ,
272- // disallow ESLint directive-comments
273- 'eslint-comments/no-use' : [
274- 'error' ,
275- {
276- allow : [
277- 'eslint-disable' ,
278- 'eslint-disable-line' ,
279- 'eslint-disable-next-line' ,
280- 'eslint-enable' ,
281- 'global' ,
282- ] ,
283- } ,
259+ { allowWholeFile : true } ,
284260 ] ,
285261
286262 //
@@ -574,8 +550,11 @@ export default tseslint.config(
574550 {
575551 extends : [
576552 jsxA11yPlugin . flatConfigs . recommended ,
553+ // https://github.com/facebook/react/pull/30774
554+ // @ts -expect-error -- Temporary types incompatibility pending flat config support
577555 reactPlugin . configs . flat . recommended ,
578556 // https://github.com/facebook/react/pull/30774
557+ // @ts -expect-error -- Temporary types incompatibility pending flat config support
579558 fixupConfigRules ( compat . config ( reactHooksPlugin . configs . recommended ) ) ,
580559 ] ,
581560 files : [ 'packages/website/**/*.{ts,tsx,mts,cts,js,jsx}' ] ,
0 commit comments