-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
90 lines (90 loc) · 2 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
module.exports = {
extends: [
require.resolve('eslint-config-google'),
require.resolve('eslint-config-node'),
],
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module',
ecmaVersion: 8,
},
env: {
browser: true,
mocha: true,
node: true,
es6: true,
},
plugins: ['no-only-tests', 'babel', 'import'],
ignorePatterns: ['**/*.d.ts'],
rules: {
'arrow-parens': [
'error',
'always',
{
requireForBlockBody: true,
},
],
'lines-between-class-members': 'error',
'no-underscore-dangle': 'off',
'no-only-tests/no-only-tests': 'error',
'import/extensions': [
'error',
'always',
{
ignorePackages: true,
},
],
'import/prefer-default-export': 'off',
'import/no-nodejs-modules': 'off',
'import/no-commonjs': 'off',
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: ['**/test/**/*.js', '**/*.config.js', '**/*.conf.js'],
},
],
// this is unnecessary for node apps.
'class-methods-use-this': 'off',
'no-undef': 'error',
'require-jsdoc': [
'warn',
{
require: {
FunctionDeclaration: true,
MethodDefinition: true,
ClassDeclaration: true,
ArrowFunctionExpression: true,
FunctionExpression: true,
},
},
],
'comma-dangle': 'warn',
'new-cap': [
'error',
{
properties: false,
capIsNew: false,
},
],
'max-len': [
'off',
],
'object-curly-spacing': ['error', 'always'],
'no-console': ['error'],
'no-unused-expressions': 'error',
'babel/no-unused-expressions': 'error',
'prefer-template': 'error',
'no-return-await': 'error',
'no-template-curly-in-string': 'error',
'generator-star-spacing': 'off',
'indent': ['error', 2, { 'SwitchCase': 1 }],
},
overrides: [
{
files: ['test/*.js'],
rules: {
'require-jsdoc': 'off',
},
},
],
};