Replace Grunt tasks with npm scripts in package.json

Adds the following npm scripts:
- npm run lint
- npm run lint:js
- npm run lint:styles
- npm run lint:i18n

Bug: T242781
Change-Id: I0c2cfce73a02029b9d0c4d329309aff477cb02d4
This commit is contained in:
Jan Drewniak 2020-02-26 00:49:15 +01:00
parent 2dbb1c1721
commit 98b70067c9
5 changed files with 2839 additions and 3206 deletions

5
.eslintignore Normal file
View File

@ -0,0 +1,5 @@
/.storybook/
/docs/
/i18n/
/node_modules/
/vendor/

5
.stylelintignore Normal file
View File

@ -0,0 +1,5 @@
/.storybook/
/docs/
/node_modules/
/skinStyles/jquery.ui/
/vendor/

View File

@ -1,37 +0,0 @@
/* eslint-env node, es6 */
module.exports = function ( grunt ) {
var conf = grunt.file.readJSON( 'skin.json' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.initConfig( {
eslint: {
options: {
extensions: [ '.js', '.json' ],
cache: true
},
all: [
'**/*.js{,on}',
'!{vendor,node_modules,docs}/**'
]
},
banana: conf.MessagesDirs,
stylelint: {
options: {
syntax: 'less'
},
all: [
'*.{less,css}',
'**/*.{less,css}',
'!node_modules/**',
'!docs/**',
'!skinStyles/jquery.ui/**',
'!vendor/**'
]
}
} );
grunt.registerTask( 'test', [ 'eslint', 'banana', 'stylelint' ] );
grunt.registerTask( 'default', 'test' );
};

5986
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,11 @@
"private": true,
"scripts": {
"storybook": "./dev-scripts/setup-storybook.sh && start-storybook -p 6006",
"test": "grunt test && npm run doc",
"test": "npm -s run lint && npm run doc",
"lint": "npm -s run lint:js && npm -s run lint:styles && npm -s run lint:i18n",
"lint:js": "eslint --cache --max-warnings 0 .",
"lint:styles": "stylelint \"**/*.{less,css}\"",
"lint:i18n": "banana-checker --requireLowerCase=0 i18n/",
"jsdoc": "jsdoc -c jsdoc.json",
"doc": "npm run jsdoc && npm run build-storybook",
"build-storybook": "./dev-scripts/setup-storybook.sh && build-storybook -o docs/ui"
@ -12,14 +16,12 @@
"@storybook/html": "5.2.8",
"babel-loader": "8.0.6",
"eslint-config-wikimedia": "0.15.0",
"grunt": "1.0.4",
"grunt-banana-checker": "0.8.1",
"grunt-eslint": "22.0.0",
"grunt-stylelint": "0.13.0",
"jsdoc": "3.6.3",
"less": "3.8.1",
"less-loader": "4.1.0",
"mustache": "3.0.1",
"stylelint-config-wikimedia": "0.8.0"
"stylelint": "10.0.1",
"stylelint-config-wikimedia": "0.9.0"
}
}