Skip to content

Commit f9dd34d

Browse files
tools: replace closure-linter with eslint
PR-URL: #1539 Fixes: #1253 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
1 parent 5883a59 commit f9dd34d

File tree

3,017 files changed

+139139
-34510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,017 files changed

+139139
-34510
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lib/punycode.js

.eslintrc

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
env:
2+
node: true
3+
4+
# enable ECMAScript features
5+
ecmaFeatures:
6+
blockBindings: true
7+
templateStrings: true
8+
octalLiterals: true
9+
binaryLiterals: true
10+
11+
rules:
12+
# Possible Errors
13+
# list: https://github.com/eslint/eslint/tree/master/docs/rules#possible-errors
14+
## check debugger sentence
15+
no-debugger: 2
16+
## check duplicate arguments
17+
no-dupe-args: 2
18+
## check duplicate object keys
19+
no-dupe-keys: 2
20+
## check duplicate switch-case
21+
no-duplicate-case: 2
22+
## disallow assignment of exceptional params
23+
no-ex-assign: 2
24+
## disallow use of reserved words as keys like enum, class
25+
no-reserved-keys: 2
26+
## disallow unreachable code
27+
no-unreachable: 2
28+
## require valid typeof compared string like typeof foo === 'strnig'
29+
valid-typeof: 2
30+
31+
# Best Practices
32+
# list: https://github.com/eslint/eslint/tree/master/docs/rules#best-practices
33+
## require falls through comment on switch-case
34+
no-fallthrough: 2
35+
36+
# Stylistic Issues
37+
# list: https://github.com/eslint/eslint/tree/master/docs/rules#stylistic-issues
38+
## use single quote, we can use double quote when escape chars
39+
quotes:
40+
- 2
41+
- "single"
42+
- "avoid-escape"
43+
## 2 space indentation
44+
indent:
45+
- 2
46+
- 2
47+
## add space after comma
48+
comma-spacing: 2
49+
## put semi-colon
50+
semi: 2
51+
## require spaces operator like var sum = 1 + 1;
52+
space-infix-ops: 2
53+
## require spaces return, throw, case
54+
space-return-throw-case: 2
55+
## require parens for Constructor
56+
new-parens: 2
57+
## max 80 length
58+
max-len:
59+
- 2
60+
- 80
61+
- 2
62+
63+
64+
# Strict Mode
65+
# list: https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode
66+
## 'use strict' on top
67+
strict:
68+
- 2
69+
- "global"
70+
71+
# Global scoped method and vars
72+
globals:
73+
DTRACE_HTTP_CLIENT_REQUEST: true
74+
LTTNG_HTTP_CLIENT_REQUEST: true
75+
COUNTER_HTTP_CLIENT_REQUEST: true
76+
DTRACE_HTTP_CLIENT_RESPONSE: true
77+
LTTNG_HTTP_CLIENT_RESPONSE: true
78+
COUNTER_HTTP_CLIENT_RESPONSE: true
79+
DTRACE_HTTP_SERVER_REQUEST: true
80+
LTTNG_HTTP_SERVER_REQUEST: true
81+
COUNTER_HTTP_SERVER_REQUEST: true
82+
DTRACE_HTTP_SERVER_RESPONSE: true
83+
LTTNG_HTTP_SERVER_RESPONSE: true
84+
COUNTER_HTTP_SERVER_RESPONSE: true
85+
DTRACE_NET_STREAM_END: true
86+
LTTNG_NET_STREAM_END: true
87+
COUNTER_NET_SERVER_CONNECTION_CLOSE: true
88+
DTRACE_NET_SERVER_CONNECTION: true
89+
LTTNG_NET_SERVER_CONNECTION: true
90+
COUNTER_NET_SERVER_CONNECTION: true
91+

Makefile

+1-4
Original file line numberDiff line numberDiff line change
@@ -386,11 +386,8 @@ bench-idle:
386386
sleep 1
387387
./$(NODE_EXE) benchmark/idle_clients.js &
388388

389-
jslintfix:
390-
PYTHONPATH=tools/closure_linter/:tools/gflags/ $(PYTHON) tools/closure_linter/closure_linter/fixjsstyle.py --strict --nojsdoc -r lib/ -r src/ --exclude_files lib/punycode.js
391-
392389
jslint:
393-
PYTHONPATH=tools/closure_linter/:tools/gflags/ $(PYTHON) tools/closure_linter/closure_linter/gjslint.py --unix_mode --strict --nojsdoc -r lib/ -r src/ --exclude_files lib/punycode.js
390+
./$(NODE_EXE) tools/eslint/bin/eslint.js src/*.js lib/*.js --reset --quiet
394391

395392
CPPLINT_EXCLUDE ?=
396393
CPPLINT_EXCLUDE += src/node_lttng.cc

tools/closure_linter/AUTHORS

-6
This file was deleted.

tools/closure_linter/LICENSE

-176
This file was deleted.

tools/closure_linter/README

-9
This file was deleted.

tools/closure_linter/build/lib/closure_linter/__init__.py

-16
This file was deleted.

0 commit comments

Comments
 (0)