-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patheslint.config.js
More file actions
86 lines (82 loc) · 2.66 KB
/
eslint.config.js
File metadata and controls
86 lines (82 loc) · 2.66 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
import eslintJs from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import';
import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort';
import globals from 'globals';
import tseslint from 'typescript-eslint';
export default tseslint.config(
{
ignores: [
'node_modules/',
'dist/',
'out/',
'build/',
'coverage/',
'**/*.local',
'*~',
'eslint.config.js',
],
},
eslintJs.configs.recommended,
eslintConfigPrettier,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: ['**/*.js', '**/*.ts'],
plugins: {
import: importPlugin,
'simple-import-sort': simpleImportSortPlugin,
},
languageOptions: {
ecmaVersion: 2024,
sourceType: 'module',
globals: {
...globals.node,
...globals.browser,
},
},
rules: {
eqeqeq: ['error', 'always', { null: 'ignore' }],
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-constant-condition': ['error', { checkLoops: false }],
'one-var': ['error', 'never'],
'object-shorthand': ['error', 'always'],
'prefer-const': ['error', { destructuring: 'all' }],
'require-await': 'error',
'no-useless-escape': 'error',
'no-unneeded-ternary': 'error',
'no-unused-expressions': 'error',
'no-multi-assign': 'error',
'no-throw-literal': 'error',
'no-param-reassign': 'error',
'no-else-return': ['error', { allowElseIf: false }],
'dot-notation': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports' }],
'@typescript-eslint/parameter-properties': 'error',
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }],
// TODO: remove when we got rid of any in the code base
'@typescript-eslint/no-unsafe-assignment': ['off'],
'@typescript-eslint/no-unsafe-member-access': ['off'],
'simple-import-sort/imports': 'error',
'import/extensions': ['error', 'ignorePackages', { js: 'never', ts: 'always' }],
'import/no-default-export': 'error',
'import/no-duplicates': 'error',
'import/extensions': ['error', 'ignorePackages', { ts: 'always' }],
},
},
{
files: ['examples/**/*.ts'],
rules: {
'no-console': ['error', { allow: ['warn', 'error', 'log'] }],
},
},
);