11// SPDX-License-Identifier: Apache-2.0
2+ import eslintPluginEslintComments from '@eslint-community/eslint-plugin-eslint-comments' ;
23import stylistic from '@stylistic/eslint-plugin' ;
34import tsEslint from '@typescript-eslint/eslint-plugin' ;
45import tsParser from '@typescript-eslint/parser' ;
56import eslintStandard from 'eslint-config-love' ;
6- import eslintPluginEslintComments from 'eslint-plugin-eslint-comments' ;
7+ import eslintConfigPrettier from 'eslint-config-prettier/flat' ;
8+ import { defineConfig , globalIgnores } from 'eslint/config' ;
79
8- export default [
10+ export default defineConfig ( [
11+ eslintConfigPrettier ,
12+ globalIgnores ( [ '**/coverage/**' , '**/build/**' , '**/node_modules/**' , '**/__tests__/**' , '*.ts' ] ) ,
913 {
1014 files : [ '**/*.ts' ] ,
1115 plugins : {
1216 ...eslintStandard . plugins ,
13- [ 'eslint-comments' ] : eslintPluginEslintComments ,
14- [ '@typescript-eslint' ] : tsEslint ,
17+ [ '@eslint-community/eslint-comments' ] : eslintPluginEslintComments ,
1518 [ '@stylistic' ] : stylistic ,
19+ [ '@typescript-eslint' ] : tsEslint ,
1620 } ,
1721 languageOptions : {
1822 ...eslintStandard . languageOptions ,
@@ -26,30 +30,37 @@ export default [
2630 rules : {
2731 ...eslintStandard . rules ,
2832 ...eslintPluginEslintComments . configs . recommended . rules ,
29- 'eslint-comments/require-description' : [ 'warn' , { 'ignore' : [ ] } ] ,
30- 'eslint-comments/disable-enable-pair' : 'warn' ,
31- 'no-console' : 'warn' ,
32- '@typescript-eslint/restrict-template-expressions' : 'error' ,
33+ '@eslint-community/eslint-comments/require-description' : [ 'error' , { ignore : [ 'eslint-enable' ] } ] ,
34+ '@eslint-community/eslint-comments/disable-enable-pair' : 'error' ,
35+ '@typescript-eslint/class-methods-use-this' : 'off' ,
36+ '@typescript-eslint/init-declarations' : 'off' ,
37+ '@typescript-eslint/max-params' : [ 'warn' , { max : 5 } ] ,
3338 '@typescript-eslint/no-non-null-assertion' : 'off' ,
34- '@typescript-eslint/strict-boolean-expressions' : 'off' ,
3539 '@typescript-eslint/no-explicit-any' : 'error' ,
3640 '@typescript-eslint/no-floating-promises' : 'off' ,
41+ '@typescript-eslint/no-magic-numbers' : 'warn' ,
42+ '@typescript-eslint/no-misused-spread' : 'off' ,
3743 '@typescript-eslint/no-var-requires' : 'off' ,
44+ '@typescript-eslint/no-unsafe-type-assertion' : 'off' ,
45+ '@typescript-eslint/no-unnecessary-condition' : 'warn' ,
3846 '@typescript-eslint/no-use-before-define' : 'off' ,
39- '@typescript-eslint/prefer-optional-chain' : 'off' ,
40- '@stylistic/indent' : [ 'error' , 2 ] ,
41- '@stylistic/semi' : [ 'warn' , 'always' ] ,
47+ '@typescript-eslint/prefer-destructuring' : 'warn' ,
48+ '@typescript-eslint/prefer-optional-chain' : 'warn' ,
49+ '@typescript-eslint/restrict-template-expressions' : 'error' ,
50+ '@typescript-eslint/strict-boolean-expressions' : 'off' ,
4251 '@stylistic/quotes' : [ 'error' , 'single' ] ,
43- '@stylistic/quote-props' : [ 'warn' , 'as-needed' ] ,
44- '@stylistic/arrow-parens' : [ "warn" , "always" ] ,
52+ 'complexity' : [ 'warn' , { max : 25 } ] ,
53+ 'max-depth' : [ 'warn' , { max : 5 } ] ,
54+ 'max-lines' : 'off' ,
55+ 'no-console' : 'error' ,
56+ 'no-unneeded-ternary' : 'off' ,
57+ /* eslint-comments are bundled with eslint-config-love but they are using the unmaintained plugin. Replaced with @eslint-community/eslint-plugin-eslint-comments */
58+ 'eslint-comments/require-description' : 'off' ,
59+ 'eslint-comments/disable-enable-pair' : 'off' ,
60+ 'eslint-comments/no-aggregating-enable' : 'off' ,
61+ 'eslint-comments/no-duplicate-disable' : 'off' ,
62+ 'eslint-comments/no-unlimited-disable' : 'off' ,
63+ 'eslint-comments/no-unused-enable' : 'off' ,
4564 } ,
46- ignores : [
47- '**/coverage/**' ,
48- '**/build/**' ,
49- '**/node_modules/**' ,
50- '**/__tests__/**' ,
51- '**/jest.config.ts' ,
52- '**/cluster-setup.ts' ,
53- ] ,
54- }
55- ] ;
65+ } ,
66+ ] ) ;
0 commit comments