generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
144 lines (144 loc) · 3.83 KB
/
.eslintrc.js
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'airbnb-typescript',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:eslint-comments/recommended',
'plugin:jest/recommended',
'plugin:promise/recommended',
'plugin:unicorn/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
],
plugins: [
'@typescript-eslint',
'eslint-comments',
'jest',
'import',
'promise',
'unicorn',
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 2 : 1,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 1,
'react/jsx-filename-extension': 0,
'no-unused-vars': 0,
'unicorn/no-null': 0,
'unicorn/prefer-module': 0,
'unicorn/prefer-node-protocol': 0,
'unicorn/prevent-abbreviations': 0,
'unicorn/no-array-reduce': 0,
'unicorn/no-new-array': 0,
'unicorn/prefer-object-from-entries': 0,
'unicorn/consistent-function-scoping': 0,
'@typescript-eslint/naming-convention': 0,
'@typescript-eslint/no-unsafe-assignment': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-unsafe-member-access': 0,
'@typescript-eslint/no-unnecessary-type-assertion': 0,
'jest/no-test-prefixes': 0,
'jest/no-disabled-tests': 0,
'prefer-destructuring': [
'warn',
{
array: false,
object: true,
},
{
enforceForRenamedProperties: false,
},
],
'function-call-argument-newline': ['error', 'consistent'],
'array-bracket-newline': ['error', 'consistent'],
'object-curly-newline': [
'error',
{
ObjectExpression: { multiline: true, minProperties: 10, consistent: true },
ObjectPattern: { multiline: true, minProperties: 10, consistent: true },
ImportDeclaration: { consistent: true },
ExportDeclaration: { consistent: true },
},
],
semi: ['error', 'always'],
'@typescript-eslint/indent': [ // https://github.com/typescript-eslint/typescript-eslint/issues/1824
'error',
2,
{
SwitchCase: 1,
MemberExpression: 1,
offsetTernaryExpressions: true,
},
],
'max-len': [
'warn',
{
code: 120,
ignoreUrls: true,
ignoreStrings: true,
ignoreComments: true,
ignoreRegExpLiterals: true,
},
],
'no-irregular-whitespace': 'error',
'no-unused-expressions': 'error',
'@typescript-eslint/return-await': ['error', 'always'], // https://v8.dev/blog/fast-async
'@typescript-eslint/ban-ts-comment': 1,
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: true,
},
],
'@typescript-eslint/no-use-before-define': [
'warn',
{
functions: false,
classes: true,
variables: true,
typedefs: false,
},
],
'import/order': [
'error',
{
'newlines-between': 'always',
groups: ['builtin', 'external', ['parent', 'sibling', 'index', 'internal']],
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
'unicorn/filename-case': [
'error',
{
case: 'snakeCase',
},
],
},
env: {
es6: true,
node: true,
browser: true,
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 6,
ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: true,
},
project: './tsconfig.lint.json',
tsconfigRootDir: __dirname,
},
settings: {
'import/resolver': {
node: {
extensions: ['.mjs', '.js', '.json', '.ts', '.d.ts', '.tsx'],
moduleDirectory: ['node_modules'],
},
},
},
};