@@ -12,7 +12,7 @@ import unicorn from 'eslint-plugin-unicorn';
1212import { defineConfig , globalIgnores } from 'eslint/config' ;
1313import js from '@eslint/js' ;
1414import html from 'eslint-plugin-html' ;
15- import tseslint from '@ typescript-eslint/parser' ;
15+ import tseslint from 'typescript-eslint' ; // Replace plugin-only import with meta package that includes configs
1616import sortDestructureKeys from 'eslint-plugin-sort-destructure-keys' ;
1717import {
1818 configs as airbnbConfigs ,
@@ -40,9 +40,15 @@ export default defineConfig([
4040 '**/test-results' ,
4141 '**/playwright-report*' ,
4242 'eslint.config.mjs' ,
43+ // newly ignored generated/build artifacts
44+ 'build/**' ,
45+ 'sdk/**' ,
46+ 'docs/_site/**' ,
47+ 'docs/vendor/**' ,
48+ 'docs/**/*.html' ,
4349 ] ) ,
4450
45- //imports
51+ // imports
4652 importX . flatConfigs . recommended ,
4753 { rules : { ...airbnbPlugins . importX . rules } } ,
4854
@@ -66,21 +72,16 @@ export default defineConfig([
6672 } ,
6773 } ,
6874 } ,
69-
70- {
71- files : [ '**/*.json' ] ,
72- extends : [ tseslint . configs . disableTypeChecked ] ,
73- } ,
75+ { files : [ '**/*.json' ] , extends : [ tseslint . configs . disableTypeChecked ] } ,
7476
7577 {
7678 settings : {
7779 'import-x/resolver-next' : [
7880 eslintImportResolverTypescript . createTypeScriptImportResolver ( {
7981 project : [
80- 'frontend/tsconfig.json' ,
8182 'lambdas/*/tsconfig.json' ,
8283 'tests/test-team/tsconfig.json' ,
83- 'utils /*/tsconfig.json' ,
84+ 'internal /*/tsconfig.json' ,
8485 ] ,
8586 } ) ,
8687 ] ,
@@ -91,10 +92,7 @@ export default defineConfig([
9192 rules : {
9293 '@typescript-eslint/no-unused-vars' : [
9394 2 ,
94- {
95- argsIgnorePattern : '^_' ,
96- varsIgnorePattern : '^_' ,
97- } ,
95+ { argsIgnorePattern : '^_' , varsIgnorePattern : '^_' } ,
9896 ] ,
9997 '@typescript-eslint/consistent-type-definitions' : 0 ,
10098 } ,
@@ -107,22 +105,13 @@ export default defineConfig([
107105 'unicorn/prevent-abbreviations' : 0 ,
108106 'unicorn/filename-case' : [
109107 2 ,
110- {
111- case : 'kebabCase' ,
112- ignore : [ '.tsx' ] ,
113- } ,
108+ { case : 'kebabCase' , ignore : [ '.tsx' ] } ,
114109 ] ,
115110 'unicorn/no-null' : 0 ,
116111 'unicorn/prefer-module' : 0 ,
117112 'unicorn/import-style' : [
118113 2 ,
119- {
120- styles : {
121- path : {
122- named : true ,
123- } ,
124- } ,
125- } ,
114+ { styles : { path : { named : true } } } ,
126115 ] ,
127116 } ,
128117 } ,
@@ -145,103 +134,54 @@ export default defineConfig([
145134 // jsxA11y
146135 {
147136 files : [ '**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}' ] ,
148- plugins : {
149- 'jsx-a11y' : jsxA11y ,
150- } ,
151- languageOptions : {
152- parserOptions : {
153- ecmaFeatures : {
154- jsx : true ,
155- } ,
156- } ,
157- } ,
137+ plugins : { 'jsx-a11y' : jsxA11y } ,
138+ languageOptions : { parserOptions : { ecmaFeatures : { jsx : true } } } ,
158139 } ,
159140
160141 // security
161142 security . configs . recommended ,
162-
163143 // sonar
164144 sonarjs . configs . recommended ,
165-
166145 // html
167- {
168- files : [ '**/*.html' ] ,
169- plugins : { html } ,
170- } ,
171-
172- // Next.js
173- ...compat . config ( {
174- extends : [ 'next' , 'next/core-web-vitals' , 'next/typescript' ] ,
175- settings : {
176- next : {
177- rootDir : 'frontend' ,
178- } ,
179- } ,
180- rules : {
181- // needed because next lint rules look for a pages directory
182- '@next/next/no-html-link-for-pages' : 0 ,
183- } ,
184- } ) ,
146+ { files : [ '**/*.html' ] , plugins : { html } } ,
185147
186148 // json
187- {
188- files : [ '**/*.json' ] ,
189- ...json . configs [ 'recommended' ] ,
190- } ,
149+ { files : [ '**/*.json' ] , ...json . configs [ 'recommended' ] } ,
191150
192151 // destructure sorting
193152 {
194153 name : 'eslint-plugin-sort-destructure-keys' ,
195- plugins : {
196- 'sort-destructure-keys' : sortDestructureKeys ,
197- } ,
198- rules : {
199- 'sort-destructure-keys/sort-destructure-keys' : 2 ,
200- } ,
154+ plugins : { 'sort-destructure-keys' : sortDestructureKeys } ,
155+ rules : { 'sort-destructure-keys/sort-destructure-keys' : 2 } ,
201156 } ,
202157
203158 // imports
204159 {
205160 rules : {
206- 'sort-imports' : [
207- 2 ,
208- {
209- ignoreDeclarationSort : true ,
210- } ,
211- ] ,
161+ 'sort-imports' : [ 2 , { ignoreDeclarationSort : true } ] ,
212162 'import-x/extensions' : 0 ,
213163 } ,
214164 } ,
215165 {
216166 files : [ '**/*.ts' , '**/*.tsx' ] ,
217- rules : {
218- 'import-x/no-unresolved' : 0 , // trust the typescript compiler to catch unresolved imports
219- } ,
167+ rules : { 'import-x/no-unresolved' : 0 } ,
220168 } ,
221169 {
222170 files : [ 'tests/test-team/**' ] ,
223171 rules : {
224172 'import-x/no-extraneous-dependencies' : [
225173 2 ,
226- {
227- devDependencies : true ,
228- } ,
174+ { devDependencies : true } ,
229175 ] ,
230176 } ,
231177 } ,
232178 {
233179 files : [ '**/utils/**' , 'tests/test-team/**' ] ,
234- rules : {
235- 'import-x/prefer-default-export' : 0 ,
236- } ,
180+ rules : { 'import-x/prefer-default-export' : 0 } ,
237181 } ,
238182 {
239- plugins : {
240- 'no-relative-import-paths' : noRelativeImportPaths ,
241- } ,
242- rules : {
243- 'no-relative-import-paths/no-relative-import-paths' : 2 ,
244- } ,
183+ plugins : { 'no-relative-import-paths' : noRelativeImportPaths } ,
184+ rules : { 'no-relative-import-paths/no-relative-import-paths' : 2 } ,
245185 } ,
246186 {
247187 files : [ 'scripts/**' ] ,
@@ -253,14 +193,44 @@ export default defineConfig([
253193 } ,
254194 } ,
255195
196+ // js parserOptions override to suppress project service warnings for loose JS files
197+ {
198+ files : [ '**/*.js' , '**/*.cjs' , '**/*.mjs' ] ,
199+ languageOptions : {
200+ parserOptions : {
201+ allowDefaultProject : true ,
202+ noWarnOnMultipleProjects : true , // suppress informational warning
203+ } ,
204+ } ,
205+ } ,
206+ // tests: relax package import restriction
207+ {
208+ files : [ '**/__test__/**' , '**/__tests__/**' , '**/*.test.ts' , '**/*.test.js' ] ,
209+ rules : {
210+ 'import-x/no-relative-packages' : 0 ,
211+ 'security/detect-non-literal-fs-filename' : 0
212+ } ,
213+ } ,
214+
215+ // CLI tools
216+ {
217+ files : [ '**/cli/**' ] ,
218+ rules : {
219+ 'no-console' : 0 ,
220+ 'security/detect-non-literal-fs-filename' : 0
221+ } ,
222+ } ,
223+
256224 // misc rule overrides
257225 {
258226 rules : {
259227 'no-restricted-syntax' : 0 ,
260228 'no-underscore-dangle' : 0 ,
261229 'no-await-in-loop' : 0 ,
262230 'no-plusplus' : [ 2 , { allowForLoopAfterthoughts : true } ] ,
263- 'unicorn/prefer-top-level-await' : 0 , // top level await is not available in commonjs
231+ 'unicorn/prefer-top-level-await' : 0 ,
232+ 'import-x/no-relative-packages' : 1 ,
233+ 'no-relative-import-paths/no-relative-import-paths' : 1
264234 } ,
265235 } ,
266236] ) ;
0 commit comments