-
Notifications
You must be signed in to change notification settings - Fork 412
Expand file tree
/
Copy patheslint.config.mjs
More file actions
114 lines (113 loc) · 3.21 KB
/
Copy patheslint.config.mjs
File metadata and controls
114 lines (113 loc) · 3.21 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
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import stylistic from '@stylistic/eslint-plugin';
import prettierRecommended from 'eslint-plugin-prettier/recommended';
import react from 'eslint-plugin-react';
import jupyter from '@jupyter/eslint-plugin';
export default tseslint.config(
{
ignores: [
'node_modules',
'dist',
'lib',
'coverage',
'**/*.d.ts',
'tests',
'**/__tests__',
'ui-tests',
'packages',
'testutils'
]
},
{ plugins: { jupyter } },
...jupyter.configs.recommended,
{
rules: {
// Enabling these would require defining a `describedBy` argument
// schema for every command and threading a translator through every
// component (several flagged strings are CLI snippets / product names).
'jupyter/command-described-by': 'off',
'jupyter/no-untranslated-string': 'off',
'jupyter/prefer-lazy-imports': [
'error',
{
ignoreImports: [
// The plugin returns a `GitExtension` instance as the value of
// the `IGitExtension` token, so the class is needed at activation.
'./model',
// Registered while the application starts: the commands and
// menus, and the sidebar, which loads its content on first show.
'./commandsAndMenu',
'./widgets/GitWidget',
// The server settings are fetched at activation; the icons are
// used by the commands and the sidebar tab.
'./server',
'./style/icons'
]
}
]
}
},
{
files: ['**/*.ts', '**/*.tsx'],
extends: [
js.configs.recommended,
...tseslint.configs.recommended,
react.configs.flat.recommended,
prettierRecommended
],
languageOptions: {
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: import.meta.dirname,
sourceType: 'module'
}
},
plugins: {
'@stylistic': stylistic
},
settings: {
react: { version: 'detect' }
},
rules: {
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'interface',
format: ['PascalCase'],
custom: { regex: '^I[A-Z]', match: true }
}
],
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@stylistic/quotes': [
'error',
'single',
{ avoidEscape: true, allowTemplateLiterals: false }
],
curly: ['error', 'all'],
eqeqeq: 'error',
'no-restricted-imports': [
'error',
{
paths: [
{
name: '@mui/icons-material',
message:
"Please import icons using path imports, e.g. import AddIcon from '@mui/icons-material/Add'"
}
],
patterns: [
{
group: ['@mui/*/*/*'],
message: '3rd level imports in mui are considered private'
}
]
}
],
'prefer-arrow-callback': 'error'
}
}
);