Skip to content

Commit

Permalink
Replace jshint with eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
simison committed Apr 1, 2019
1 parent e5cd0d5 commit 57cf0d3
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 26 deletions.
58 changes: 58 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,63 @@ module.exports = {
'wpcalypso/jsx-classname-namespace': 0,
},
},
{
files: [
'_inc/*.js',
'!_inc/*.min.js',
'modules/*.js',
'!modules/*.min.',
'modules/**/*.js',
'!modules/**/*.min.js',
'!_inc/jquery.spin.js',
'!_inc/postmessage.js',
'!_inc/spin.js',
'!modules/custom-css/custom-css/js/codemirror.min.js',
'!modules/shortcodes/js/jmpress.js',
'!modules/shortcodes/js/jquery.cycle.min.js',
'!modules/theme-tools/responsive-videos/responsive-videos.min.js',
'!modules/infinite-scroll/infinity.js',
'!modules/**/test-*.js',
],
env: {
browser: true,
jquery: true,
/*
jshint
"globals": {
"_": false,
"Backbone": false,
"jQuery": false,
"wp": false
}
*/
},
parserOptions: {
ecmaVersion: 5,
},
rules: {
/*
jshint
{
"boss": true,
"curly": true,
"esversion": 5,
"eqeqeq": true,
"eqnull": true,
"expr": true,
"immed": true,
"laxbreak": true,
"noarg": true,
"onevar": true,
"quotmark": false,
"undef": true,
"unused": true,
"browser": true,
}
*/
},
},
],
};
22 changes: 0 additions & 22 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* jshint ignore:start */
/**
* External dependencies
*/
Expand All @@ -7,7 +6,6 @@ import deleteLines from 'gulp-delete-lines';
import fs from 'fs';
import gulp from 'gulp';
import i18n_calypso from 'i18n-calypso/cli';
import jshint from 'gulp-jshint';
import json_transform from 'gulp-json-transform';
import log from 'fancy-log';
import po2json from 'gulp-po2json';
Expand All @@ -29,25 +27,6 @@ gulp.task( 'old-styles:watch', function() {
return gulp.watch( 'scss/**/*.scss', gulp.parallel( 'old-styles' ) );
} );

/*
JS Hint
*/
gulp.task( 'js:hint', function() {
return gulp
.src( [
'_inc/*.js',
'modules/*.js',
'modules/**/*.js',
'!_inc/*.min.js',
'!modules/*.min.',
'!modules/**/*.min.js',
'!**/*/*block.js',
] )
.pipe( jshint( '.jshintrc' ) )
.pipe( jshint.reporter( 'jshint-stylish' ) )
.pipe( jshint.reporter( 'fail' ) );
} );

/*
I18n land
*/
Expand Down Expand Up @@ -309,7 +288,6 @@ gulp.task( 'languages:phpize', function( done ) {
} );

gulp.task( 'old-styles', gulp.parallel( frontendcss, admincss, 'sass:old' ) );
gulp.task( 'jshint', gulp.parallel( 'js:hint' ) );

// Default task
gulp.task(
Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"docker:tail": "yarn docker:compose exec wordpress bash -c \"/var/scripts/tail.sh\"",
"docker:clean": "yarn docker:compose down --rmi all -v && rm -rf docker/wordpress/* docker/wordpress/.htaccess docker/wordpress-develop/* docker/logs/* docker/data/mysql/*",
"docker:env": "node -e \"require('fs').createWriteStream( 'docker/.env', { flags: 'a' } );\"",
"lint": "gulp jshint && eslint --ext .js --ext .jsx ./*.js _inc/client extensions -c .eslintrc.js",
"lint": "eslint --ext .js --ext .jsx ./*.js _inc/client extensions -c .eslintrc.js",
"php:compatibility": "composer php:compatibility",
"php:lint": "composer php:lint",
"php:autofix": "composer php:autofix",
Expand Down Expand Up @@ -118,7 +118,6 @@
"gulp-clean-css": "2.4.0",
"gulp-concat": "2.6.1",
"gulp-if": "2.0.2",
"gulp-jshint": "2.1.0",
"gulp-json-transform": "0.4.6",
"gulp-minify": "3.1.0",
"gulp-modify": "0.1.1",
Expand All @@ -133,8 +132,6 @@
"i18n-calypso": "3.0.0",
"jsdom": "14.0.0",
"jsdom-global": "3.0.2",
"jshint": "2.9.7",
"jshint-stylish": "2.2.1",
"json-loader": "0.5.7",
"lodash": "4.17.11",
"mapbox-gl": "0.53.1",
Expand Down

0 comments on commit 57cf0d3

Please sign in to comment.