-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy patheslint.config.mjs
More file actions
88 lines (78 loc) · 2.2 KB
/
Copy patheslint.config.mjs
File metadata and controls
88 lines (78 loc) · 2.2 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
import base from '@juntossomosmais/linters/eslint-config/flat/base.mjs'
import storybook from 'eslint-plugin-storybook'
export default [
{
ignores: [
'**/node_modules/**',
'**/build/**',
'**/dist/**',
'**/coverage/**',
'**/storybook-static/**',
'**/*.d.ts',
'packages/core/output-target/**',
'packages/core/loader/**',
'packages/core/react/**',
'packages/core/vue/**',
'packages/react/**',
'packages/vue/**',
'.commitlintrc.js',
'.prettierrc.js',
],
},
...base,
...storybook.configs['flat/recommended'],
{
// The shared base only enables non-type-aware TS rules. Disabling `project`
// avoids requiring every TS file to belong to a tsconfig.
files: ['**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts'],
languageOptions: { parserOptions: { project: false } },
rules: {
// The base config keeps the Stencil `h` import alive. Also accept the
// conventional `_`-prefix for intentionally unused arguments.
'@typescript-eslint/no-unused-vars': [
2,
{ varsIgnorePattern: '^h$', argsIgnorePattern: '^_' },
],
},
},
{
settings: {
'import/resolver': {
node: { extensions: ['.js', '.jsx', '.ts', '.tsx'] },
typescript: { project: './tsconfig.base.json' },
},
},
},
{
files: ['**/*.spec.{js,ts,tsx}'],
rules: {
'no-console': 'off',
'sonarjs/no-duplicate-string': 'off',
'sonarjs/unused-import': 'off',
},
},
{
files: ['**/scripts/**'],
rules: { 'no-console': 'off' },
},
{
files: ['**/*.tsx'],
rules: { 'sonarjs/unused-import': 'off' },
},
{
// Stories are example code: console, any, slow regex, and nested
// assignments are routine teaching patterns rather than real bugs.
files: ['**/stories/**', '**/*.stories.{ts,tsx}'],
rules: {
'no-console': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'sonarjs/slow-regex': 'off',
'sonarjs/no-nested-assignment': 'off',
},
},
{
// Storybook config files need `any` for the framework typings.
files: ['**/.storybook/**'],
rules: { '@typescript-eslint/no-explicit-any': 'off' },
},
]