Custom ESlint & Stylelint configuration.
The rules are defined in eslint.json
. Complete list of ESLint rules can be found here: https://eslint.org/docs/rules/
The rules are defined in stylelint.json
. Complete list of Stylelint rules can be found here: https://stylelint.io/user-guide/rules/
$ npm i @radek-altof/lint-config --save-dev
Extend your ESLint and Stylelint config files. Ex.:
{
"extends": ["./node_modules/@radek-altof/lint-config/eslint.json"]
}
Install grunt dependencies.
$ npm i grunt-eslint --save-dev
$ npm i grunt-stylelint --save-dev
Update gruntfile.js
in your project.
grunt.initConfig({
eslint: {
options: {
configFile: 'eslint.json',
fix: grunt.option('fix')
},
target: ['js/*.js']
},
stylelint: {
options: {
configFile: 'stylelint.json',
syntax: 'scss',
fix: grunt.option('fix')
},
src: [ 'css/*.scss' ]
}
});
Lint your code.
$ grunt eslint
$ grunt stylelint