-
Notifications
You must be signed in to change notification settings - Fork 6
/
.eslintrc.cjs
51 lines (48 loc) · 1.4 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
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2021,
sourceType: 'module',
},
extends: [
'plugin:square/typescript',
'plugin:node/recommended',
'plugin:unicorn/recommended', // Turn eslint-plugin-unicorn recommended rules on again because many were turned off by eslint-plugin-square.
'plugin:jest/recommended',
],
env: {
node: true,
},
settings: {
node: {
tryExtensions: ['.js', '.json', '.node', '.ts', '.d.ts'],
},
},
rules: {
'import/extensions': ['error', 'always'],
'node/no-missing-import': 'off', // bug with recognizing node: prefix https://github.com/mysticatea/eslint-plugin-node/issues/275
'unicorn/no-useless-undefined': 'off', // We use a lot of `return undefined` to satisfy the `consistent-return` rule.
},
overrides: [
{
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
files: ['*.ts'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
rules: {
'node/no-unsupported-features/es-syntax': [
'error',
{ ignores: ['modules'] },
],
'@typescript-eslint/prefer-readonly': 'error',
'@typescript-eslint/require-array-sort-compare': 'error',
},
},
],
};