Skip to content

Instantly share code, notes, and snippets.

@arnodirlam
Last active June 3, 2016 08:47
Show Gist options
  • Save arnodirlam/0ceec98fb9ac3c9911c18a49ae17239c to your computer and use it in GitHub Desktop.
Save arnodirlam/0ceec98fb9ac3c9911c18a49ae17239c to your computer and use it in GitHub Desktop.
eslint config
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 6,
sourceType: 'module'
},
extends: 'eslint:recommended',
env: {
browser: true
},
rules: {
// spacing
"array-bracket-spacing": ["error", "never"],
"arrow-spacing": "error",
"block-spacing": "error",
"comma-spacing": "error",
"key-spacing": "error",
"keyword-spacing": "error",
"newline-after-var": "error",
"newline-before-return": "error",
"object-curly-spacing": ["error", "always"],
"space-before-blocks": "error",
"space-in-parens": "error",
"space-infix-ops": "error",
"spaced-comment": "error",
// minimalism
"dot-notation": "error",
"no-lonely-if": "error",
"no-lone-blocks": "error",
"object-shorthand": ["error", "methods"],
"quote-props": ["error", "as-needed"],
"prefer-arrow-callback": "error",
"no-empty-function": "error",
// safety
"no-confusing-arrow": "error",
"no-var": "error",
"prefer-const": "error",
"semi": "error",
// consistency/readability
"brace-style": ["1tbs", { allowSingleLine: true }],
"curly": "off",
"indent": ["error", 2],
"no-negated-condition": "error",
// git-friendly
"comma-dangle": "off",
"eol-last": "error",
// turned off
"camelcase": "off",
"arrow-parens": "off",
"no-magic-numbers": "off",
"arrow-body-style": "off",
"one-var": "off",
"consistent-return": "off",
"valid-jsdoc": "off",
"no-ternary": "off",
"space-before-function-paren": "off",
"quotes": "off",
"array-callback-return": "off",
"no-else-return": "off",
"no-undefined": "off",
"brace-style": "off",
"consistent-this": "off",
"prefer-reflect": "off",
"max-len": "off",
"newline-per-chained-call": "off",
"lines-around-comment": "off",
// missing
// - new line before and after if and other control statements
// - new line before multi-line comment, only if it's not the first statement in the block
// - error on Ember function prototype extensions (property, observer, on, ...)
},
globals: {
Promise: true,
$: true
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment