-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy patheslint.config.mjs
More file actions
53 lines (51 loc) · 1.86 KB
/
eslint.config.mjs
File metadata and controls
53 lines (51 loc) · 1.86 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 storybook from 'eslint-plugin-storybook';
import { defineConfig, globalIgnores } from 'eslint/config';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintConfigPrettier from 'eslint-config-prettier';
import { requireLicenseHeader } from './lint-license-rule.mjs';
export default defineConfig([
globalIgnores(['lib/', 'node_modules/', 'src/parser/antlr/', '*.js', '*.mjs']),
eslint.configs.recommended,
...tseslint.configs.recommended,
{
plugins: {
'local-rules': {
rules: {
'require-license-header': requireLicenseHeader,
},
},
},
rules: {
'local-rules/require-license-header': 'error',
'@typescript-eslint/no-explicit-any': 'error',
// TypeScript handles this natively; ESLint's no-undef doesn't understand TS types
'no-undef': 'off',
// Rules that are actually active in Kibana and affects the code to be migrated,
// We can modify them once the migration is finished to avoid conflicts.
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'none',
caughtErrors: 'none',
ignoreRestSiblings: true,
varsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
},
],
'no-useless-escape': 'off',
'no-extra-boolean-cast': 'off',
'no-useless-assignment': 'off',
'no-constant-condition': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'no-console': 'error',
},
},
eslintConfigPrettier,
...storybook.configs['flat/recommended'],
]);