-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc.cjs
78 lines (77 loc) · 1.94 KB
/
.eslintrc.cjs
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
module.exports = {
root: true,
parserOptions: {
sourceType: 'module',
},
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
'import',
'simple-import-sort',
'prettier',
'filenames',
],
extends: [
'eslint:recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:node/recommended',
'prettier',
'prettier/@typescript-eslint',
],
rules: {
'sort-imports': 'off',
'import/order': 'off',
'import/no-extraneous-dependencies': 'error',
'import/no-unassigned-import': 'error',
'import/no-duplicates': 'error',
'@typescript-eslint/no-use-before-define': ['error', { functions: false }],
'@typescript-eslint/explicit-function-return-type': [
'error',
{ allowExpressions: true },
],
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
},
overrides: [
{
parserOptions: {
project: './tsconfig.json',
// allows eslint from any dir
tsconfigRootDir: __dirname,
sourceType: 'module',
},
files: ['src/**/*.ts'],
settings: {
node: {
tryExtensions: ['.js', '.json', '.d.ts', '.ts'],
convertPath: [
{
include: ['src/**/*.ts'],
replace: ['^src/(.+)\\.ts$', 'dist/$1.js'],
},
],
},
},
extends: [
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
rules: {
'import/no-unresolved': 'off',
'filenames/match-regex': ['error', '^[a-z0-9\\-]+$', true],
'filenames/match-exported': ['error', 'kebab'],
'node/no-missing-import': 'off',
},
},
{
env: {
node: true,
mocha: true,
},
files: ['test/**/*.js'],
},
],
};