-
Notifications
You must be signed in to change notification settings - Fork 5
/
.eslintrc.cjs
69 lines (68 loc) · 1.89 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
/** @type {import('eslint').Linter.Config} */
const config = {
ignorePatterns: [
'**/node_modules/**',
'**/build/**',
'**/coverage/**',
'**/cache/**',
'**/commitlint.config.cjs',
'**/lint-staged.config.cjs',
'**/vitest.config.ts',
'**/prettier.config.cjs',
'**/.eslintrc.cjs',
],
root: true,
env: {
node: true,
es2022: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.json'],
},
plugins: ['@typescript-eslint'],
extends: [
// Common
'eslint:recommended',
'plugin:import/recommended',
// TS
'plugin:import/typescript',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:@typescript-eslint/strict',
// Prettier
'plugin:prettier/recommended',
],
settings: {
'import/resolver': {
typescript: {},
},
},
rules: {
'import/newline-after-import': 'error',
'import/order': [
'error',
{
'newlines-between': 'always',
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
'object-shorthand': ['error', 'always'],
'no-console': 'error',
'func-style': ['error', 'declaration'],
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/consistent-type-imports': [
'warn',
{
prefer: 'type-imports',
fixStyle: 'inline-type-imports',
},
],
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_' },
],
},
}
module.exports = config