Skip to content

Instantly share code, notes, and snippets.

@joseluisq
Last active April 18, 2018 20:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joseluisq/b2149c9319e7bd62e04307090cd0604c to your computer and use it in GitHub Desktop.
Save joseluisq/b2149c9319e7bd62e04307090cd0604c to your computer and use it in GitHub Desktop.
My custom ESLint + Standard rules
/.nyc_output
/.vscode
/coverage
/node_modules
/tests/fixtures
/tests/integrations/*/node_modules
{
"env": {
"node": true,
"es6": true
},
"extends": "standard",
"rules": {
"array-bracket-spacing": [
"error",
"always"
],
"object-curly-spacing": [
"error",
"always"
],
"max-len": [
"error",
{
"code": 132,
"ignoreUrls": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true,
"ignoreRegExpLiterals": true
}
],
"no-unused-vars": [
"error",
{
"vars": "all",
"args": "after-used",
"ignoreRestSiblings": false
}
]
}
}
@joseluisq
Copy link
Author

joseluisq commented Apr 6, 2018

Usage:

Install ESLint and Standard dependencies:

yarn add \
  eslint \
  eslint-config-standard \
  eslint-plugin-standard \
  eslint-plugin-promise \
  eslint-plugin-import \
  eslint-plugin-node \
  --dev

Automatic lint your files:
Add to your package.json scripts:

"lint": "eslint ."

VS Code with auto formatting (ctrl + s)
Install vscode-eslint extension and then add to your settings.json:

"editor.formatOnSave": true,
"eslint.autoFixOnSave": true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment