Skip to content

Commit 333b327

Browse files
committed
ruleset update
1 parent dad2d2c commit 333b327

File tree

4 files changed

+253
-249
lines changed

4 files changed

+253
-249
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
_) _)
99
```
1010

11+
## **Byte-Sized JavaScript Coding Standards** (*v0.5.0*)
12+
13+
* Updated the rule definitions to be stricter. — Now violations result in **errors**, not *warnings*.
14+
1115
## **Byte-Sized JavaScript Coding Standards** (*v0.4.0*)
1216

1317
* Added Node.JS-specific rules that do not depend on a transpiler (like Babel).

index.js

Lines changed: 123 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -50,205 +50,205 @@ module.exports = {
5050
'rules': {
5151

5252
/* Possible Errors */
53-
'comma-dangle': [ 1, 'never' ],
54-
'no-cond-assign': [ 1, 'except-parens' ],
53+
'comma-dangle': [ 2, 'never' ],
54+
'no-cond-assign': [ 2, 'except-parens' ],
5555
'no-console': 0,
56-
'no-constant-condition': 1,
57-
'no-control-regex': 1,
58-
'no-debugger': 1,
59-
'no-dupe-args': 1,
60-
'no-dupe-keys': 1,
56+
'no-constant-condition': 2,
57+
'no-control-regex': 2,
58+
'no-debugger': 2,
59+
'no-dupe-args': 2,
60+
'no-dupe-keys': 2,
6161
'no-duplicate-case': 0,
62-
'no-empty-character-class': 1,
63-
'no-empty': 1,
64-
'no-ex-assign': 1,
65-
'no-extra-boolean-cast': 1,
62+
'no-empty-character-class': 2,
63+
'no-empty': 2,
64+
'no-ex-assign': 2,
65+
'no-extra-boolean-cast': 2,
6666
'no-extra-parens': 0,
67-
'no-extra-semi': 1,
68-
'no-func-assign': 1,
69-
'no-inner-declarations': [ 1, 'functions' ],
70-
'no-invalid-regexp': 1,
71-
'no-irregular-whitespace': 1,
72-
'no-negated-in-lhs': 1,
73-
'no-obj-calls': 1,
74-
'no-regex-spaces': 1,
67+
'no-extra-semi': 2,
68+
'no-func-assign': 2,
69+
'no-inner-declarations': [ 2, 'functions' ],
70+
'no-invalid-regexp': 2,
71+
'no-irregular-whitespace': 2,
72+
'no-negated-in-lhs': 2,
73+
'no-obj-calls': 2,
74+
'no-regex-spaces': 2,
7575
'no-reserved-keys': 0,
76-
'no-sparse-arrays': 1,
77-
'no-unexpected-multiline': 1,
78-
'no-unreachable': 1,
79-
'use-isnan': 1,
80-
'valid-jsdoc': 1,
81-
'valid-typeof': 1,
76+
'no-sparse-arrays': 2,
77+
'no-unexpected-multiline': 2,
78+
'no-unreachable': 2,
79+
'use-isnan': 2,
80+
'valid-jsdoc': 2,
81+
'valid-typeof': 2,
8282

8383
/* Best Practices */
8484
'accessor-pairs': 0,
8585
'block-scoped-var': 0, // see Babel section
8686
'complexity': 0,
87-
'consistent-return': 1,
88-
'curly': [ 1, 'all' ],
87+
'consistent-return': 2,
88+
'curly': [ 2, 'all' ],
8989
'default-case': 0,
90-
'dot-notation': [ 1, {
90+
'dot-notation': [ 2, {
9191
'allowKeywords': true,
9292
'allowPattern': ''
9393
} ],
94-
'dot-location': [ 1, 'property' ],
95-
'eqeqeq': 1,
94+
'dot-location': [ 2, 'property' ],
95+
'eqeqeq': 2,
9696
'guard-for-in': 0,
97-
'no-alert': 1,
98-
'no-caller': 1,
99-
'no-div-regex': 1,
100-
'no-else-return': 1,
97+
'no-alert': 2,
98+
'no-caller': 2,
99+
'no-div-regex': 2,
100+
'no-else-return': 2,
101101
'no-eq-null': 0,
102-
'no-eval': 1,
103-
'no-extend-native': 1,
104-
'no-extra-bind': 1,
102+
'no-eval': 2,
103+
'no-extend-native': 2,
104+
'no-extra-bind': 2,
105105
'no-fallthrough': 0,
106-
'no-floating-decimal': 1,
107-
'no-implied-eval': 1,
108-
'no-iterator': 1,
109-
'no-labels': 1,
110-
'no-lone-blocks': 1,
111-
'no-loop-func': 1,
112-
'no-multi-spaces': 1,
113-
'no-multi-str': 1,
114-
'no-native-reassign': 1,
115-
'no-new-func': 1,
116-
'no-new-wrappers': 1,
117-
'no-new': 1,
118-
'no-octal-escape': 1,
119-
'no-octal': 1,
106+
'no-floating-decimal': 2,
107+
'no-implied-eval': 2,
108+
'no-iterator': 2,
109+
'no-labels': 2,
110+
'no-lone-blocks': 2,
111+
'no-loop-func': 2,
112+
'no-multi-spaces': 2,
113+
'no-multi-str': 2,
114+
'no-native-reassign': 2,
115+
'no-new-func': 2,
116+
'no-new-wrappers': 2,
117+
'no-new': 2,
118+
'no-octal-escape': 2,
119+
'no-octal': 2,
120120
'no-param-reassign': 0,
121121
'no-process-env': 0,
122-
'no-proto': 1,
123-
'no-redeclare': 1,
124-
'no-return-assign': 1,
125-
'no-script-url': 1,
126-
'no-self-compare': 1,
127-
'no-sequences': 1,
128-
'no-throw-literal': 1,
122+
'no-proto': 2,
123+
'no-redeclare': 2,
124+
'no-return-assign': 2,
125+
'no-script-url': 2,
126+
'no-self-compare': 2,
127+
'no-sequences': 2,
128+
'no-throw-literal': 2,
129129
'no-unused-expressions': 0,
130130
'no-void': 0,
131-
'no-warning-comments': [ 1, {
131+
'no-warning-comments': [ 2, {
132132
'terms': [ 'todo', 'tofix' ],
133133
'location': 'start'
134134
} ],
135-
'no-with': 1,
136-
'radix': 1,
137-
'vars-on-top': 1,
138-
'wrap-iife': [ 1, 'inside' ],
139-
'yoda': [ 1, 'never' ],
135+
'no-with': 2,
136+
'radix': 2,
137+
'vars-on-top': 2,
138+
'wrap-iife': [ 2, 'inside' ],
139+
'yoda': [ 2, 'never' ],
140140

141141
/* Strict Mode */
142-
'strict': [ 1, 'never' ],
142+
'strict': [ 2, 'never' ],
143143

144144
/* Variables */
145145
'no-catch-shadow': 0,
146-
'no-delete-var': 1,
147-
'no-label-var': 1,
148-
'no-shadow-restricted-names': 1,
149-
'no-shadow': 1,
150-
'no-undef-init': 1,
151-
'no-undef': 1,
152-
'no-undefined': 1,
153-
'no-unused-vars': [ 1, {
146+
'no-delete-var': 2,
147+
'no-label-var': 2,
148+
'no-shadow-restricted-names': 2,
149+
'no-shadow': 2,
150+
'no-undef-init': 2,
151+
'no-undef': 2,
152+
'no-undefined': 2,
153+
'no-unused-vars': [ 2, {
154154
'vars': 'local',
155155
'args': 'after-used'
156156
} ],
157-
'no-use-before-define': 1,
157+
'no-use-before-define': 2,
158158

159159
/* Node.js */
160-
'handle-callback-err': 1,
161-
'no-mixed-requires': 1,
162-
'no-new-require': 1,
163-
'no-path-concat': 1,
164-
'no-process-exit': 1,
165-
'no-restricted-modules': [ 1, '' ], // add any unwanted Node.js core modules
166-
'no-sync': 1,
160+
'handle-callback-err': 2,
161+
'no-mixed-requires': 2,
162+
'no-new-require': 2,
163+
'no-path-concat': 2,
164+
'no-process-exit': 2,
165+
'no-restricted-modules': [ 2, '' ], // add any unwanted Node.js core modules
166+
'no-sync': 2,
167167

168168
/* Stylistic Issues */
169-
'array-bracket-spacing': [ 1, 'always' ],
170-
'brace-style': [ 1, '1tbs', {
169+
'array-bracket-spacing': [ 2, 'always' ],
170+
'brace-style': [ 2, '1tbs', {
171171
'allowSingleLine': true
172172
} ],
173-
'camelcase': [ 1, {
173+
'camelcase': [ 2, {
174174
'properties': 'always'
175175
} ],
176-
'comma-spacing': [ 1, {
176+
'comma-spacing': [ 2, {
177177
'before': false,
178178
'after': true
179179
} ],
180-
'comma-style': [ 1, 'last' ],
180+
'comma-style': [ 2, 'last' ],
181181
'computed-property-spacing': 0,
182182
'consistent-this': 0,
183-
'eol-last': 1,
184-
'func-names': 1,
183+
'eol-last': 2,
184+
'func-names': 2,
185185
'func-style': 0,
186-
'indent': [ 1, 4 ],
187-
'key-spacing': [ 1, {
186+
'indent': [ 2, 4 ],
187+
'key-spacing': [ 2, {
188188
'beforeColon': false,
189189
'afterColon': true
190190
} ],
191191
'linebreak-style': 0,
192192
'max-nested-callbacks': [ 0, 3 ],
193193
'new-cap': 0, // see Babel section
194-
'new-parens': 1,
194+
'new-parens': 2,
195195
'newline-after-var': 0,
196-
'no-array-constructor': 1,
197-
'no-continue': 1,
196+
'no-array-constructor': 2,
197+
'no-continue': 2,
198198
'no-inline-comments': 0,
199-
'no-lonely-if': 1,
200-
'no-mixed-spaces-and-tabs': 1,
201-
'no-multiple-empty-lines': [ 1, {
199+
'no-lonely-if': 2,
200+
'no-mixed-spaces-and-tabs': 2,
201+
'no-multiple-empty-lines': [ 2, {
202202
'max': 1
203203
} ],
204204
'no-nested-ternary': 0,
205-
'no-new-object': 1,
206-
'no-spaced-func': 1,
205+
'no-new-object': 2,
206+
'no-spaced-func': 2,
207207
'no-ternary': 0,
208-
'no-trailing-spaces': 1,
208+
'no-trailing-spaces': 2,
209209
'no-underscore-dangle': 0,
210-
'no-unneeded-ternary': 1,
210+
'no-unneeded-ternary': 2,
211211
'object-curly-spacing': 0, // see Babel section
212-
'one-var': [ 1, 'never' ],
213-
'operator-assignment': [ 1, 'never' ],
212+
'one-var': [ 2, 'never' ],
213+
'operator-assignment': [ 2, 'never' ],
214214
'padded-blocks': [ 0, 'never' ],
215215
'quote-props': [ 0, 'as-needed' ],
216-
'quotes': [ 1, 'single' ],
217-
'semi-spacing': [ 1, {
216+
'quotes': [ 2, 'single' ],
217+
'semi-spacing': [ 2, {
218218
'before': false,
219219
'after': true
220220
} ],
221-
'semi': [ 1, 'always' ],
221+
'semi': [ 2, 'always' ],
222222
'sort-vars': 0,
223223
'space-after-keywords': 0,
224-
'space-before-blocks': [ 1, 'always' ],
225-
'space-before-function-paren': [ 1, 'never' ],
226-
'space-in-parens': [ 1, 'always' ],
227-
'space-infix-ops': 1,
228-
'keyword-spacing': 1,
224+
'space-before-blocks': [ 2, 'always' ],
225+
'space-before-function-paren': [ 2, 'never' ],
226+
'space-in-parens': [ 2, 'always' ],
227+
'space-infix-ops': 2,
228+
'keyword-spacing': 2,
229229
'space-unary-ops': 0,
230-
'spaced-comment': [ 1, 'always' ],
231-
'wrap-regex': 1,
230+
'spaced-comment': [ 2, 'always' ],
231+
'wrap-regex': 2,
232232

233233
/* ECMAScript 6 */
234-
'constructor-super': 1,
235-
'generator-star-spacing': [ 1, 'after' ],
236-
'no-this-before-super': 1,
237-
'no-var': 1,
238-
'object-shorthand': [ 1, 'always' ],
239-
'prefer-const': 1,
234+
'constructor-super': 2,
235+
'generator-star-spacing': [ 2, 'after' ],
236+
'no-this-before-super': 2,
237+
'no-var': 2,
238+
'object-shorthand': [ 2, 'always' ],
239+
'prefer-const': 2,
240240

241241
/* Legacy */
242242
'max-depth': [ 0, 3 ],
243-
'max-len': [ 1, 121, 2 ],
243+
'max-len': [ 2, 121, 2 ],
244244
'max-params': 0,
245245
'max-statements': 0,
246-
'no-bitwise': 1,
247-
'no-plusplus': 1,
246+
'no-bitwise': 2,
247+
'no-plusplus': 2,
248248

249249
/* Babel */
250-
'babel/new-cap': 1,
251-
'babel/object-curly-spacing': [ 1, 'always' ]
250+
'babel/new-cap': 2,
251+
'babel/object-curly-spacing': [ 2, 'always' ]
252252
},
253253
'globals': {
254254
'Promise': false

0 commit comments

Comments
 (0)