@dietlabs/eslint-config
v1.2.2
Published
DietLabs’s shared EsLint config
Readme
DietLabs’s shared EsLint config
Setup
Install package with its’ peer dependencies
You will use the same command to upgrade to latest version.
npx install-peerdeps --dev @dietlabs/eslint-config@latestUse the configuration
echo '{"extends": "@dietlabs"}' > .eslintrc.jsonAdd lint-js npm script and run it
npx add-npm-scripts lint-js "eslint --fixup --ext .js,.jsx ./" --warn
npm run lint-jsLint while WebPackin’
npm install --save-dev eslint-loaderThen in webpack.config.js:
const lintingRules = require('eslint-config-dietlabs/webpack-rules');
module.exports = {
rules: [
// Your rules
].concat(lintingRules)
};Lint while commitin’
You want something in the shape of:
#!/bin/bash
CODE=0
for FILE in $( git diff --cached --name-only --diff-filter=ACM HEAD -- '*.js' '*.jsx' )
do
git show ":$FILE" \
| ./node_modules/.bin/eslint --stdin --stdin-filename "$FILE" \
|| CODE=$?
done
return $CODE