-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patheslint.config.js
More file actions
63 lines (62 loc) · 1.82 KB
/
eslint.config.js
File metadata and controls
63 lines (62 loc) · 1.82 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
const eslint = require('@eslint/js');
const prettierConfig = require('eslint-config-prettier');
const importPlugin = require('eslint-plugin-import');
const prettierPlugin = require('eslint-plugin-prettier');
const tseslint = require('typescript-eslint');
module.exports = [
{
ignores: [
'node_modules/**',
'dist/**',
'coverage/**',
'build/**',
'*.min.js',
'jest.config.js',
'webpack.config.js',
],
},
...tseslint.config(eslint.configs.recommended, ...tseslint.configs.recommended, prettierConfig, {
languageOptions: {
ecmaVersion: 2021,
sourceType: 'module',
globals: {
module: 'writable',
require: 'readonly',
__dirname: 'readonly',
console: 'readonly',
TextDecoder: 'readonly',
TextEncoder: 'readonly',
Javy: 'readonly',
},
},
plugins: {
'@typescript-eslint': tseslint.plugin,
import: importPlugin,
prettier: prettierPlugin,
},
rules: {
'prettier/prettier': ['error', { endOfLine: 'lf' }],
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-explicit-any': [
'warn',
{
fixToUnknown: false,
ignoreRestArgs: true,
},
],
'@typescript-eslint/no-wrapper-object-types': 'warn',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always',
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/explicit-function-return-type': 'warn',
'@typescript-eslint/explicit-module-boundary-types': 'warn',
'@typescript-eslint/consistent-type-imports': 'error',
},
}),
];