-
Notifications
You must be signed in to change notification settings - Fork 89
/
Copy patheslint.config.js
133 lines (131 loc) · 4.47 KB
/
eslint.config.js
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import tsParser from '@typescript-eslint/parser';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import importPlugin from 'eslint-plugin-import';
import eslintCommentsPlugin from 'eslint-plugin-eslint-comments';
import functionalPlugin from 'eslint-plugin-functional';
import monorepoCopPlugin from 'eslint-plugin-monorepo-cop';
import prettierConfig from 'eslint-config-prettier';
export default [
{
ignores: [
'**/node_modules/**',
'**/dist/**',
'**/coverage/**',
'**/site/**',
'**/.tsimp/**',
'**/*.json'
]
},
{
languageOptions: {
parser: tsParser,
parserOptions: {
project: ['./tsconfig.json', './src/*/tsconfig.json'],
ecmaVersion: 2020,
sourceType: 'module',
},
globals: {
BigInt: true,
console: true,
WebAssembly: true,
},
},
plugins: {
'@typescript-eslint': tsPlugin,
'import': importPlugin,
'eslint-comments': eslintCommentsPlugin,
'functional': functionalPlugin,
'monorepo-cop': monorepoCopPlugin,
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
},
files: ['**/*.ts', '**/*.tsx'], // Explicitly only match TypeScript files
rules: {
...tsPlugin.configs.recommended.rules,
...eslintCommentsPlugin.configs.recommended.rules,
...functionalPlugin.configs.lite.rules,
...prettierConfig.rules,
'import/extensions': [
'error',
'ignorePackages',
{ js: 'always', ts: 'never', tsx: 'never' }
],
'functional/no-class-inheritance': 'off',
'functional/no-mixed-types': 'off',
'functional/no-classes': 'off',
'functional/no-return-void': 'off',
'functional/no-let': 'off',
'functional/no-loop-statements': 'off',
'functional/no-throw-statements': 'off',
'functional/immutable-data': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'eslint-comments/disable-enable-pair': [
'error',
{ allowWholeFile: true }
],
'eslint-comments/no-unused-disable': 'error',
'import/order': [
'error',
{ 'newlines-between': 'always', alphabetize: { order: 'asc' } }
],
'sort-imports': [
'error',
{ ignoreDeclarationSort: true, ignoreCase: true }
],
'monorepo-cop/no-relative-import-outside-package': 'error',
'@typescript-eslint/naming-convention': [
'error',
{
selector: ['variable', 'function'],
format: ['camelCase'],
leadingUnderscore: 'allow',
},
{
selector: 'class',
format: ['PascalCase'],
},
{
selector: ['classMethod'],
format: ['camelCase'],
leadingUnderscore: 'allow'
},
{
selector: 'parameter',
format: ['camelCase'],
leadingUnderscore: 'allow'
},
{
selector: 'typeLike',
format: ['PascalCase']
}
]
}
},
{
plugins: {
'@typescript-eslint': tsPlugin,
},
// Only apply to package index files, excluding test files and non-root index files
files: ['./src/*/index.ts'],
rules: {
'@typescript-eslint/naming-convention': [
'error',
{
selector: ['variable', 'function'],
modifiers: ['exported'],
format: ['PascalCase'],
prefix: ['ax']
},
{
selector: ['class', 'interface', 'typeAlias', 'enum', 'typeParameter'],
modifiers: ['exported'],
format: ['PascalCase'],
prefix: ['Ax']
}
]
}
}
];