UNPKG

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