UNPKG

3.28 kBJavaScriptView Raw
1"use strict";
2
3module.exports = {
4 rules: {
5 // enforce spacing inside array brackets
6 "array-bracket-spacing": 2,
7
8 // enforce one true brace style
9 "brace-style": [2, "1tbs"],
10
11 // enforce spacing after comma
12 "comma-spacing": [2, { before: false, after: true }],
13
14 // enforce one true comma style
15 "comma-style": [2, "last"],
16
17 // disallow spacing inside of computed properties
18 "computed-property-spacing": [2, "never"],
19
20 // enforce consistent naming when capturing the execution context
21 "consistent-this": [2, "self"],
22
23 // enforce one new line at the end of a file
24 "eol-last": 2,
25
26 // recommend function expressions to have names
27 "func-names": 1,
28
29 // enforce tabs and widths
30 indent: [2, "tab", { SwitchCase: 1 }],
31
32 // prefer double quotes in jsx
33 "jsx-quotes": 2,
34
35 // enforces spacing between keys and values in object literal properties
36 "key-spacing": [2, { beforeColon: false, afterColon: true }],
37
38 // require spaces after keywords
39 "keyword-spacing": [2, { after: true }],
40
41 // enforce linebreak style
42 "linebreak-style": 2,
43
44 // require a capital letter for constructors
45 "new-cap": 2,
46
47 // disallow use of the Array constructor
48 "no-array-constructor": 2,
49
50 // disallow use of bitwise operators
51 "no-bitwise": 2,
52
53 // disallow empty blocks
54 "no-empty": 2,
55
56 // disallow extra parentheses
57 "no-extra-parens": 2,
58
59 // disallow the use of irregular whitespace
60 "no-irregular-whitespace": 2,
61
62 // disallow the mixing of spaces and tabs
63 "no-mixed-spaces-and-tabs": 2,
64
65 // disallow mutliple empty lines and only one new line at the end
66 "no-multiple-empty-lines": [2, { max: 2, maxEOF: 1 }],
67
68 // disallow the use of nested ternaries
69
70 "no-nested-ternary": 2,
71 // disallow the use of the Object constructor
72
73 "no-new-object": 2,
74 // disallow the use of spaces in function calls
75
76 "no-spaced-func": 2,
77
78 // disallow trailing spaces
79 "no-trailing-spaces": 2,
80
81 // disallow the use of Boolean literlas in conditional expressions
82 // also, prefer `a || b` over `a ? a : b`
83 "no-unneeded-ternary": [2, { defaultAssignment: false }],
84
85 // disallow whitespace before properites
86 "no-whitespace-before-property": 2,
87
88 // enforce spacing before and after curly braces
89 "object-curly-spacing": [2, "always"],
90
91 // allow just one var statement per function
92 "one-var": [2, "never"],
93
94 // require a new line around var declaration
95 "one-var-declaration-per-line": [2, "always"],
96
97 // enforce operators to be placed after linebreaks
98 "operator-linebreak": [2, "after"],
99
100 // require quotes around object literal property names
101 "quote-props": [2, "as-needed", { keywords: true }],
102
103 // enforce quote style
104 quotes: [2, "double"],
105
106 // require spacing before and after semicolons
107 "semi-spacing": [2, { before: false, after: true }],
108
109 // require the use of semicolons
110 semi: [2, "always"],
111
112 // require the use of space before blocks
113 "space-before-blocks": 2,
114
115 // require the use of space before function parentheses
116 "space-before-function-paren": [2, { anonymous: "always", named: "never" }],
117
118 // disallow spaces in parentheses
119 "space-in-parens": 2,
120
121 // requiring spacing of infix operations
122 "space-infix-ops": 2,
123
124 // require spacing after unary operations
125 "space-unary-ops": 2,
126 },
127};