-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.yml
executable file
·110 lines (110 loc) · 2.42 KB
/
.eslintrc.yml
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
env:
browser: true
es6: true
node: true
parserOptions:
ecmaVersion: 2020
extends: 'eslint:recommended'
rules:
# 'use strict';
strict:
- error
- global
# preference, some like 2
indent:
- warn
- 4
linebreak-style:
- warn
- unix
# double quotes?
# what are we, ecma3?
quotes:
- warn
- single
# ASI exists, but it does weird things
# to work, most ASI hazards are obvious:
# such as: IIFE, "tagged" template ones.
# but ECMA and TC39 are going to be making grammar
# decisions that may add more in the future.
semi:
- error
- always
no-console:
- warn
- allow:
- error
# use {}
no-new-object:
- warn
# use []
no-array-constructor:
- warn
# why....????
no-new-func:
- error
# var x = 'x', y = { x, someotherprop: 'y', } // y.x = 'x'
object-shorthand:
- warn
# only wrap property names in quotes for names that need it
# eg 'asd-xyz': 'value' NOT 'asd': value; should just be asd: 'value'
quote-props:
- error
- as-needed
# it's EXTREMELY unlikely you meant
# to not return in an array prototype like map
array-callback-return:
- error
# we are ES6, not ES5. use `blah ${var}` over 'blah ' + var
prefer-template:
- warn
# this SHOULD be an error...
# basically throw error if you try to use invalid escapes
# e.g. \i or \s or \" in a single-quote string, etc
no-useless-escape:
- error
# this is the crockford way
# e.g. (() => {}())
wrap-iife:
- error
# sometimes it's needed, but it should be avoided
# don't use for (statement)
# use something like arr.map, arr.forEach Object.keys(obj).map...so on
no-iterator:
- warn
# use ...args over old fashion way of handling variadics
prefer-rest-params:
- error
# es6 style, easier than apply, etc
# console.log(...someArr)
prefer-spread:
- error
# let { foo, bar } = obj;
prefer-destructuring:
- warn
# they are already kind of weird
# please don't nest them
no-nested-ternary:
- error
# if {
# }
# else {
# }
brace-style:
- error
- stroustrup
# // start comment with a space
spaced-comment:
- error
# function() {}; not function(){}
space-before-blocks:
- error
# if (), not if(), function() not function ()
keyword-spacing:
- error
# end all items with a comma
# including last!!!!!!!!!!
# { x: 'x', y: 'y', }
comma-dangle:
- error
- always-multiline