@@ -8,142 +8,142 @@ import typescript from '@code-pushup/eslint-config/typescript.js';
88import vitest from '@code-pushup/eslint-config/vitest.js' ;
99
1010export default tseslint . config (
11- ...typescript ,
12- ...node ,
13- ...vitest ,
14- {
15- settings : {
16- 'import/resolver' : { typescript : { project : 'tsconfig.base.json' } } ,
17- } ,
18- } ,
19- { plugins : { '@nx' : nxEslintPlugin } } ,
20- {
21- files : [ '**/*.ts' , '**/*.tsx' , '**/*.js' , '**/*.jsx' ] ,
22- rules : {
23- '@nx/enforce-module-boundaries' : [
24- 'error' ,
25- {
26- enforceBuildableLibDependency : true ,
27- allow : [
28- String . raw `^.*/eslint(\.base)?\.config\.[cm]?js$` ,
29- String . raw `^.*/code-pushup\.(config|preset)(\.m?[jt]s)?$` ,
30- '^[./]+/tools/.*$' ,
31- String . raw `^[./]+/(testing/)?test-setup-config/src/index\.js$` ,
32- ] ,
33- depConstraints : [
34- {
35- sourceTag : 'scope:shared' ,
36- onlyDependOnLibsWithTags : [ 'scope:shared' ] ,
37- } ,
38- {
39- sourceTag : 'scope:core' ,
40- onlyDependOnLibsWithTags : [ 'scope:core' , 'scope:shared' ] ,
41- } ,
42- {
43- sourceTag : 'scope:plugin' ,
44- onlyDependOnLibsWithTags : [ 'scope:shared' ] ,
45- } ,
46- {
47- sourceTag : 'scope:tooling' ,
48- onlyDependOnLibsWithTags : [ 'scope:tooling' , 'scope:shared' ] ,
49- } ,
50- {
51- sourceTag : 'type:e2e' ,
52- onlyDependOnLibsWithTags : [
53- 'type:app' ,
54- 'type:feature' ,
55- 'type:util' ,
56- 'type:testing' ,
57- ] ,
58- } ,
59- {
60- sourceTag : 'type:app' ,
61- onlyDependOnLibsWithTags : [
62- 'type:feature' ,
63- 'type:util' ,
64- 'type:testing' ,
65- ] ,
66- } ,
67- {
68- sourceTag : 'type:feature' ,
69- onlyDependOnLibsWithTags : [
70- 'type:feature' ,
71- 'type:util' ,
72- 'type:testing' ,
73- ] ,
74- } ,
75- {
76- sourceTag : 'type:util' ,
77- onlyDependOnLibsWithTags : [ 'type:util' , 'type:testing' ] ,
78- } ,
79- {
80- sourceTag : 'type:testing' ,
81- onlyDependOnLibsWithTags : [ 'type:util' , 'type:testing' ] ,
82- } ,
83- ] ,
84- } ,
85- ] ,
86- } ,
11+ ...typescript ,
12+ ...node ,
13+ ...vitest ,
14+ {
15+ settings : {
16+ 'import/resolver' : { typescript : { project : 'tsconfig.base.json' } } ,
8717 } ,
88- {
89- files : [ '**/*.test.ts' , '**/*.spec.ts' ] ,
90- plugins : { 'jest-extended' : jestExtendedPlugin } ,
91- rules : {
92- 'vitest/consistent-test-filename' : [
93- 'warn' ,
94- {
95- pattern : String . raw `.*\.(bench|type|unit|int|e2e)\.test\.[tj]sx?$` ,
96- } ,
97- ] ,
98- 'jest-extended/prefer-to-be-array' : 'warn' ,
99- 'jest-extended/prefer-to-be-false' : 'warn' ,
100- 'jest-extended/prefer-to-be-object' : 'warn' ,
101- 'jest-extended/prefer-to-be-true' : 'warn' ,
102- 'jest-extended/prefer-to-have-been-called-once' : 'warn' ,
18+ } ,
19+ { plugins : { '@nx' : nxEslintPlugin } } ,
20+ {
21+ files : [ '**/*.ts' , '**/*.tsx' , '**/*.js' , '**/*.jsx' ] ,
22+ rules : {
23+ '@nx/enforce-module-boundaries' : [
24+ 'error' ,
25+ {
26+ enforceBuildableLibDependency : true ,
27+ allow : [
28+ String . raw `^.*/eslint(\.base)?\.config\.[cm]?js$` ,
29+ String . raw `^.*/code-pushup\.(config|preset)(\.m?[jt]s)?$` ,
30+ '^[./]+/tools/.*$' ,
31+ String . raw `^[./]+/(testing/)?test-setup-config/src/index\.js$` ,
32+ ] ,
33+ depConstraints : [
34+ {
35+ sourceTag : 'scope:shared' ,
36+ onlyDependOnLibsWithTags : [ 'scope:shared' ] ,
37+ } ,
38+ {
39+ sourceTag : 'scope:core' ,
40+ onlyDependOnLibsWithTags : [ 'scope:core' , 'scope:shared' ] ,
41+ } ,
42+ {
43+ sourceTag : 'scope:plugin' ,
44+ onlyDependOnLibsWithTags : [ 'scope:shared' ] ,
45+ } ,
46+ {
47+ sourceTag : 'scope:tooling' ,
48+ onlyDependOnLibsWithTags : [ 'scope:tooling' , 'scope:shared' ] ,
49+ } ,
50+ {
51+ sourceTag : 'type:e2e' ,
52+ onlyDependOnLibsWithTags : [
53+ 'type:app' ,
54+ 'type:feature' ,
55+ 'type:util' ,
56+ 'type:testing' ,
57+ ] ,
58+ } ,
59+ {
60+ sourceTag : 'type:app' ,
61+ onlyDependOnLibsWithTags : [
62+ 'type:feature' ,
63+ 'type:util' ,
64+ 'type:testing' ,
65+ ] ,
66+ } ,
67+ {
68+ sourceTag : 'type:feature' ,
69+ onlyDependOnLibsWithTags : [
70+ 'type:feature' ,
71+ 'type:util' ,
72+ 'type:testing' ,
73+ ] ,
74+ } ,
75+ {
76+ sourceTag : 'type:util' ,
77+ onlyDependOnLibsWithTags : [ 'type:util' , 'type:testing' ] ,
78+ } ,
79+ {
80+ sourceTag : 'type:testing' ,
81+ onlyDependOnLibsWithTags : [ 'type:util' , 'type:testing' ] ,
82+ } ,
83+ ] ,
10384 } ,
85+ ] ,
10486 } ,
105- {
106- files : [ '**/*.type.test.ts' ] ,
107- rules : {
108- 'vitest/expect-expect' : 'off' ,
87+ } ,
88+ {
89+ files : [ '**/*.test.ts' , '**/*.spec.ts' ] ,
90+ plugins : { 'jest-extended' : jestExtendedPlugin } ,
91+ rules : {
92+ 'vitest/consistent-test-filename' : [
93+ 'warn' ,
94+ {
95+ pattern : String . raw `.*\.(bench|type|unit|int|e2e)\.test\.[tj]sx?$` ,
10996 } ,
97+ ] ,
98+ 'jest-extended/prefer-to-be-array' : 'warn' ,
99+ 'jest-extended/prefer-to-be-false' : 'warn' ,
100+ 'jest-extended/prefer-to-be-object' : 'warn' ,
101+ 'jest-extended/prefer-to-be-true' : 'warn' ,
102+ 'jest-extended/prefer-to-have-been-called-once' : 'warn' ,
110103 } ,
111- {
112- files : [ '**/*.json' ] ,
113- languageOptions : { parser : jsoncParser } ,
114- } ,
115- {
116- files : [ '**/*.ts' , '**/*.js' ] ,
117- rules : {
118- 'n/file-extension-in-import' : [ 'error' , 'always' ] ,
119- 'unicorn/number-literal-case' : 'off' ,
120- } ,
104+ } ,
105+ {
106+ files : [ '**/*.type.test.ts' ] ,
107+ rules : {
108+ 'vitest/expect-expect' : 'off' ,
121109 } ,
122- {
123- files : [ '**/perf/**/*.ts' ] ,
124- rules : {
125- '@typescript-eslint/no-magic-numbers' : 'off' ,
126- 'sonarjs/no-duplicate-string' : 'off' ,
127- } ,
110+ } ,
111+ {
112+ files : [ '**/*.json' ] ,
113+ languageOptions : { parser : jsoncParser } ,
114+ } ,
115+ {
116+ files : [ '**/*.ts' , '**/*.js' ] ,
117+ rules : {
118+ 'n/file-extension-in-import' : [ 'error' , 'always' ] ,
119+ 'unicorn/number-literal-case' : 'off' ,
128120 } ,
129- {
130- // tests need only be compatible with local Node version
131- // publishable packages should pick up version range from "engines" in their package.json
132- files : [ 'e2e/**/*.ts' , 'testing/**/*.ts' , '**/*.test.ts' ] ,
133- settings : {
134- node : {
135- version : fs . readFileSync ( '.node-version' , 'utf8' ) ,
136- } ,
137- } ,
121+ } ,
122+ {
123+ files : [ '**/perf/**/*.ts' ] ,
124+ rules : {
125+ '@typescript-eslint/no-magic-numbers' : 'off' ,
126+ 'sonarjs/no-duplicate-string' : 'off' ,
138127 } ,
139- {
140- ignores : [
141- '**/*.mock.*' ,
142- '**/code-pushup.config.ts' ,
143- ' **/mocks/fixtures/**' ,
144- '**/__snapshots__/**' ,
145- '**/dist' ,
146- '**/*.md' ,
147- ] ,
128+ } ,
129+ {
130+ // tests need only be compatible with local Node version
131+ // publishable packages should pick up version range from "engines" in their package.json
132+ files : [ 'e2e/ **/*.ts' , 'testing/**/*.ts' , '**/*.test.ts' ] ,
133+ settings : {
134+ node : {
135+ version : fs . readFileSync ( '.node-version' , 'utf8' ) ,
136+ } ,
148137 } ,
138+ } ,
139+ {
140+ ignores : [
141+ '**/*.mock.*' ,
142+ '**/code-pushup.config.ts' ,
143+ '**/mocks/fixtures/**' ,
144+ '**/__snapshots__/**' ,
145+ '**/dist' ,
146+ '**/*.md' ,
147+ ] ,
148+ } ,
149149) ;
0 commit comments