@dietlabs/eslint-config

DietLabs’s shared EsLint config

Stats

StarsIssuesVersionUpdatedCreatedSize
@dietlabs/eslint-config
141.2.23 years ago3 years agoMinified + gzip package size for @dietlabs/eslint-config in KB

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@latest

Use the configuration

echo '{"extends": "@dietlabs"}' > .eslintrc.json

Add lint-js npm script and run it

npx add-npm-scripts lint-js "eslint --fixup --ext .js,.jsx ./" --warn
npm run lint-js

Lint while WebPackin’

npm install --save-dev eslint-loader

Then 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

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.