Skip to content

Commit 14af69c

Browse files
committed
Switch to eslint.
1 parent 44c26bb commit 14af69c

File tree

4 files changed

+709
-64
lines changed

4 files changed

+709
-64
lines changed

.eslintrc.json

+181
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
{
2+
"env": {
3+
"mocha": true,
4+
"node": true
5+
},
6+
"globals": {},
7+
"extends": "eslint:recommended",
8+
"rules": {
9+
"block-scoped-var": 2,
10+
"complexity": [
11+
1,
12+
5
13+
],
14+
"consistent-return": 2,
15+
"curly": [
16+
2,
17+
"all"
18+
],
19+
"dot-notation": 2,
20+
"eqeqeq": 2,
21+
"no-caller": 2,
22+
"no-console": 0,
23+
"no-else-return": 2,
24+
"no-eq-null": 2,
25+
"no-extend-native": 2,
26+
"no-implicit-coercion": 2,
27+
"no-loop-func": 2,
28+
"no-multi-spaces": 2,
29+
"no-multi-str": 2,
30+
"no-new-func": 2,
31+
"no-new-wrappers": 2,
32+
"no-new": 2,
33+
"no-param-reassign": 2,
34+
"no-unused-expressions": 2,
35+
"no-useless-call": 2,
36+
"no-useless-concat": 1,
37+
"no-with": 2,
38+
"vars-on-top": 1,
39+
"wrap-iife": [2, "any"],
40+
"yoda": [
41+
2,
42+
"never"
43+
],
44+
45+
"strict": [
46+
1,
47+
"global"
48+
],
49+
50+
"no-shadow": 2,
51+
"no-use-before-define": 1,
52+
53+
"callback-return": 2,
54+
"handle-callback-err": 2,
55+
"no-path-concat": 2,
56+
57+
"array-bracket-spacing": [
58+
1,
59+
"always", {
60+
"objectsInArrays": false
61+
}
62+
],
63+
"block-spacing": 1,
64+
"brace-style": 1,
65+
"camelcase": [
66+
1, {
67+
"properties": "never"
68+
}
69+
],
70+
"comma-spacing": [
71+
1, {
72+
"before": false,
73+
"after": true
74+
}
75+
],
76+
"comma-style": [
77+
1,
78+
"last"
79+
],
80+
"computed-property-spacing": [
81+
1,
82+
"never"
83+
],
84+
"consistent-this": [
85+
1,
86+
"self"
87+
],
88+
"eol-last": 1,
89+
"indent": [
90+
2,
91+
4, {
92+
"SwitchCase": 1
93+
}
94+
],
95+
"key-spacing": [
96+
1, {
97+
"beforeColon": false,
98+
"afterColon": true
99+
}
100+
],
101+
"keyword-spacing": 1,
102+
"linebreak-style": [
103+
1,
104+
"unix"
105+
],
106+
"lines-around-comment": [
107+
1, {
108+
"allowBlockStart": true,
109+
"beforeBlockComment": true,
110+
"beforeLineComment": true
111+
}
112+
],
113+
"max-depth": [
114+
1,
115+
4
116+
],
117+
"max-params": [
118+
1,
119+
3
120+
],
121+
"max-statements": [
122+
1,
123+
10
124+
],
125+
"new-cap": 2,
126+
"new-parens": 2,
127+
"newline-after-var": [
128+
1,
129+
"always"
130+
],
131+
"no-array-constructor": 2,
132+
"no-bitwise": 1,
133+
"no-lonely-if": 1,
134+
"no-multi-spaces": 1,
135+
"no-multiple-empty-lines": 1,
136+
"no-new-object": 2,
137+
"no-spaced-func": 1,
138+
"no-trailing-spaces": 1,
139+
"no-unneeded-ternary": 1,
140+
"object-curly-spacing": [
141+
1,
142+
"always"
143+
],
144+
"one-var": 1,
145+
"operator-assignment": [
146+
1,
147+
"always"
148+
],
149+
"operator-linebreak": [
150+
1,
151+
"after"
152+
],
153+
"quote-props": [
154+
1,
155+
"consistent"
156+
],
157+
"quotes": [
158+
1,
159+
"single"
160+
],
161+
"semi": [
162+
2,
163+
"always"
164+
],
165+
"semi-spacing": [
166+
1, {
167+
"before": false,
168+
"after": true
169+
}
170+
],
171+
"space-before-blocks": [
172+
1,
173+
"always"
174+
],
175+
"space-before-function-paren": [1, { "anonymous": "always", "named": "never" }],
176+
"space-in-parens": [1, "never"],
177+
"space-infix-ops": 1,
178+
"space-unary-ops": 0,
179+
"spaced-comment": [1, "always", { "line": { "exceptions": ["-"] } }]
180+
}
181+
}

gulpfile.js

+7-8
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22
'use strict';
33

44
var gulp = require('gulp'),
5-
jshint = require('gulp-jshint'),
6-
mocha = require('gulp-mocha');
7-
8-
var paths = {
9-
scripts: ['./*.js', '!./gulpfile.js']
10-
};
5+
eslint = require('gulp-eslint'),
6+
mocha = require('gulp-mocha'),
7+
paths = {
8+
scripts: ['./*.js', '!./gulpfile.js']
9+
};
1110

1211
gulp.task('lint', function() {
1312
return gulp.src(paths.scripts)
14-
.pipe(jshint())
15-
.pipe(jshint.reporter('default'));
13+
.pipe(eslint())
14+
.pipe(eslint.format());
1615
});
1716

1817
gulp.task('test', function() {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"homepage": "https://github.com/jonkemp/qunit-phantomjs-runner",
2525
"devDependencies": {
2626
"gulp": "^3.8.10",
27-
"gulp-jshint": "^2.0.0",
27+
"gulp-eslint": "^4.0.0",
2828
"gulp-mocha": "^4.3.1",
2929
"mocha": "^4.0.1",
3030
"phantomjs-prebuilt": "^2.1.7",

0 commit comments

Comments
 (0)