This repo contains defaults for the Unum UX team's default eslint configuration.
Install in your project with:
npm i --save-dev @unumux/eslint-config-unumux eslint babel-eslint
Then create a file in the root folder called .eslintrc.json. Put the following in this file:
{
"extends": "@unumux/unumux"
}
Use the eslint command line tool (npm i -g eslint
) or a plugin for your editor (such as linter-eslint for Atom) to see linting errors
Config can be easily modified by modifying the .eslintrc.json file in your project folder. For example, if you don't want console.log to raise a linting error, simply change the file like so:
{
"rules": {
"no-console": 0
},
"extends": "@unumux/unumux"
}
IMPORTANT: Do not modify the rules inside of node_modules/@unumux/unumux - these won't be updated for other users of your project, and will be overwritten if you reinstall your packages.
Node has slightly different rules for linting. To enable this ruleset, create an .eslintrc.json file with the following:
{
"extends": "@unumux/unumux/node"
}
React also has slightly different rules for linting. To enable this ruleset, create an .eslintrc.json file with the following:
{
"extends": "@unumux/unumux/react"
}