-
Notifications
You must be signed in to change notification settings - Fork 20
/
.eslintrc.cjs
55 lines (49 loc) · 1.25 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
module.exports = {
env: {
browser: true,
es2021: true,
'jest/globals': true,
},
extends: [
'airbnb-base',
'plugin:jest/style',
],
ignorePatterns: [
'/dist', // tsc-generated code
// autogenerated by ctix
'index.ts',
'/src/index.ts'
],
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: 12,
},
plugins: [
'@typescript-eslint',
'jest',
],
rules: {
'max-len': ['warn', { code: 120 }],
'no-use-before-define': ['off', {}],
'no-unused-vars': ['warn', {}],
// some of the defined classes are basically interface-adherent pojos
'no-useless-constructor': ['off', {}],
'no-empty-function': ['off', {}],
'import/extensions': ['off', {}],
// 'private' class instances for encoding/decoding to/from string/Uint8Array
'no-underscore-dangle': ['warn', { allow: ['_encoder', '_decoder'] }],
// 'default export' is bad. be explicit about objects.
'import/prefer-default-export': ['off', {}],
// testing
'jest/prefer-strict-equal': ['warn'],
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
moduleDirectory: ['node_modules', 'src/'],
},
},
},
};