Skip to content

Commit 6cec1fc

Browse files
committed
Replace JSHint with ESLint
1 parent c5787c6 commit 6cec1fc

File tree

6 files changed

+639
-194
lines changed

6 files changed

+639
-194
lines changed

.eslintrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
env: {
3+
"shared-node-browser": true
4+
},
5+
extends: "airbnb-base",
6+
globals: {
7+
document: true
8+
},
9+
rules: {
10+
"no-underscore-dangle": "off"
11+
}
12+
};

Gruntfile.js

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,6 @@ module.exports = function (grunt) {
3030
}
3131
}
3232
},
33-
jshint: {
34-
options: {
35-
curly: true,
36-
eqeqeq: true,
37-
immed: true,
38-
indent: 4,
39-
latedef: true,
40-
newcap: true,
41-
noarg: true,
42-
sub: true,
43-
quotmark: "double",
44-
undef: true,
45-
unused: true,
46-
eqnull: true,
47-
browser: true,
48-
devel: true,
49-
globals: {}
50-
},
51-
files: "<%= meta.files.own %>"
52-
},
5333
uglify: {
5434
options: {
5535
banner: "<%= meta.banner %>"
@@ -66,12 +46,10 @@ module.exports = function (grunt) {
6646
}
6747
});
6848

69-
grunt.registerTask("test", ["jshint"]);
70-
grunt.registerTask("build", ["test", "browserify:dist", "uglify"]);
49+
grunt.registerTask("build", ["browserify:dist", "uglify"]);
7150
grunt.registerTask("default", ["build"]);
7251

7352
grunt.loadNpmTasks("grunt-browserify");
74-
grunt.loadNpmTasks("grunt-contrib-jshint");
7553
grunt.loadNpmTasks("grunt-contrib-uglify");
7654
grunt.loadNpmTasks("grunt-contrib-watch");
7755
};

__tests__/.eslintrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
env: {
3+
jest: true,
4+
},
5+
rules: {
6+
"no-new": "off",
7+
},
8+
};

jest.config.js

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
module.exports = {
2-
projects: [
3-
{
4-
displayName: "Browser tests",
5-
testEnvironment: "jsdom",
6-
},
7-
{
8-
displayName: "Node tests",
9-
testEnvironment: "node",
10-
},
11-
],
2+
projects: [
3+
{
4+
displayName: "Browser tests",
5+
testEnvironment: "jsdom",
6+
testMatch: ["<rootDir>/__tests__/**/*.test.js"],
7+
},
8+
{
9+
displayName: "Node tests",
10+
testEnvironment: "node",
11+
testMatch: ["<rootDir>/__tests__/**/*.test.js"],
12+
},
13+
{
14+
displayName: "ESLint",
15+
runner: "jest-runner-eslint",
16+
testMatch: ["<rootDir>/src/**/*.js", "<rootDir>/__tests__/**/*.js"],
17+
},
18+
],
1219
};

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@
4545
},
4646
"devDependencies": {
4747
"browserify": "~3.46.1",
48+
"eslint-config-airbnb-base": "^13.1.0",
49+
"eslint-plugin-import": "^2.14.0",
4850
"grunt": "~0.4.5",
4951
"grunt-browserify": "~1.3.2",
5052
"grunt-cli": "~0.1.13",
51-
"grunt-contrib-jshint": "~0.11.0",
5253
"grunt-contrib-uglify": "~0.7.0",
5354
"grunt-contrib-watch": "~0.6.1",
54-
"jest": "^23.6.0"
55+
"jest": "^23.6.0",
56+
"jest-runner-eslint": "^0.6.0"
5557
},
5658
"engines": {
5759
"node": "*"

0 commit comments

Comments
 (0)