Skip to content

Instantly share code, notes, and snippets.

@kav2k
Last active September 9, 2017 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kav2k/e83641d3c95d3b2fe004f92a5e7592c8 to your computer and use it in GitHub Desktop.
Save kav2k/e83641d3c95d3b2fe004f92a5e7592c8 to your computer and use it in GitHub Desktop.
My usual linter configuration (for browser extensions)
{
"env": {
"browser": true,
"webextensions": true,
"es6": true
},
"extends": "eslint:recommended",
"rules": {
// Allow console
"no-console": "off",
// Style, indent/whitespace
"indent": ["warn", 2, {"SwitchCase": 1}],
"no-trailing-spaces": "warn",
"eol-last": "warn",
"no-multiple-empty-lines": "warn",
// Style, spacing
"space-unary-ops": ["warn", {"words": true, "nonwords": false}],
"space-infix-ops": "warn",
"keyword-spacing": "warn",
"space-before-blocks": ["warn", "always"],
"operator-linebreak": "warn",
"space-before-function-paren": ["warn", "never"],
"space-in-parens": ["warn", "never"],
"array-bracket-spacing": ["warn", "never"],
"no-spaced-func": "warn",
"key-spacing": ["warn", {"beforeColon": false, "afterColon": true}],
"quote-props": ["warn", "as-needed"],
// Style, braces
"brace-style": ["warn", "1tbs", {"allowSingleLine": true}],
"curly": ["warn", "multi-line"],
// Style, misc
"no-with": "warn",
"dot-notation": "warn",
"quotes": ["warn", "double", {"avoidEscape": true}],
"no-var": "warn",
"semi": ["warn", "always"]
}
}
@kav2k
Copy link
Author

kav2k commented Sep 6, 2017

no-var is probably the most controversial.

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