Created
September 28, 2015 19:53
-
-
Save polyclick/eaba345d3ffbaa21ea2d to your computer and use it in GitHub Desktop.
.eslintrc configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// http://eslint.org/docs/rules/ | |
"parser": "babel-eslint", | |
"env": { | |
"browser": true, // browser global variables. | |
"node": true, // Node.js global variables and Node.js-specific rules. | |
"worker": false, // web workers global variables. | |
"amd": false, // defines require() and define() as global variables as per the amd spec. | |
"mocha": false, // adds all of the Mocha testing global variables. | |
"jasmine": false, // adds all of the Jasmine testing global variables for version 1.3 and 2.0. | |
"phantomjs": false, // phantomjs global variables. | |
"jquery": false, // jquery global variables. | |
"prototypejs": false, // prototypejs global variables. | |
"shelljs": false, // shelljs global variables. | |
"meteor": false, // meteor global variables. | |
"mongo": false, // mongo global variables. | |
"applescript": false, // applescript global variables. | |
"es6": true, // enable all ECMAScript 6 features except for modules. | |
}, | |
"ecmaFeatures": { | |
"modules": true // enable modules and global strict mode | |
}, | |
"globals": { | |
// globals | |
}, | |
"plugins": [ | |
// e.g. "react" (must run `npm install eslint-plugin-react` first) | |
], | |
"rules": { | |
// Possible Errors | |
"no-extra-semi": 1, // disallow unnecessary semicolons | |
"no-inner-declarations": 2, // disallow function or variable declarations in nested blocks | |
// Best Practices | |
"curly": 0, // allow shorthand if, else, for, while, do statements | |
"no-eval": 2, // disallow use of eval() | |
"no-extend-native": 2, // disallow adding to native types | |
"no-new-wrappers": 2, // disallows creating new instances of String, Number, and Boolean | |
"no-with": 2, // disallow use of the with statement | |
// Strict Mode | |
// Variables | |
"no-undef": 2, // disallow use of undeclared variables unless mentioned in a /*global */ block | |
// Node.js | |
// Stylistic Issues | |
// spaces | |
"array-bracket-spacing": [1, "always"], // enforce spacing inside array brackets (off by default) | |
"block-spacing": [1, "always"], // enforce spaces in single line blocks | |
"space-in-parens": [1, "always"], // enforce spaces inside of parentheses (space-in-parens) | |
"space-after-keywords": [1, "always"], // require or disallow spaces following keywords | |
"space-before-function-paren": [1, "always"], // force a space before function parenthesis | |
"space-before-blocks": [1, "always"], // force a space before blocks | |
"no-trailing-spaces": 1, | |
"object-curly-spacing": [1, "always"], // require or disallow padding inside curly braces (off by default) | |
"indent": [1, 2], // this option sets a specific tab width for your code (off by default) | |
"no-array-constructor": 2, // disallow use of the Array constructor | |
"no-mixed-spaces-and-tabs": 2, // disallow mixed spaces and tabs for indentation | |
"no-new-object": 2, // disallow use of the Object constructor | |
"semi": 2, // require or disallow use of semicolons instead of ASI | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment