Skip to content

Commit 838798d

Browse files
authored
Migrate from jshint to eslint (RobotWebTools#670)
1 parent 220ee16 commit 838798d

File tree

10 files changed

+1375
-408
lines changed

10 files changed

+1375
-408
lines changed

.jshintrc

-29
This file was deleted.

.npmignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
*.md
22
.github
33
.gitignore
4-
.jshintrc
4+
.eslint.config.js
55
Gruntfile.js
66
bower.json
77
examples

Gruntfile.js

+6-9
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ module.exports = function(grunt) {
1313
shell: {
1414
ts: {
1515
command: 'tsc -p .'
16+
},
17+
eslint: {
18+
command: 'eslint .'
1619
}
1720
},
1821
browserify: {
@@ -21,12 +24,6 @@ module.exports = function(grunt) {
2124
dest: './build/roslib.js'
2225
}
2326
},
24-
jshint: {
25-
options: {
26-
jshintrc: true
27-
},
28-
files: ['./Gruntfile.js', './src/**/*.js']
29-
},
3027
karma: {
3128
options: {
3229
singleRun: true,
@@ -82,7 +79,7 @@ module.exports = function(grunt) {
8279
options: {
8380
interrupt: true
8481
},
85-
files: ['Gruntfile.js', '.jshintrc', './src/**/*.js'],
82+
files: ['Gruntfile.js', 'eslint.config.js', './src/**/*.js'],
8683
tasks: ['build']
8784
}
8885
},
@@ -104,10 +101,10 @@ module.exports = function(grunt) {
104101
});
105102

106103
grunt.registerTask('dev', ['browserify', 'watch']);
107-
grunt.registerTask('test', ['jshint', 'mochaTest:test', 'karma:test']);
104+
grunt.registerTask('test', ['shell:eslint', 'mochaTest:test', 'karma:test']);
108105
grunt.registerTask('test-examples', ['mochaTest:examples', 'karma:examples']);
109106
grunt.registerTask('test-tcp', ['mochaTest:tcp']);
110-
grunt.registerTask('build', ['shell', 'browserify', 'uglify']);
107+
grunt.registerTask('build', ['shell:ts', 'browserify', 'uglify']);
111108
grunt.registerTask('build_and_watch', ['watch']);
112109
grunt.registerTask('doc', ['clean', 'jsdoc']);
113110
};

eslint.config.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const globals = require("globals");
2+
3+
module.exports = [
4+
{
5+
languageOptions: {
6+
"globals": {
7+
...globals.browser,
8+
...globals.node,
9+
"bson": true
10+
},
11+
}
12+
},
13+
{
14+
ignores: ['build/**/*.js', 'tsbuild/**/*.js']
15+
},
16+
{
17+
rules: {
18+
curly: 2,
19+
eqeqeq: 2,
20+
'wrap-iife': [2, 'any'],
21+
'no-use-before-define': 0,
22+
'new-cap': 2,
23+
'no-caller': 2,
24+
'dot-notation': 0,
25+
'no-undef': 2,
26+
'no-cond-assign': 0,
27+
'no-eq-null': 0,
28+
strict: 0,
29+
quotes: [2, 'single'],
30+
'no-proto': 2,
31+
'linebreak-style': 2
32+
},
33+
files: ['Gruntfile.js', 'src/**/*.js']
34+
}
35+
];
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)