Add eslint auto-fixing to Gruntfile

Run `npm run lint:fix` to use

Change-Id: I445c17a57b5f240ddaa48956d7881cc3228eab76
This commit is contained in:
jdlrobson 2018-03-27 12:43:14 -07:00
parent bb2ad2ed38
commit 3c892ca9f8
2 changed files with 11 additions and 0 deletions

View file

@ -29,6 +29,15 @@ module.exports = function ( grunt ) {
'src/**/*.js',
'tests/node-qunit/**/*.js'
]
},
sourcesfix: {
options: {
fix: true
},
src: [
'src/**/*.js',
'tests/node-qunit/**/*.js'
]
}
},
jsonlint: {
@ -66,6 +75,7 @@ module.exports = function ( grunt ) {
}
} );
grunt.registerTask( 'fix', [ 'eslint:sourcesfix' ] );
grunt.registerTask( 'lint', [ 'eslint', 'stylelint', 'jsonlint', 'banana', 'eslint:build' ] );
grunt.registerTask( 'default', [ 'lint' ] );
};

View file

@ -3,6 +3,7 @@
"scripts": {
"start": "webpack -dw",
"build": "NODE_ENV=production webpack -p",
"lint:fix": "grunt fix",
"test:node": "node tests/node-qunit/run.js 'tests/node-qunit/**/*.test.js' | tap-dot",
"test:dev": "grunt lint && npm run test:node",
"test": "npm run check-built-assets && npm run test:dev && npm run doc",