-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.mjs
More file actions
115 lines (113 loc) · 3.1 KB
/
eslint.config.mjs
File metadata and controls
115 lines (113 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import nx from '@nx/eslint-plugin';
import * as jsoncParser from 'jsonc-eslint-parser';
export default [
{
files: ['**/*.json'],
rules: {
'@nx/dependency-checks': [
'error',
{
ignoredFiles: [
'{projectRoot}/*.config.{js,ts,mjs,mts,cjs,cts}',
'{projectRoot}/**/eslint.config.{js,ts,mjs,mts,cjs,cts}',
'{projectRoot}/**/vitest.config.{js,ts,mjs,mts,cjs,cts}',
'{projectRoot}/**/vite.config.{js,ts,mjs,mts,cjs,cts}',
],
},
],
},
languageOptions: {
parser: jsoncParser,
},
},
...nx.configs['flat/base'],
...nx.configs['flat/typescript'],
...nx.configs['flat/javascript'],
{
ignores: [
'**/dist',
'**/vite.config.*.timestamp*',
'**/vitest.config.*.timestamp*',
// Exclude scripts from dependency analysis to prevent false circular dependencies
'scripts/**',
'e2e/**',
// Generated contracts use package imports intentionally (not relative)
'packages/adt-contracts/src/generated/**',
// Fixture payloads are captured SAP responses, not source code
'packages/adt-fixtures/src/fixtures/**',
// Generated schemas/types across packages
'**/src/schemas/generated/**',
'**/src/generated/**',
// Config files are build-time only, not runtime dependencies
'**/*.config.ts',
'**/*.config.mts',
],
},
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
rules: {
'@nx/enforce-module-boundaries': [
'error',
{
enforceBuildableLibDependency: true,
allow: [
'^.*/eslint(\\.base)?\\.config\\.[cm]?js$',
'^.*/tsdown\\.config\\.(ts|js|mjs)$',
'^.*/samples/.*',
'^.*\\.config\\..*\\.ts$',
],
depConstraints: [
{
sourceTag: '*',
onlyDependOnLibsWithTags: ['*'],
},
],
},
],
},
},
{
// Disable module boundaries for config files (not runtime code)
files: [
'**/*.config.ts',
'**/*.config.*.ts',
'**/*.config.js',
'**/*.config.mjs',
'**/samples/**',
],
rules: {
'@nx/enforce-module-boundaries': 'off',
},
},
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
// Override or add rules here
rules: {
'@typescript-eslint/no-unused-vars': [
'warn',
{
varsIgnorePattern: '^_',
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
},
],
},
},
{
// In tests, non-null assertions and `any` are idiomatic: test data shape is
// known, mocks deliberately use loose typing, and type-inference tests
// intentionally assign client handles just to type-check.
files: [
'**/*.test.ts',
'**/*.test.tsx',
'**/*.spec.ts',
'**/tests/**/*.ts',
'**/tests/**/*.tsx',
],
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
},
];