-
Notifications
You must be signed in to change notification settings - Fork 161
/
.eslintrc.js
137 lines (136 loc) · 4.04 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/* eslint-disable linebreak-style */
// Standard Formatting rules for Kolbot scripts
// Compatible with ESLint plugin
module.exports = {
"root": true,
"extends": "eslint:recommended",
"parserOptions": {
"ecmaFeatures": {
"impliedStrict": true,
}
},
"env": {
"es6": true,
},
"globals": {
// The following globals are defined within D2BS, or are actually defined in the source code
"include": true,
"print": true,
"me": true,
"td": true,
"getTickCount": true,
"delay": true,
"getParty": true,
"takeScreenshot": true,
"getUnit": true,
"quit": true,
"clickMap": true,
"getBaseStat": true,
"clickItem": true,
"getCursorType": true,
"getPresetUnits": true,
"getDistance": true,
"copyUnit": true,
"getRoom": true,
"getLocaleString": true,
"scriptBroadcast": true,
"isIncluded": true,
"showConsole": true,
"getInteractedNPC": true,
"getDialogLines": true,
"getUIFlag": true,
"sendPacket": true,
"getPacket": true,
"getPath": true,
"rand": true,
"PresetUnit": true,
"getPresetUnit": true,
"getArea": true,
"getWaypoint": true,
"getScript": true,
"Room": true,
"say": true,
"load": true,
"addEventListener": true,
"getMercHP": true,
"checkCollision": true,
"gold": true,
"getLocation": true,
"login": true,
"sendCopyData": true,
"getControl": true,
"debugLog": true,
"getCollision": true,
"transmute": true,
"submitItem": true,
"createGame": true,
"joinGame": true,
"Line": true,
"removeEventListener": true,
"Unit": true,
"Party": true,
"UtilitySystem": true,
"moveNPC": true,
"getPlayerFlag": true,
"clickParty": true,
"dopen": true,
"Items": true,
"Text": true,
"File": true,
"js_strict": true,
"handler": true,
"sendKey": true,
"md5": true,
"module": true,
"require": true,
"Box": true,
"Frame": true,
"revealLevel": true,
"hideConsole": true,
},
"rules": {
// enable additional rules
"indent": ["warn", 2],
"linebreak-style": ["off", "windows"],
"semi": ["error", "always"],
"comma-spacing": ["error", { "before": false, "after": true }],
"keyword-spacing": ["error", { "before": true, "after": true }],
"object-curly-spacing": ["error", "always"],
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"space-infix-ops": "error",
"space-unary-ops": ["error", { "words": true, "nonwords": false }],
"arrow-spacing": "error",
"arrow-body-style": ["error", "as-needed"],
"space-before-blocks": "error",
"key-spacing": ["error", { "mode": "strict", "beforeColon": false, "afterColon": true }],
"no-mixed-spaces-and-tabs": "error",
"no-trailing-spaces": ["warn", { "ignoreComments": true, "skipBlankLines": true }],
"no-whitespace-before-property": "error",
"comma-style": ["error", "last"],
"eol-last": ["error", "always"],
"block-scoped-var": "error",
"no-var": "warn",
"curly": ["error", "multi-line"],
"dot-notation": "warn",
"eqeqeq": ["error", "smart"],
"no-caller": "error",
"no-floating-decimal": "error",
"no-multi-spaces": ["error", { "ignoreEOLComments": true }],
"no-self-compare": "error",
"no-case-declarations": "off",
"no-with": "error",
"no-shadow": "off",
"no-use-before-define": "off",
"no-prototype-builtins": "off",
"quotes": ["warn", "double", { "avoidEscape": true }],
"no-constant-condition": ["error", { "checkLoops": false }],
"no-extra-label": "error",
//"no-labels": ["error", {"allowLoop": true}], // in the future no loops ;)
"no-unused-vars": ["warn", { "vars": "local", "varsIgnorePattern": "^_" }],
"no-fallthrough": ["error", { "commentPattern": "break[\\s\\w]*omitted" }],
"no-undef": ["off", "always"],
"no-extra-boolean-cast": ["off", "always"],
"no-useless-escape": ["off", "always"],
"max-len": ["warn", { "code": 120, "ignoreComments": true, "ignoreUrls": true, "ignoreStrings": true }],
}
};