Skip to content

Instantly share code, notes, and snippets.

@brazabr
Created January 30, 2017 19:26
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 brazabr/2eb8d808f84469b0cd23a107678e6e8d to your computer and use it in GitHub Desktop.
Save brazabr/2eb8d808f84469b0cd23a107678e6e8d to your computer and use it in GitHub Desktop.
ESLint Settings for Good Javascript and WordPress Coding Standard compliance.
{
"env": {
"browser": true,
"jquery": true
},
"globals": {
"_": true,
"Backbone": true,
"jQuery": true,
"JSON": true,
"wp": true,
"console": true
},
"rules": {
"curly": [ "error", "all" ],
"quotes": [ "error", "single" ],
"comma-style": [ "error", "last" ],
"space-in-parens": [ "error", "always", { "exceptions": ["{}"] }],
"object-curly-spacing": [ "error", "always" ],
"object-curly-newline": ["error", { "multiline": true }],
"array-bracket-spacing": [ "error", "always" ],
"computed-property-spacing": [ "error", "always" ],
"dot-notation": [ "warn", { "allowKeywords": true } ],
"semi": [ "error", "always" ],
"space-unary-ops": [
"error", {
"overrides": {
"!": true
}
}
],
"newline-per-chained-call": [ "error", { "ignoreChainWithDepth": 2 } ],
"one-var": [ "error", "always" ],
"spaced-comment": [ "error", "always" ],
"line-comment-position": [ "error", { "position": "above" } ],
"lines-around-comment": [
"error", {
"beforeBlockComment": true,
"beforeLineComment": true,
"allowBlockStart": true,
"allowBlockEnd": false,
"allowObjectStart": true,
"allowObjectEnd": false,
"allowArrayStart": true,
"allowArrayEnd": false
}
],
"no-inline-comments": [ "off" ],
"no-unused-vars": [ "warn" ],
"eqeqeq": [ "error", "allow-null" ],
"valid-typeof": [ "error" ],
"operator-linebreak": [ "error", "after" ],
"yoda": [ "warn", "always" ],
"no-cond-assign": [ "error", "except-parens" ],
"block-scoped-var": [ "error" ],
"camelcase": [ "error" ],
"new-cap": [ "error" ],
"guard-for-in": [ "error" ],
"no-bitwise": [ "error" ],
"no-caller": [ "error" ],
"no-debugger": [ "error" ],
"no-empty": [ "error" ],
"no-eval": [ "error" ],
"no-iterator": [ "error" ],
"no-new": [ "error" ],
"no-proto": [ "error" ],
"no-with": [ "error" ],
"no-extend-native": [ "error" ],
"no-irregular-whitespace": [ "error" ],
"no-loop-func": [ "error" ],
"no-multi-str": [ "off" ],
"no-script-url": [ "error" ],
"no-sequences": [ "error" ],
"no-shadow": [ "error" ],
"no-undef": [ "error" ],
"wrap-iife": [ "error", "inside" ]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment