-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
92 lines (81 loc) · 2.1 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
91
92
/**
* Static code analysis definitions to identify
* problematic patterns in JavaScript code.
*/
module.exports = {
/**
* Defines predefined global variables.
* @see https://eslint.org/docs/user-guide/configuring#specifying-environments
*/
env: {
/// Browser global variables.
browser: true,
/// Enable all ECMAScript 6 features except modules.
es6: true,
/// Node.js global variables and Node.js scope.
node: true,
/// Test and cover
jest: true,
},
/**
* It can close every rule and only work with basic syntax validation.
*
* @see https://eslint.org/docs/user-guide/configuring#using-eslintrecommended
*/
extends: 'eslint:recommended',
/**
* Choosing parser options.
*
* @see https://eslint.org/docs/user-guide/configuring#specifying-parser-options
*/
parserOptions: {
/**
* Ecma Script version
*/
ecmaVersion: 'latest',
},
/**
* It is grouped by category to help you understand their purpose.
*
* @see https://eslint.org/docs/rules
*/
rules: {
/**
* Apply consistent indentation (indentation).
*
* @see https://eslint.org/docs/rules/indent
*/
indent: ['error', 2],
/**
* Apply consistent linebreak style (linebreak style).
* Cross-platform role
*
* @see https://eslint.org/docs/rules/linebreak-style
*/
'linebreak-style': ['error', process.platform === 'win32' ? 'windows' : 'unix'],
/**
* Require consistent use of reverse quotes, double or single quotes (quotes).
*
* @see https://eslint.org/docs/rules/quotes
*/
quotes: ['error', 'single'],
/**
* Requires or without semicolons.
*
* @see https://eslint.org/docs/rules/semi
*/
semi: ['error', 'never'],
/**
* Do not allow use console (no console).
*
* @see https://eslint.org/docs/rules/no-console
*/
'no-console': 'error',
/**
* Require or allow an empty line after variable declarations
*
* @see https://eslint.org/docs/rules/newline-after-var
*/
'newline-after-var': ['error', 'always'],
},
}