UNPKG

12.3 kBPlain TextView Raw
1{
2 "ecmaFeatures": {
3 "arrowFunctions": true,
4 "blockBindings": true,
5 "destructuring": true,
6 "modules": true,
7 },
8 "env": {
9 "es6": true,
10 "node": true
11 },
12 "parser": "babel-eslint",
13 "rules": {
14 // 0 - Turn Rule Off
15 // 1 - Turn Warning On For Rule
16 // 2 - Turn Error On For Rule
17
18 // Possible Errors //
19 "comma-dangle": [2, "never"], // No comma's on last element
20 "no-cond-assign": [2, "always"], // No single "=" in conditionals
21 "no-console": 0, // No console.log in node
22 "no-constant-condition": 1, // No constant values in conditionals
23 "no-control-regex": 1, // No special chars in regex
24 "no-debugger": 0, // No using debugger statement
25 "no-dupe-args": 2 , // No two arguements can have the same name
26 "no-dupe-keys": 2, // No two object props/keys can have the same name
27 "no-duplicate-case": 2 , // No two cases in switch can have the same name
28 "no-empty-character-class": 2 , // No empty charactes in regex
29 "no-empty": 2 , // No empty block statements
30 "no-ex-assign": 2 , // No assignment of error refs
31 "no-extra-boolean-cast": 2, // No double negation
32 "no-extra-parens": [2, "functions"], // No extra parenthesis
33 "no-extra-semi": 2, // No additional semi-colons (after 1)
34 "no-func-assign": 2, // No reassignment of functions after declaration
35 "no-inner-declarations": 2, // No function declarations allowed inner blocks
36 //"no-invalid-regex": 2, // No bad regex
37 "no-irregular-whitespace": 2, // No whitespace in bad places
38 "no-negated-in-lhs": 2, // All "in" es6 for loops must be evaluated
39 "no-obj-calls": 2, // Global JS objects aren't callable
40 "no-regex-spaces": 2, // Use one actual space in regex then specify using {} syntax
41 "no-sparse-arrays": 2 , // All slots in an array should be filled
42 "no-unexpected-multiline": 2, // End all blocks with semi colons
43 "no-unreachable": 2, // All code matters
44 "use-isnan": 2, // Use is NaN to compare with NaN
45 "valid-jsdoc": 2, // Syntax check on JSDOC
46 "valid-typeof": 2, // When using typeof in comparison make sure string is valid
47 // Best Practices //
48 "accessor-pairs": 0, //
49 "block-scoped-var": 2, // Don't use variables outside scope
50 "complexity": [1, 3], // Level 3 complexity for cyclomacy
51 "consistent-return": 2, // All returns from func should be same type
52 "curly": 2, // All blocks require curly braces
53 "default-case": 2, // Switches need default case
54 "dot-location": [2, "property"], // Multiline object declarations put dot on property
55 "dot-notation": 2, // Use foo.bar vs foo["bar"]
56 "eqeqeq": 2, // Triple equal for comparison
57 "guard-for-in": 1, // Warn if for ... in does not filter with if block
58 "no-alert": 1, // Warn when using alert, confirm, prompt, etc
59 "no-caller": 2, // No use of caller/callee
60 "no-case-declarations": 2, // Don't create variables in cases
61 "no-div-regex": 1, // Regex that looks like division warn
62 "no-else-return": 2, // If block contains return, no else is necessary
63 "no-empty-pattern": 2, // When destructuring, avoid creating empty patterns
64 "no-eq-null": 2, // Don't test null equality
65 "no-eval": 2, // No use of eval function
66 "no-extend-native": 2, // No extension, overwrite of native objects
67 "no-extra-bind": 2, // Don't use bind(), unless necessary
68 "no-fallthrough": 2, // Use break after every switch case
69 "no-floating-decimal": 2, // Pre or Post pend every decimal with a 0
70 "no-implicit-coercion": 2, // Use more concise sytax for converting for comparison
71 "no-implied-eval": 2, // Explicitely specify function, no eval()
72 "no-invalid-this": 0, // No 'this' outside of object or class
73 "no-iterator": 2, // Don't use the iterator property
74 "no-labels": 2, // Don't use labled statemetns
75 "no-lone-blocks": 1, // Single line blocks are useless, warn against usage
76 "no-loop-func": 2, // Functions create closures, this is a no-no in loops
77 "no-magic-numbers": 1, // Repeated values should be abstracted into contants
78 "no-multi-spaces": 2, // We want consistent spaces,
79 "no-multi-str": 2, // If not using es6 string templates, multiline is a no-no
80 "no-native-reassign": 2, // Don't overwrite native objects
81 "no-new-func": 2, // Let's not use the Function constructor to make functions
82 "no-new-wrappers": 2, // Don't create primitive using native wrapper (makes them objects)
83 "no-new": 2, // Always use 'new' operator
84 "no-octal-escape": 2, // Octal escapes are deprcated, use Unicode
85 "no-octal": 1, // Warn against es5 octal literals (beginning with 0)
86 "no-param-reassign": 2, // Don't modify passed params
87 "no-process-env": 2, // Set environment globally or in separate file
88 "no-proto": 2, // Don't overwrite built in object proto property
89 "no-redeclare": 2, // Declare once, never again (in same file)
90 "no-return-assign": 2, // No assignments in return statements
91 "no-script-url": 2, // javascript: is a form of eval, so no eval
92 "no-self-compare": 2, // Don't compare variable to itself
93 "no-sequences": 1, // No multiple expressions where one is needed
94 "no-throw-literal": 2, // Throw a class or variable, no literals
95 "no-unused-expressions": 2, // Code is precious, don't leave any hanging around
96 "no-useless-call": 2, // .apply() and .call() are slow, only use when necessary
97 "no-useless-concat": 2, // Never concat two strings!
98 "no-void": 2, // Void returns undefied, cut out the middle man and use directly
99 "no-warning-comments": 0, // We want todo, fix etc comments
100 "no-with": 2, // No third wheels, (With adds an objects memebrs to scope)
101 "radix": 2, // Always specify radix when using ParseInt()
102 "vars-on-top": 1, // Though hoisting exists, try and declare them at the top of scope
103 "wrap-iife": 2, // Wrap self invoking fuctions in parens
104 "yoda": 2, // Literals on right of comparison
105 // Variables //
106 "init-declarations": 0, // Initialize variables at declaration or don't, eh
107 "no-catch-shadow": 2, // No overwriting of error variable in catch
108 "no-delete-var": 2, // Variables can't be deleted, so don't try it
109 "no-label-var": 2, // No key/property can have the same name as a variable
110 "no-shadow-restricted-names": 2, // No naming of variables after keywords
111 "no-shadow": [2, {"builtinGlobals": true, "allow": ["tape", "t", "swear"]}], // No reuse of global variables inside blocks (non-param)
112 "no-undef-init": 2, // Don't declare variable with value undefined
113 "no-undef": 2, // Don't used variable that's not defined
114 "no-undefined": 2, // Don't overwrite undefined
115 "no-unused-vars": 2, // All vars matter
116 "no-use-before-define": 2, // Declare before use (hoisting? who cares!)
117 // Stylistic //
118 "array-bracket-spacing": 2, // No spaces in array declaration
119 "block-spacing": 2, // Spaces after curly braced one liners
120 "brace-style": [2, "1tbs", {"allowSingleLine": true}], // Opening curly brace with statement, else on same line as closing
121 "camelcase": [2, {"properties": "never"}], // Use camelcase for variables only not properties
122 "comma-spacing": [2, {"before": false, "after": true}], // Commas should be attached to preceding var/param
123 "comma-style": [2, "last"], // Comma, separated lists attach comma to preceding element
124 "computed-property-spacing": [2, "never"], // No spaces inside property accessors
125 "consistent-this": 0, // With es6 arrows this shouldn't be used as frequently
126 "eol-last": 2, // Require new line as last line in file
127 "func-names": 0, // Function expressions should be named
128 "func-style": [1, "expression", {"allowArrowFunctions": true}], // Prefer functions to be declared first
129 "id-length":[2, {"min": 3, "properties": "never", "exceptions": ["e", "g", "fn", "n", "p", "r", "t", "u"]}], // Keep property names at sane length
130 "id-match": 0, // Name things whatevs
131 "indent": [2, 2], // Two spaces indentation!
132 "jsx-quotes": [2, "prefer-single"],
133 "key-spacing": [2, {"beforeColon": false, "afterColon": true}], // Space on key for object
134 "keyword-spacing": 2, // Space before keywords
135 "linebreak-style": [2, "unix"], // Unix style line breaks
136 "lines-around-comment": 0, // Comments next to code, ehhh whatevs
137 "max-depth": [1, 4], // Let's not get toooooo deep
138 "max-len": [1, 80, 4], // Let's aim for 80 character lines but no biggie
139 "max-nested-callbacks": [1, 3], // We shouldn't need call backs when having Promises but "jic"
140 "max-params": [1, 3], // Any more than 3 params and we should just use "rest" or "spread"
141 "max-statements": 0, // Who cares how many statments are in a function
142 "new-cap": 2, // Constructors should start with capitals
143 "new-parens": 2, // Constructors should be declared with parens
144 "newline-after-var": [2, "always"], // Separate declarations from rest of code
145 "no-array-constructor": 2, // Use braces not Array constructor
146 "no-bitwise": 2, // && or ||
147 "no-continue": 1,// Try not to use continues
148 "no-inline-comments": 2, // These are sloppy, docs should provide all explanation
149 "no-lonely-if": 2, // Instead of if inside else, use else if
150 "no-mixed-spaces-and-tabs": 2, // You can get with this or you can get with that
151 "no-multiple-empty-lines": [2, {"max": 3}], // Only 3 blank lines
152 "no-negated-condition": 2, // Don't invert, just switch effect clauses
153 "no-nested-ternary": 2, // ARE YOU CRAY CRAY FOR THE REAL REAL NOT FOR THE PLAY PLAY??
154 "no-new-object": 2, // Don't invoke Object constructor
155 "no-plusplus": 0, // I quite like ++ and --
156 "no-restricted-syntax": 0, // Nah
157 "no-spaced-func": 2, // Attach parens to function call
158 "no-ternary": 0, // Ternary is good
159 "no-trailing-spaces": 2,
160 "no-underscore-dangle": 2, // Underscore before not after
161 "no-unneeded-ternary": [2, { "defaultAssignment": false }], // Don't use ternary to assing boolean
162 "object-curly-spacing": [2, "never"], // No spaces on objects
163 "one-var": [2, "always"], // Comma delimit variables
164 "operator-assignment": [2, "always"], // Shorten opeartor assignments
165 "operator-linebreak":[2, "after"] , // Operator before next element
166 "padded-blocks": [2, "never"], // Concise and compact blocks
167 "quote-props": [2, "consistent"], // Don't quote object properties
168 "quotes": [2, "backtick"], // Backticks only for strings
169 "require-jsdoc": [2, {"require":{"FunctionDeclaration": true, "MethodDefinition": true, "ClassDeclaration": false}}], // JSDOC is good
170 "semi-spacing": 2, // func; not func ;
171 "semi": 2, // Ya need semi colons
172 "sort-vars": 0, // Don't alphabetize vars
173 "space-before-blocks": 2, // Yes
174 "space-before-function-paren": 2, // Yup
175 "space-in-parens": 2, // No space in parens
176 "space-infix-ops": 2, // space before and after operators
177 "space-unary-ops": 0, // We shouldn't be using theme
178 "spaced-comment": 2, // Yup
179 "wrap-regex": 2, // Wrap regex in parens
180 // ES6 //
181 "arrow-body-style": [2, "always"], // Wrap arrow funcs with braces, unless one-liners
182 "arrow-parens": [2, "always"], // Always wrap params for arrow func in parens
183 "arrow-spacing": [2, {"before": true, "after": true}], // Space before and after fat arrow
184 "constructor-super": 2, // Derived classes must use super, non derived must not
185 "generator-star-spacing": 2, // Consistent use of * for generators
186 "no-class-assign": 2, // Don't overwrite class
187 "no-confusing-arrow": 2, // Don't misuse fat arrow
188 "no-const-assign": 2, // Can't assign value to const after declaration
189 "no-dupe-class-members": 2, // No class props or funcs can have same name
190 "no-this-before-super": 2, // Handle derived class before referencing this scope
191 "no-var": 2, // Use const or let instead of var
192 "object-shorthand": 2, // Must use object shorthand
193 "prefer-arrow-callback": 1, // Use fat arrow over function call
194 "prefer-const": 2, // If value is declared and never changed, use const yea?
195 "prefer-reflect": 0, // Don't worry about reflect API
196 "prefer-spread": 2, // Use ... instead of .apply()
197 "prefer-template": 2, // Template string instead of concat
198 "require-yield": 1, // Generators need a yield
199 }
200}