forked from LIT-Protocol/lit-scheduled-tasks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
81 lines (81 loc) · 2.36 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
79
80
81
/**
* Eslint config applies to all packages - except each package must define mocha-specific overrides
* due to complexity in identifying dependencies and their sources from parent package.json files
*/
module.exports = {
root: true,
env: { node: true },
parserOptions: {
project: './tsconfig.json',
},
plugins: ['import', 'chai-friendly', 'sort-destructure-keys', 'sort-keys-plus'],
overrides: [
{
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
extends: [
'eslint:recommended',
'airbnb-base',
'airbnb-typescript/base',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:chai-friendly/recommended',
'plugin:typescript-sort-keys/recommended',
'prettier',
],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
'import/internal-regex': '^@lit-protocol/',
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
},
rules: {
'no-console': 'error',
'import/prefer-default-export': ['off'],
'import/no-default-export': ['error'],
'import/no-relative-packages': ['error'],
'import/no-duplicates': ['error'],
'import/no-unresolved': ['error'],
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
'newlines-between': 'always',
groups: [
'builtin',
'external',
'internal',
['sibling', 'parent', 'index'],
'object',
'type',
],
},
],
'typescript-sort-keys/interface': 'error',
'typescript-sort-keys/string-enum': 'error',
'sort-keys-plus/sort-keys': [
'error',
'asc',
{
caseSensitive: false,
natural: true,
minKeys: 2,
allowLineSeparatedGroups: true,
allCaps: 'first',
shorthand: 'first',
},
],
'sort-destructure-keys/sort-destructure-keys': ['error', { caseSensitive: false }],
'class-methods-use-this': ['off'],
},
},
],
};