Skip to content

Commit

Permalink
moved to eslint
Browse files Browse the repository at this point in the history
  * jshint is old, and has fallen out of favor
  * neither currently supports immed, newcap, sub as they're deprecated
  in jshint. This means you must move to jcss if you want style
  checking. I left that that excercise to someone else. Everything else
  works and the options have been ported to eslint (defaults removed).
  Eslint requires less configuration and defaults to sane and safe.
  • Loading branch information
EvanCarroll authored and aemkei committed Jul 7, 2018
1 parent 03783a8 commit 87d4d4e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 27 deletions.
12 changes: 12 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"rules": {
"no-use-before-define": 2,
"no-caller": 2,
"no-eq-null": 2
},
"parserOptions": { "ecmaVersion": 6 },
"env": {
"browser": true,
"node": true
}
}
32 changes: 7 additions & 25 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,7 @@ module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Task configuration.
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
unused: true,
boss: true,
eqnull: true,
node: true,
globals: {
jQuery: true,
window: true,
}
},
eslint: {
gruntfile: {
src: 'Gruntfile.js'
},
Expand All @@ -35,22 +17,22 @@ module.exports = function(grunt) {
},
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile']
files: '<%= eslint.gruntfile.src %>',
tasks: ['eslint:gruntfile']
},
lib_test: {
files: '<%= jshint.lib_test.src %>',
tasks: ['jshint:lib_test', 'nodeunit']
files: '<%= eslint.lib_test.src %>',
tasks: ['eslint:lib_test', 'nodeunit']
}
}
});

// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks("gruntify-eslint");
grunt.loadNpmTasks('grunt-contrib-watch');

// Default task.
grunt.registerTask('default', ['jshint', 'nodeunit']);
grunt.registerTask('default', ['eslint', 'nodeunit']);

};
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
"start": "grunt default watch"
},
"devDependencies": {
"grunt": "~0.4.1",
"grunt": "^0.4.5",
"grunt-cli": "~1.2.0",
"grunt-contrib-eslint": "~0.6.4",

This comment has been minimized.

Copy link
@hazzik

hazzik Apr 2, 2019

Contributor

This package version does not exist.

"grunt-contrib-nodeunit": "~0.2.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-jshint": "~0.6.4"
"gruntify-eslint": "^5.0.0"
}
}

0 comments on commit 87d4d4e

Please sign in to comment.