-
Notifications
You must be signed in to change notification settings - Fork 17
/
.eslintrc.js
144 lines (143 loc) · 3.61 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
138
139
140
141
142
143
144
// 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
"global": true,
"include": true,
"print": true,
"me": true,
"td": true,
"getTickCount": true,
"delay": true,
"getParty": true,
"Pickit": 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,
"DataFile": true,
"D2Bot": true,
"scriptBroadcast": true,
"isIncluded": true,
"FileTools": 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,
"Experience": true,
"checkCollision": true,
"gold": true,
"getLocation": true,
"login": true,
"sendCopyData": true,
"locationAction": true,
"getControl": true,
"debugLog": true,
"getCollision": true,
"transmute": true,
"submitItem": true,
"MuleLogger": true,
"createGame": true,
"joinGame": true,
"Line": true,
"removeEventListener": true,
"Unit": true,
"Party": true,
"UtilitySystem": true,
"CraftingSystem": true,
"moveNPC": true,
"ShitList": true,
"getPlayerFlag": true,
"clickParty": true,
"dopen": true,
"Items": true,
"CustomConfig": true,
"getLists": true,
"pickItems": true,
"getNPCName": true,
"countItems": true,
"shopStuff": true,
"othersInGame": true,
"checkItem": true,
"Text": true,
"File": true,
"js_strict": true,
"handler": true,
"sendKey": true,
"md5": true,
"module": true,
"require": true,
},
"rules": {
// enable additional rules
"indent": ["warn", "tab"],
"linebreak-style": ["error", "windows"],
"semi": ["error", "always"],
"comma-spacing": ["error", {"before": false, "after": true}],
"keyword-spacing": ["error", {"before": true, "after": true}],
"brace-style": ["error", "1tbs", {"allowSingleLine": false}],
"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", {"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",
//"default-case": "warn",
"dot-notation": "warn",
"eqeqeq": ["error", "smart"],
"no-caller": "error",
"no-floating-decimal": "error",
"no-multi-spaces": "error",
"no-self-compare": "error",
"no-with": "error",
"no-shadow": "warn",
"no-use-before-define": "error",
"no-prototype-builtins": "off",
"quotes": ["warn", "single"],
"no-constant-condition": ["error", {"checkLoops": false}],
"no-labels": ["error", {"allowLoop": true}], // in the future no loops ;)
"no-unused-vars": "warn",
"no-fallthrough": ["error", {"commentPattern": "break[\\s\\w]*omitted"}],
}
};