UNPKG

16.2 kBPlain TextView Raw
1{
2 "parser": "babel-eslint",
3
4 "ecmaFeatures": {
5 "arrowFunctions": true,
6 "binaryLiterals": false, // enable binary literals
7 "blockBindings": true, // enable let and const (aka block bindings)
8 "classes": true,
9 "defaultParams": true, // enable default function parameters
10 "destructuring": true,
11 "forOf": false, // enable for-of loops
12 "generators": false, // enable generators
13 "globalReturn": false,
14 "jsx": true, // enable JSX
15 "modules": true,
16 "objectLiteralComputedProperties": true, // enable computed object literal property names
17 "objectLiteralDuplicateProperties": true, // enable duplicate object literal properties in strict mode
18 "objectLiteralShorthandMethods": true, // enable object literal shorthand methods
19 "objectLiteralShorthandProperties": true, // enable object literal shorthand properties
20 "octalLiterals": false, // enable octal literals
21 "regexUFlag": false, // enable the regular expression u flag
22 "regexYFlag": false, // enable the regular expression y flag
23 "restParams": true,
24 "spread": true,
25 "superInFunctions": true,
26 "templateStrings": true, // enable template strings
27 "unicodeCodePointEscapes": false // enable code point escapes
28 },
29
30 "env": {
31 "browser": true, // browser global variables.
32 "node": true, // Node.js global variables and Node.js-specific rules.
33 "amd": false, // defines require() and define() as global variables as per the amd spec.
34 "mocha": true, // adds all of the Mocha testing global variables.
35 "jasmine": false, // adds all of the Jasmine testing global variables for version 1.3 and 2.0.
36 "phantomjs": false, // phantomjs global variables.
37 "jquery": false, // jquery global variables.
38 "prototypejs": false, // prototypejs global variables.
39 "shelljs": false, // shelljs global variables.
40 },
41
42 "globals": {
43 },
44
45 "plugins": [
46 // e.g. "react" (must run `npm install eslint-plugin-react` first)
47 ],
48
49 "rules": {
50 ////////// Possible Errors //////////
51
52 "comma-dangle": 1,
53 "no-comma-dangle": 0, // disallow trailing commas in object literals
54 "no-cond-assign": 0, // disallow assignment in conditional expressions
55 "no-console": 2, // disallow use of console (off by default in the node environment)
56 "no-constant-condition": 0, // disallow use of constant expressions in conditions
57 "no-control-regex": 0, // disallow control characters in regular expressions
58 "no-debugger": 0, // disallow use of debugger
59 "no-dupe-keys": 0, // disallow duplicate keys when creating object literals
60 "no-empty": 0, // disallow empty statements
61 "no-empty-class": 0, // disallow the use of empty character classes in regular expressions
62 "no-ex-assign": 0, // disallow assigning to the exception in a catch block
63 "no-extra-boolean-cast": 0, // disallow double-negation boolean casts in a boolean context
64 "no-extra-parens": 0, // disallow unnecessary parentheses (off by default)
65 "no-extra-semi": 1, // disallow unnecessary semicolons
66 "no-func-assign": 1, // disallow overwriting functions written as function declarations
67 "no-inner-declarations": 0, // disallow function or variable declarations in nested blocks
68 "no-invalid-regexp": 0, // disallow invalid regular expression strings in the RegExp constructor
69 "no-irregular-whitespace": 0, // disallow irregular whitespace outside of strings and comments
70 "no-negated-in-lhs": 0, // disallow negation of the left operand of an in expression
71 "no-obj-calls": 0, // disallow the use of object properties of the global object (Math and JSON) as functions
72 "no-regex-spaces": 0, // disallow multiple spaces in a regular expression literal
73 "no-reserved-keys": 0, // disallow reserved words being used as object literal keys (off by default)
74 "no-sparse-arrays": 0, // disallow sparse arrays
75 "no-unreachable": 0, // disallow unreachable statements after a return, throw, continue, or break statement
76 "use-isnan": 0, // disallow comparisons with the value NaN
77 "valid-jsdoc": 0, // Ensure JSDoc comments are valid (off by default)
78 "valid-typeof": 0, // Ensure that the results of typeof are compared against a valid string
79
80
81 ////////// Best Practices //////////
82
83 "block-scoped-var": 0, // treat var statements as if they were block scoped (off by default)
84 "complexity": 0, // specify the maximum cyclomatic complexity allowed in a program (off by default)
85 "consistent-return": 0, // require return statements to either always or never specify values
86 "curly": 0, // specify curly brace conventions for all control statements
87 "default-case": 0, // require default case in switch statements (off by default)
88 "dot-notation": 0, // encourages use of dot notation whenever possible
89 "eqeqeq": 0, // require the use of === and !==
90 "guard-for-in": 0, // make sure for-in loops have an if statement (off by default)
91 "no-alert": 0, // disallow the use of alert, confirm, and prompt
92 "no-caller": 0, // disallow use of arguments.caller or arguments.callee
93 "no-div-regex": 0, // disallow division operators explicitly at beginning of regular expression (off by default)
94 "no-else-return": 0, // disallow else after a return in an if (off by default)
95 "no-empty-label": 0, // disallow use of labels for anything other then loops and switches
96 "no-eq-null": 0, // disallow comparisons to null without a type-checking operator (off by default)
97 "no-eval": 0, // disallow use of eval()
98 "no-extend-native": 0, // disallow adding to native types
99 "no-extra-bind": 0, // disallow unnecessary function binding
100 "no-fallthrough": 0, // disallow fallthrough of case statements
101 "no-floating-decimal": 0, // disallow the use of leading or trailing decimal points in numeric literals (off by default)
102 "no-implied-eval": 0, // disallow use of eval()-like methods
103 "no-iterator": 0, // disallow usage of __iterator__ property
104 "no-labels": 0, // disallow use of labeled statements
105 "no-lone-blocks": 0, // disallow unnecessary nested blocks
106 "no-loop-func": 0, // disallow creation of functions within loops
107 "no-multi-spaces": 0, // disallow use of multiple spaces
108 "no-multi-str": 0, // disallow use of multiline strings
109 "no-native-reassign": 0, // disallow reassignments of native objects
110 "no-new": 0, // disallow use of new operator when not part of the assignment or comparison
111 "no-new-func": 0, // disallow use of new operator for Function object
112 "no-new-wrappers": 0, // disallows creating new instances of String, Number, and Boolean
113 "no-octal": 0, // disallow use of octal literals
114 "no-octal-escape": 0, // disallow use of octal escape sequences in string literals, such as var foo = "Copyright \251";
115 "no-process-env": 0, // disallow use of process.env (off by default)
116 "no-proto": 0, // disallow usage of __proto__ property
117 "no-redeclare": 0, // disallow declaring the same variable more then once
118 "no-return-assign": 0, // disallow use of assignment in return statement
119 "no-script-url": 0, // disallow use of javascript: urls.
120 "no-self-compare": 0, // disallow comparisons where both sides are exactly the same (off by default)
121 "no-sequences": 0, // disallow use of comma operator
122 "no-unused-expressions": 0, // disallow usage of expressions in statement position
123 "no-void": 0, // disallow use of void operator (off by default)
124 "no-warning-comments": 0, // disallow usage of configurable warning terms in comments, e.g. TODO or FIXME (off by default)
125 "no-with": 0, // disallow use of the with statement
126 "radix": 0, // require use of the second argument for parseInt() (off by default)
127 "vars-on-top": 1, // requires to declare all vars on top of their containing scope (off by default)
128 "wrap-iife": 0, // require immediate function invocation to be wrapped in parentheses (off by default)
129 "yoda": 0, // require or disallow Yoda conditions
130
131
132 ////////// Strict Mode //////////
133
134 "global-strict": 0, // (deprecated) require or disallow the "use strict" pragma in the global scope (off by default in the node environment)
135 "no-extra-strict": 0, // (deprecated) disallow unnecessary use of "use strict"; when already in strict mode
136 "strict": 0, // controls location of Use Strict Directives
137
138
139 ////////// Variables //////////
140
141 "no-catch-shadow": 0, // disallow the catch clause parameter name being the same as a variable in the outer scope (off by default in the node environment)
142 "no-delete-var": 0, // disallow deletion of variables
143 "no-label-var": 0, // disallow labels that share a name with a variable
144 "no-shadow": 0, // disallow declaration of variables already declared in the outer scope
145 "no-shadow-restricted-names": 0, // disallow shadowing of names such as arguments
146 "no-undef": 0, // disallow use of undeclared variables unless mentioned in a /*global */ block
147 "no-undef-init": 0, // disallow use of undefined when initializing variables
148 "no-undefined": 0, // disallow use of undefined variable (off by default)
149 "no-unused-vars": 0, // disallow declaration of variables that are not used in the code
150 "no-use-before-define": 0, // disallow use of variables before they are defined
151
152
153 ////////// Node.js //////////
154
155 "handle-callback-err": 0, // enforces error handling in callbacks (off by default) (on by default in the node environment)
156 "no-mixed-requires": 1, // disallow mixing regular variable and require declarations (off by default) (on by default in the node environment)
157 "no-new-require": 1, // disallow use of new operator with the require function (off by default) (on by default in the node environment)
158 "no-path-concat": 1, // disallow string concatenation with __dirname and __filename (off by default) (on by default in the node environment)
159 "no-process-exit": 0, // disallow process.exit() (on by default in the node environment)
160 "no-restricted-modules": 0, // restrict usage of specified node modules (off by default)
161 "no-sync": 0, // disallow use of synchronous methods (off by default)
162
163
164 ////////// Stylistic Issues //////////
165
166 "brace-style": 0, // enforce one true brace style (off by default)
167 "camelcase": 1, // require camel case names
168 "comma-spacing": 2, // enforce spacing before and after comma
169 "comma-style": 0, // enforce one true comma style (off by default)
170 "consistent-this": 0, // enforces consistent naming when capturing the current execution context (off by default)
171 "eol-last": 1, // enforce newline at the end of file, with no multiple empty lines
172 "func-names": 0, // require function expressions to have a name (off by default)
173 "func-style": 0, // enforces use of function declarations or expressions (off by default)
174 "key-spacing": 0, // enforces spacing between keys and values in object literal properties
175 "max-nested-callbacks": 0, // specify the maximum depth callbacks can be nested (off by default)
176 "new-cap": 0, // require a capital letter for constructors
177 "new-parens": 0, // disallow the omission of parentheses when invoking a constructor with no arguments
178 "no-array-constructor": 0, // disallow use of the Array constructor
179 "no-inline-comments": 0, // disallow comments inline after code (off by default)
180 "no-lonely-if": 0, // disallow if as the only statement in an else block (off by default)
181 "no-mixed-spaces-and-tabs": 0, // disallow mixed spaces and tabs for indentation
182 "no-multiple-empty-lines": 0, // disallow multiple empty lines (off by default)
183 "no-nested-ternary": 0, // disallow nested ternary expressions (off by default)
184 "no-new-object": 0, // disallow use of the Object constructor
185 "no-space-before-semi": 0, // disallow space before semicolon
186 "no-spaced-func": 0, // disallow space between function identifier and application
187 "no-ternary": 0, // disallow the use of ternary operators (off by default)
188 "no-trailing-spaces": 0, // disallow trailing whitespace at the end of lines
189 "no-underscore-dangle": 0, // disallow dangling underscores in identifiers
190 "no-wrap-func": 0, // disallow wrapping of non-IIFE statements in parens
191 "one-var": 0, // allow just one var statement per function (off by default)
192 "operator-assignment": 0, // require assignment operator shorthand where possible or prohibit it entirely (off by default)
193 "padded-blocks": 0, // enforce padding within blocks (off by default)
194 "quote-props": 0, // require quotes around object literal property names (off by default)
195 "quotes": [1, "single"], // specify whether double or single quotes should be used
196 "semi": 0, // require or disallow use of semicolons instead of ASI
197 "sort-vars": 0, // sort variables within the same declaration block (off by default)
198 "space-after-function-name": 1, // require a space after function names (off by default)
199 "space-after-keywords": 1, // require a space after certain keywords (off by default)
200 "space-before-blocks": 0, // require or disallow space before blocks (off by default)
201 "space-in-brackets": 0, // require or disallow spaces inside brackets (off by default)
202 "space-in-parens": 0, // require or disallow spaces inside parentheses (off by default)
203 "space-infix-ops": 1, // require spaces around operators
204 "space-return-throw-case": 0, // require a space after return, throw, and case
205 "space-unary-ops": 1, // Require or disallow spaces before/after unary operators (words on by default, nonwords off by default)
206 "spaced-line-comment": 0, // require or disallow a space immediately following the // in a line comment (off by default)
207 "wrap-regex": 0, // require regex literals to be wrapped in parentheses (off by default)
208
209
210 ////////// ECMAScript 6 //////////
211
212 "no-var": 2, // require let or const instead of var (off by default)
213 "generator-star": 0, // enforce the position of the * in generator functions (off by default)
214
215
216 ////////// Legacy //////////
217
218 "max-depth": 0, // specify the maximum depth that blocks can be nested (off by default)
219 "max-len": 0, // specify the maximum length of a line in your program (off by default)
220 "max-params": 0, // limits the number of parameters that can be used in the function declaration. (off by default)
221 "max-statements": 0, // specify the maximum number of statement allowed in a function (off by default)
222 "no-bitwise": 0, // disallow use of bitwise operators (off by default)
223 "no-plusplus": 0 // disallow use of unary operators, ++ and -- (off by default)
224 }
225}