forked from google/blockly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
88 lines (88 loc) · 3.13 KB
/
.eslintrc.json
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
{
"rules": {
"curly": ["error"],
"eol-last": ["error"],
"keyword-spacing": ["error"],
"linebreak-style": ["error", "unix"],
"max-len": [
"error",
{
"code": 100,
"tabWidth": 4,
"ignoreStrings": true,
"ignoreRegExpLiterals": true,
"ignoreUrls": true
}
],
"no-trailing-spaces": ["error", { "skipBlankLines": true }],
"no-unused-vars": [
"warn",
{
"args": "after-used",
// Ignore vars starting with an underscore.
"varsIgnorePattern": "^_",
// Ignore arguments starting with an underscore.
"argsIgnorePattern": "^_"
}
],
// Blockly uses for exporting symbols. no-self-assign added in eslint 5.
"no-self-assign": ["off"],
// Blockly uses single quotes except for JSON blobs, which must use double quotes.
"quotes": ["off"],
"semi": ["error", "always"],
// Blockly doesn't have space before function paren when defining functions.
"space-before-function-paren": ["error", "never"],
// Blockly doesn't have space before function paren when calling functions.
"func-call-spacing": ["error", "never"],
"space-infix-ops": ["error"],
// Blockly uses 'use strict' in files.
"strict": ["off"],
// Closure style allows redeclarations.
"no-redeclare": ["off"],
"valid-jsdoc": ["error", {"requireReturn": false}],
"no-console": ["off"],
"no-multi-spaces": ["error", { "ignoreEOLComments": true }],
"operator-linebreak": ["error", "after"],
"spaced-comment": ["error", "always", {
"block": {
"balanced": true
},
"exceptions": ["*"]
}],
// Blockly uses prefixes for optional arguments and test-only functions.
"camelcase": ["error", {
"properties": "never",
"allow": ["^opt_", "^_opt_", "^testOnly_"]
}],
// Use clang-format for indentation by running `npm run format`.
"indent": ["off"],
// Blockly uses capital letters for some non-constructor namespaces.
// Keep them for legacy reasons.
"new-cap": ["off"],
// Mostly use default rules for brace style, but allow single-line blocks.
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
// Blockly uses objects as maps, but uses Object.create(null) to
// instantiate them.
"guard-for-in": ["off"],
"prefer-spread": ["off"],
"comma-dangle": ["error", {
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "ignore"
}]
},
"env": {
"es2020": true,
"browser": true
},
"globals": {
"Blockly": true,
"goog": true,
"exports": true
},
"extends": [
"eslint:recommended", "google"
]
}