-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
129 lines (104 loc) · 6.76 KB
/
.eslintrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
{
"extends": ["eslint:recommended", "plugin:react/recommended"],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module",
"ecmaFeatures": {
"binaryLiterals": true, // enable binary literals
"blockBindings": true, // enable let and const (aka block bindings)
"defaultParams": true, // enable default function parameters
"forOf": true, // enable for-of loops
"generators": true, // enable generators
"objectLiteralComputedProperties": true, // enable computed object literal property names
"objectLiteralDuplicateProperties": true, // enable duplicate object literal properties in strict mode
"objectLiteralShorthandMethods": true, // enable object literal shorthand methods
"objectLiteralShorthandProperties": true, // enable object literal shorthand properties
"regexUFlag": true, // enable the regular expression u flag
"regexYFlag": true, // enable the regular expression y flag
"templateStrings": true, // enable template strings
"unicodeCodePointEscapes": true, // enable code point escapes
}
},
"env": {
"browser": true, // browser global variables.
"node": true, // Node.js global variables and Node.js-specific rules.
"mocha": true, // adds all of the Mocha testing global variables.
"es6": true,
"phantomjs": false, // phantomjs global variables.
},
"globals": {
},
"plugins": [
"react"
],
"rules": {
"comma-dangle": 2, // disallow trailing commas in object literals
"no-constant-condition": 0, // disallow use of constant expressions in conditions
"no-control-regex": 0, // disallow control characters in regular expressions
"no-extra-parens": 2,
"no-obj-calls": 2, // disallow the use of object properties of the global object (Math and JSON) as functions
"no-regex-spaces": 2, // disallow multiple spaces in a regular expression literal
////////// Best Practices //////////
"complexity": 2, // specify the maximum cyclomatic complexity allowed in a program (off by default)
"consistent-return": 2, // require return statements to either always or never specify values
"curly": 2, // specify curly brace conventions for all control statements
"dot-notation": 2, // encourages use of dot notation whenever possible
"eqeqeq": 2, // require the use of === and !==
"no-param-reassign": 2,
"no-new": 2,
"no-return-assign": 2,
"yoda": [2, "always"], // require or disallow Yoda conditions
"strict": [2, "never"], // controls location of Use Strict Directives
"no-useless-constructor": 2,
////////// Variables //////////
"no-catch-shadow": 2,
"no-delete-var": 2, // disallow deletion of variables
"no-label-var": 2, // disallow labels that share a name with a variable
"no-shadow": 2, // disallow declaration of variables already declared in the outer scope
"no-shadow-restricted-names": 2, // disallow shadowing of names such as arguments
"no-undef": 2, // disallow use of undeclared variables unless mentioned in a /*global */ block
"no-undef-init": 2, // disallow use of undefined when initializing variables
"no-undefined": 2, // disallow use of undefined variable (off by default)
"no-unused-vars": 2, // disallow declaration of variables that are not used in the code
"no-use-before-define": 2, // disallow use of variables before they are defined
////////// Node.js //////////
"no-mixed-requires": 0, // disallow mixing regular variable and require declarations
"no-new-require": 2, // disallow use of new operator with the require function
"no-path-concat": 0, // disallow string concatenation with __dirname and __filename
"no-restricted-modules": [2, "s"],
"no-sync": 2,
////////// Stylistic Issues //////////
"brace-style": 2, // enforce one true brace style (off by default)
"camelcase": 2, // require camel case names
"comma-style": 2, // enforce one true comma style (off by default)
"consistent-this": 2, // enforces consistent naming when capturing the current execution context (off by default)
"eol-last": 2, // enforce newline at the end of file, with no multiple empty lines
"func-style": 0, // enforces use of function declarations or expressions (off by default)
"key-spacing": 0, // enforces spacing between keys and values in object literal properties
"max-nested-callbacks": [2, 4], // specify the maximum depth callbacks can be nested (off by default)
"new-cap": 0, // require a capital letter for constructors
"new-parens": 2, // disallow the omission of parentheses when invoking a constructor with no arguments
"no-array-constructor": 2, // disallow use of the Array constructor
"no-mixed-spaces-and-tabs": 0, // disallow mixed spaces and tabs for indentation
"no-multiple-empty-lines": 2, // disallow multiple empty lines
"no-nested-ternary": 2, // disallow nested ternary expressions
"no-new-object": 2, // disallow use of the Object constructor
"semi-spacing": 2, // disallow space before semicolon
"no-spaced-func": 0, // disallow space between function identifier and application
"no-trailing-spaces": 0, // disallow trailing whitespace at the end of lines
"no-underscore-dangle": 0, // disallow dangling underscores in identifiers
"quotes": [2, "single", "avoid-escape"],
"sort-vars": 0, // sort variables within the same declaration block (off by default)
"spaced-comment": 2, // require or disallow a space immediately following the // in a line comment (off by default)
////////// ECMAScript 6 //////////
"no-var": 2, // require let or const instead of var (off by default)
////////// Legacy //////////
"max-depth": 2, // specify the maximum depth that blocks can be nested
"max-len": [2, 130], // specify the maximum length of a line in your program
"max-params": [2, 6], // limits the number of parameters that can be used in the function declaration
"max-statements": [2, 30], // specify the maximum number of statement allowed in a function
"no-bitwise": 2, // disallow use of bitwise operators
"react/prop-types": 0
}
}