-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
53 lines (52 loc) · 1.71 KB
/
Copy patheslint.config.mjs
File metadata and controls
53 lines (52 loc) · 1.71 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
import nx from '@nx/eslint-plugin';
import tseslint from 'typescript-eslint';
export default tseslint.config(
{
ignores: ['**/dist', '**/node_modules', '**/.nx', '**/coverage', '**/*.config.*'],
},
...nx.configs['flat/base'],
...nx.configs['flat/typescript'],
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
rules: {
'@nx/enforce-module-boundaries': [
'error',
{
enforceBuildableLibDependency: true,
allow: [],
depConstraints: [
// core depends on nothing internal
{ sourceTag: 'scope:core', onlyDependOnLibsWithTags: ['scope:core'] },
// cli may depend on core
{
sourceTag: 'scope:cli',
onlyDependOnLibsWithTags: ['scope:cli', 'scope:core', 'scope:fixtures'],
},
// ui may depend on core (types only)
{ sourceTag: 'scope:ui', onlyDependOnLibsWithTags: ['scope:ui', 'scope:core'] },
// fixtures depends on nothing internal (or core types)
{
sourceTag: 'scope:fixtures',
onlyDependOnLibsWithTags: ['scope:fixtures', 'scope:core'],
},
{ sourceTag: 'scope:e2e', onlyDependOnLibsWithTags: ['*'] },
],
},
],
},
},
{
files: ['**/*.ts', '**/*.tsx'],
rules: {
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
},
},
{
// Tests may reach for fixtures across boundaries; production code may not.
files: ['**/*.test.ts', '**/*.spec.ts', '**/*.test.tsx', '**/*.spec.tsx'],
rules: {
'@nx/enforce-module-boundaries': 'off',
},
},
);