Skip to content

Commit

Permalink
chore: migrate from grunt eslint to npm script (dequelabs#1247)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeeyyy authored and WilcoFiers committed Nov 20, 2018
1 parent 8bfebca commit 1015670
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 31 deletions.
9 changes: 7 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
**/node_modules/**/*.js

build/tasks/generate-imports.js
!lib/core/imports/index.js
build/tasks/aria-supported.js

doc/api/*
doc/examples/jest_react/*.js

lib/core/imports/*.js
doc/api/*
42 changes: 14 additions & 28 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-mocha');
grunt.loadNpmTasks('grunt-parallel');
grunt.loadNpmTasks('grunt-markdownlint');
grunt.loadNpmTasks('grunt-run');
grunt.loadTasks('build/tasks');

var langs;
Expand Down Expand Up @@ -331,7 +331,6 @@ module.exports = function(grunt) {
mocha: testConfig(grunt, {
reporter: grunt.option('reporter') || 'Spec'
}),

connect: {
test: {
options: {
Expand All @@ -341,23 +340,10 @@ module.exports = function(grunt) {
}
}
},
eslint: {
axe: {
options: {
eslintrc: true,
reporter: grunt.option('report') ? 'checkstyle' : undefined,
reporterOutput: grunt.option('report') ? 'tmp/lint.xml' : undefined
},
src: [
'lib/**/*.js',
'test/**/*.js',
'build/**/*.js',
'doc/**/*.js',
'!doc/examples/jest_react/*.js',
'Gruntfile.js',
'!build/tasks/aria-supported.js',
'!**/node_modules/**/*.js'
]
run: {
npm_run_eslint: {
cmd: 'npm',
args: ['run', 'eslint']
}
},
markdownlint: {
Expand All @@ -372,10 +358,14 @@ module.exports = function(grunt) {

grunt.registerTask('default', ['build']);

grunt.registerTask('build', [
grunt.registerTask('pre-build', [
'clean',
'generate-imports',
'eslint',
'run:npm_run_eslint'
]);

grunt.registerTask('build', [
'pre-build',
'validate',
'concat:commons',
'configure',
Expand All @@ -393,7 +383,6 @@ module.exports = function(grunt) {
'connect',
'mocha',
'parallel',
'eslint',
'markdownlint'
]);

Expand All @@ -402,22 +391,19 @@ module.exports = function(grunt) {
'testconfig',
'fixture',
'connect',
'parallel',
'eslint'
'parallel'
]);

grunt.registerTask('test-fast', [
'build',
'testconfig',
'fixture',
'connect',
'mocha',
'eslint'
'mocha'
]);

grunt.registerTask('translate', [
'clean',
'eslint',
'pre-build',
'validate',
'concat:commons',
'add-locale'
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"scripts": {
"api-docs": "jsdoc --configure .jsdoc.json",
"build": "grunt",
"eslint": "eslint --format stylish '{lib,test,build,doc}/**/*.js' 'Gruntfile.js'",
"test": "npm run retire && tsc && grunt test",
"version": "echo \"use 'npm run release' to bump axe-core version\" && exit 1",
"prepublishOnly": "grunt build && grunt file-exists",
Expand Down Expand Up @@ -89,10 +90,10 @@
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-uglify": "^4.0.0",
"grunt-contrib-watch": "^1.1.0",
"grunt-eslint": "^21.0.0",
"grunt-markdownlint": "^2.0.0",
"grunt-mocha": "1.1.0",
"grunt-parallel": "^0.5.1",
"grunt-run": "^0.8.1",
"html-entities": "^1.2.0",
"husky": "^1.1.1",
"jquery": "^3.0.0",
Expand Down

0 comments on commit 1015670

Please sign in to comment.