1+ /* eslint-disable */
12import globals from 'globals' ;
3+ import importPlugin from 'eslint-plugin-import' ;
24import prettier from 'eslint-config-prettier' ;
35import sortImports from '@j4cobi/eslint-plugin-sort-imports' ;
46import ts from 'typescript-eslint' ;
7+ import json from '@eslint/json' ;
8+ import stylistic from '@stylistic/eslint-plugin' ;
9+ import { globalIgnores } from 'eslint/config' ;
510
611export default [
712 ...ts . configs . recommended ,
13+ importPlugin . flatConfigs . recommended ,
14+ importPlugin . flatConfigs . typescript ,
815 prettier ,
16+ globalIgnores ( [ './build/' ] ) ,
917 {
10- ignores : [ '**/node_modules/' , '**/build/' , '**/pnpm-lock.yaml' ] ,
11- languageOptions : {
12- ecmaVersion : 2022 ,
13- sourceType : 'module' ,
14- globals : {
15- ...globals . es2022 ,
16- ...globals . node
17- }
18- } ,
19- plugins : { 'sort-imports' : sortImports } ,
18+ ignores : [ 'package.json' ] ,
19+ files : [ '**/*.json' ] ,
20+ plugins : { json } ,
21+ language : 'json/json' ,
22+ rules : {
23+ 'json/no-duplicate-keys' : 'error' ,
24+ 'json/no-empty-keys' : 'error' ,
25+ 'json/no-unnormalized-keys' : 'error' ,
26+ 'json/no-unsafe-values' : 'error' ,
27+ 'json/sort-keys' : 'error'
28+ }
29+ } ,
30+ {
31+ ignores : [ 'build/*' ] ,
32+ files : [ '**/*.ts' , '**/*.js' ] ,
33+ languageOptions : { ecmaVersion : 2022 , sourceType : 'module' , globals : { ...globals . es2022 , ...globals . node } } ,
34+ plugins : { '@stylistic' : stylistic , 'sort-imports' : sortImports } ,
35+ settings : { 'import/resolver' : { typescript : true , node : true } } ,
2036 rules : {
2137 'sort-imports/sort-imports' : [
2238 'error' ,
2339 { ignoreCase : false , ignoreMemberSort : false , memberSyntaxSortOrder : [ 'all' , 'single' , 'multiple' , 'none' ] }
2440 ] ,
25- 'max-len' : [ 'error' , { code : 120 , ignoreUrls : true , ignoreComments : true } ] ,
41+ '@stylistic/max-len' : [
42+ 'error' ,
43+ { code : 120 , tabWidth : 2 , ignoreComments : true , ignoreUrls : true , ignoreRegExpLiterals : true }
44+ ] ,
45+ '@stylistic/space-before-function-paren' : [ 'error' , { anonymous : 'never' , named : 'never' , catch : 'always' } ] ,
46+ '@stylistic/function-call-argument-newline' : [ 'error' , 'consistent' ] ,
2647 '@typescript-eslint/no-unused-vars' : [ 'error' , { args : 'none' } ] ,
48+ '@stylistic/quotes' : [ 'error' , 'single' , { avoidEscape : true } ] ,
49+ '@stylistic/array-bracket-newline' : [ 'error' , 'consistent' ] ,
50+ '@stylistic/array-element-newline' : [ 'warn' , 'consistent' ] ,
2751 'no-constant-condition' : [ 'error' , { checkLoops : false } ] ,
52+ 'import/enforce-node-protocol-usage' : [ 'error' , 'always' ] ,
53+ 'no-extend-native' : [ 'warn' , { exceptions : [ 'Object' ] } ] ,
54+ '@stylistic/nonblock-statement-body-position' : 'error' ,
55+ '@stylistic/object-curly-spacing' : [ 'error' , 'always' ] ,
56+ '@stylistic/no-whitespace-before-property' : 'error' ,
57+ '@stylistic/one-var-declaration-per-line' : 'error' ,
2858 'prefer-const' : [ 'warn' , { destructuring : 'all' } ] ,
59+ '@stylistic/dot-location' : [ 'error' , 'property' ] ,
60+ '@stylistic/computed-property-spacing' : 'error' ,
61+ '@stylistic/no-mixed-spaces-and-tabs' : 'error' ,
62+ '@stylistic/type-named-tuple-spacing' : 'error' ,
63+ 'import/no-cycle' : [ 'error' , { maxDepth : 1 } ] ,
2964 curly : [ 'warn' , 'multi-line' , 'consistent' ] ,
65+ '@stylistic/no-multiple-empty-lines' : 'error' ,
66+ '@stylistic/max-statements-per-line' : 'error' ,
67+ '@stylistic/type-annotation-spacing' : 'error' ,
68+ 'import/no-anonymous-default-export' : 'error' ,
69+ '@stylistic/member-delimiter-style' : 'error' ,
70+ '@stylistic/template-curly-spacing' : 'error' ,
71+ 'import/no-extraneous-dependencies' : 'error' ,
3072 '@typescript-eslint/no-explicit-any' : 'off' ,
73+ '@stylistic/line-comment-position' : 'error' ,
74+ '@stylistic/object-curly-newline' : 'error' ,
75+ '@stylistic/array-bracket-spacing' : 'warn' ,
76+ 'import/no-useless-path-segments' : 'error' ,
77+ '@stylistic/switch-colon-spacing' : 'error' ,
78+ '@stylistic/type-generic-spacing' : 'error' ,
79+ '@stylistic/rest-spread-spacing' : 'error' ,
80+ '@stylistic/no-floating-decimal' : 'error' ,
81+ '@stylistic/space-before-blocks' : 'error' ,
82+ '@stylistic/no-trailing-spaces' : 'error' ,
83+ '@stylistic/no-confusing-arrow' : 'error' ,
84+ 'import/prefer-default-export' : 'error' ,
3185 'logical-assignment-operators' : 'warn' ,
3286 'no-template-curly-in-string' : 'error' ,
87+ '@stylistic/space-in-parens' : 'error' ,
88+ '@stylistic/space-infix-ops' : 'error' ,
89+ '@stylistic/no-multi-spaces' : 'error' ,
90+ '@stylistic/keyword-spacing' : 'error' ,
91+ '@stylistic/linebreak-style' : 'error' ,
3392 'quote-props' : [ 'error' , 'as-needed' ] ,
34- 'comma-dangle' : [ 'error' , 'never' ] ,
93+ 'import/newline-after-import' : 'warn' ,
94+ '@stylistic/spaced-comment' : 'error' ,
95+ '@stylistic/no-extra-semi' : 'error' ,
96+ '@stylistic/arrow-spacing' : 'error' ,
97+ '@stylistic/block-spacing' : 'error' ,
98+ '@stylistic/comma-spacing' : 'error' ,
99+ '@stylistic/curly-newline' : 'error' ,
100+ 'import/no-dynamic-require' : 'warn' ,
101+ '@stylistic/semi-spacing' : 'error' ,
102+ '@stylistic/arrow-parens' : 'error' ,
103+ 'import/no-absolute-path' : 'error' ,
104+ 'import/no-named-default' : 'error' ,
105+ '@stylistic/comma-dangle' : 'error' ,
106+ '@stylistic/brace-style' : 'error' ,
107+ '@stylistic/key-spacing' : 'error' ,
108+ '@stylistic/comma-style' : 'error' ,
35109 'no-useless-constructor' : 'error' ,
110+ '@stylistic/semi-style' : 'error' ,
111+ '@stylistic/wrap-regex' : 'error' ,
112+ '@stylistic/new-parens' : 'error' ,
36113 'no-useless-assignment' : 'error' ,
37114 'no-inner-declarations' : 'error' ,
115+ 'import/no-self-import' : 'error' ,
38116 'no-implicit-coercion' : 'error' ,
117+ 'import/no-deprecated' : 'error' ,
118+ '@stylistic/eol-last' : 'error' ,
119+ 'import/no-namespace' : 'error' ,
39120 'no-use-before-define' : 'warn' ,
40121 'no-underscore-dangle' : 'warn' ,
41122 'no-unneeded-ternary' : 'error' ,
123+ 'import/exports-last' : 'error' ,
124+ '@stylistic/no-tabs' : 'error' ,
42125 'default-param-last' : 'error' ,
126+ 'import/no-commonjs' : 'error' ,
43127 'one-var' : [ 'warn' , 'never' ] ,
44128 'no-inline-comments' : 'warn' ,
45129 'no-empty-function' : 'error' ,
46130 'no-useless-return' : 'error' ,
47131 'no-useless-rename' : 'warn' ,
48132 'no-useless-concat' : 'warn' ,
49133 'no-throw-literal' : 'error' ,
50- 'no-extend-native' : 'error' ,
51134 'default-case-last' : 'warn' ,
135+ '@stylistic/semi' : 'error' ,
52136 'no-self-compare' : 'error' ,
53137 'no-new-wrappers' : 'error' ,
138+ yoda : [ 'error' , 'never' ] ,
139+ '@stylistic/semi' : 'error' ,
54140 'no-lone-blocks' : 'error' ,
55141 'no-undef-init' : 'error' ,
56142 'no-else-return' : 'warn' ,
57- 'no-extra-semi ' : 'error' ,
143+ 'import/first ' : 'error' ,
58144 'require-await' : 'warn' ,
59- yoda : [ 'error' , 'always' ] ,
60145 'default-case' : 'error' ,
61146 'dot-notation' : 'error' ,
62147 'no-sequences' : 'warn' ,
@@ -66,8 +151,7 @@ export default [
66151 'no-console' : 'error' ,
67152 camelcase : 'warn' ,
68153 'no-var' : 'warn' ,
69- eqeqeq : 'warn' ,
70- semi : 'error'
154+ eqeqeq : 'warn'
71155 }
72156 }
73157] ;
0 commit comments