-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.yml
45 lines (40 loc) · 2.13 KB
/
.eslintrc.yml
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
env:
es6: true
node: true
browser: true
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended']
parserOptions:
ecmaVersion: latest
sourceType: module
parser: '@typescript-eslint/parser'
plugins: ['@typescript-eslint']
rules:
# off OR 0
# warn OR 1
# error OR 2
no-console: error # disable console
no-var: error ## disable var
quotes: [error, single, { avoidEscape: true }] ## Use single quotes
indent: [error, 2, { SwitchCase: 1 }] ## Indent two spaces
comma-dangle: [error, never] ## Prohibit end commas
semi: [error, never] ## Prohibit end semicolons
arrow-parens: [error, always] ## Arguments to arrow functions must be enclosed in parentheses
array-bracket-spacing: [error, never] ## Prohibit spaces inside the array brackets
brace-style: error ## Force one true brace style
camelcase: warn ## Force property name to hump style
computed-property-spacing: [error, never] ## Prohibit the use of spaces within calculated attributes
curly: [error, multi-line] ## https://cn.eslint.org/docs/rules/curly#multi
eol-last: [error, always] ## Forced use of line feeds (LF)
eqeqeq: [error, smart] ## https://cn.eslint.org/docs/rules/eqeqeq#smart
max-depth: [error, 3] ## Maximum nesting depth for mandatory block statements
max-len: [warn, 120] ## Line feed after 120 characters
max-statements: [warn, 20] ## Limit the maximum number of statements in a function block
new-cap: [warn, { capIsNew: false }] ## Requires constructors to be initialized with capital letters
no-extend-native: error ## Disable extension of native types
no-mixed-spaces-and-tabs: error ## Disable mixed indentation of spaces and tabs
no-trailing-spaces: error ## Disable end-of-line spaces
no-unused-vars: 1 ## Prohibit the appearance of unused variables
no-use-before-define: [error, nofunc] ## Prohibit the use of variables before they are defined
object-curly-spacing: [error, always] ## No spaces in brackets allowed
keyword-spacing: [error, { before: true, after: true }] ## Force the use of consistent spaces before and after keywords
space-unary-ops: error ## Prohibit spaces before or after unary operators