This repository has been archived by the owner on Oct 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
72 lines (69 loc) · 2.13 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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: [
'./tsconfig.eslint.json',
'./workspace/*/tsconfig.json',
'./packages/*/tsconfig.json',
],
extraFileExtensions: ['.cjs'],
},
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:unicorn/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'prettier',
],
rules: {
// Already checked by TypeScript
'no-undef': 'off',
'import/no-unresolved': 'off',
// We know what we're doing™
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/ban-types': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/no-process-exit': 'off',
'unicorn/prefer-export-from': 'off',
'unicorn/no-null': 'off',
'unicorn/numeric-separators-style': 'off',
'unicorn/prefer-json-parse-buffer': 'off',
'unicorn/text-encoding-identifier-case': 'off',
'unicorn/no-array-for-each': 'off',
'unicorn/filename-case': [
'error',
{ case: 'kebabCase', ignore: [/\/generated-types\//] },
],
// Additional code quality rules
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/no-misused-promises': [
'error',
{ checksVoidReturn: false },
],
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/restrict-template-expressions': [
'error',
{ allowAny: true, allowUnknown: true },
],
'@typescript-eslint/restrict-plus-operands': 'error',
// Additional code style rules
'object-shorthand': 'error',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal'],
pathGroupsExcludedImportTypes: [],
alphabetize: { order: 'asc' },
'newlines-between': 'always',
},
],
'import/newline-after-import': ['error', { count: 1 }],
},
}