Skip to content

Commit e1e2f64

Browse files
authored
Configs: Use 'warn' instead of 'error' in deprecated-X and all configs (#262)
Unlike `slim` where using an unavailable feature will cause an error, these configs should allow users to remove deprecated code over time. Fixes #254
1 parent c5aa916 commit e1e2f64

File tree

2 files changed

+102
-102
lines changed

2 files changed

+102
-102
lines changed

Changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* New config: `recommended` just includes `variable-pattern` rule (Ed Sanders)
66
* New config: `all` covers all usages of jQuery methods and utils (Ed Sanders)
77
* New config: Create a `deprecated-X.X` config for every minor release (Ed Sanders)
8+
* Configs: Use 'warn' instead of 'error' in `deprecated-X` and `all` configs (Ed Sanders)
89
* New rule: `no-jquery-constructor` (Ed Sanders)
910

1011
@@ -57,7 +58,6 @@
5758
* Rule fix: `no-global-selector`; add `allowIds` option to allow global selector by ID (Adam Roses Wight)
5859
* Rule fix: `no-event-shorthand`; add `allowAjaxEvents` option and use in `deprecated-3.3` (Ed Sanders)
5960

60-
6161
6262
* Docs: Avoid duplicating name in "Prefer..." sentence (Ed Sanders)
6363
* Docs: Build lists in README.md automatically (Ed Sanders)

src/index.js

Lines changed: 101 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -131,35 +131,35 @@ module.exports = {
131131
extends: 'plugin:no-jquery/deprecated-3.4',
132132
rules: {
133133
// Pass empty options here to override options set in deprecated-3.3
134-
'no-jquery/no-event-shorthand': [ 'error', {} ],
135-
'no-jquery/no-trim': 'error'
134+
'no-jquery/no-event-shorthand': [ 'warn', {} ],
135+
'no-jquery/no-trim': 'warn'
136136
}
137137
},
138138
'deprecated-3.4': {
139139
extends: 'plugin:no-jquery/deprecated-3.3',
140140
rules: {
141-
'no-jquery/no-sizzle': [ 'error', { allowPositional: false, allowOther: true } ]
141+
'no-jquery/no-sizzle': [ 'warn', { allowPositional: false, allowOther: true } ]
142142
}
143143
},
144144
'deprecated-3.3': {
145145
extends: 'plugin:no-jquery/deprecated-3.2',
146146
rules: {
147-
'no-jquery/no-camel-case': 'error',
148-
'no-jquery/no-event-shorthand': [ 'error', { allowAjaxEvents: true } ],
149-
'no-jquery/no-is-function': 'error',
150-
'no-jquery/no-is-numeric': 'error',
151-
'no-jquery/no-is-window': 'error',
152-
'no-jquery/no-now': 'error',
153-
'no-jquery/no-proxy': 'error',
154-
'no-jquery/no-type': 'error'
147+
'no-jquery/no-camel-case': 'warn',
148+
'no-jquery/no-event-shorthand': [ 'warn', { allowAjaxEvents: true } ],
149+
'no-jquery/no-is-function': 'warn',
150+
'no-jquery/no-is-numeric': 'warn',
151+
'no-jquery/no-is-window': 'warn',
152+
'no-jquery/no-now': 'warn',
153+
'no-jquery/no-proxy': 'warn',
154+
'no-jquery/no-type': 'warn'
155155
}
156156
},
157157
'deprecated-3.2': {
158158
extends: 'plugin:no-jquery/deprecated-3.1',
159159
rules: {
160-
'no-jquery/no-hold-ready': 'error',
161-
'no-jquery/no-is-array': 'error',
162-
'no-jquery/no-node-name': 'error'
160+
'no-jquery/no-hold-ready': 'warn',
161+
'no-jquery/no-is-array': 'warn',
162+
'no-jquery/no-node-name': 'warn'
163163
}
164164
},
165165
'deprecated-3.1': {
@@ -168,12 +168,12 @@ module.exports = {
168168
'deprecated-3.0': {
169169
extends: 'plugin:no-jquery/deprecated-2.2',
170170
rules: {
171-
'no-jquery/no-bind': 'error',
172-
'no-jquery/no-delegate': 'error',
173-
'no-jquery/no-fx-interval': 'error',
174-
'no-jquery/no-parse-json': 'error',
175-
'no-jquery/no-ready-shorthand': 'error',
176-
'no-jquery/no-unique': 'error'
171+
'no-jquery/no-bind': 'warn',
172+
'no-jquery/no-delegate': 'warn',
173+
'no-jquery/no-fx-interval': 'warn',
174+
'no-jquery/no-parse-json': 'warn',
175+
'no-jquery/no-ready-shorthand': 'warn',
176+
'no-jquery/no-unique': 'warn'
177177
}
178178
},
179179
'deprecated-2.2': {
@@ -194,35 +194,35 @@ module.exports = {
194194
'deprecated-1.10': {
195195
extends: 'plugin:no-jquery/deprecated-1.9',
196196
rules: {
197-
'no-jquery/no-context-prop': 'error'
197+
'no-jquery/no-context-prop': 'warn'
198198
}
199199
},
200200
'deprecated-1.9': {
201201
extends: 'plugin:no-jquery/deprecated-1.8',
202202
rules: {
203-
'no-jquery/no-support': 'error'
203+
'no-jquery/no-support': 'warn'
204204
}
205205
},
206206
'deprecated-1.8': {
207207
extends: 'plugin:no-jquery/deprecated-1.7',
208208
rules: {
209-
'no-jquery/no-and-self': 'error',
209+
'no-jquery/no-and-self': 'warn',
210210
// FIXME: `deferred.pipe()`
211-
'no-jquery/no-error-shorthand': 'error',
212-
'no-jquery/no-load-shorthand': 'error',
213-
'no-jquery/no-on-ready': 'error',
214-
'no-jquery/no-size': 'error',
211+
'no-jquery/no-error-shorthand': 'warn',
212+
'no-jquery/no-load-shorthand': 'warn',
213+
'no-jquery/no-on-ready': 'warn',
214+
'no-jquery/no-size': 'warn',
215215
// FIXME: `$(...).toggle(fn,fn) (excluding https://api.jquery.com/toggle/)
216-
'no-jquery/no-unload-shorthand': 'error'
216+
'no-jquery/no-unload-shorthand': 'warn'
217217
}
218218
},
219219
'deprecated-1.7': {
220220
extends: 'plugin:no-jquery/deprecated-1.6',
221221
rules: {
222222
// FIXME: `deferred.isRejected()/isResolved()`
223-
'no-jquery/no-live': 'error',
224-
'no-jquery/no-sub': 'error',
225-
'no-jquery/no-selector-prop': 'error'
223+
'no-jquery/no-live': 'warn',
224+
'no-jquery/no-sub': 'warn',
225+
'no-jquery/no-selector-prop': 'warn'
226226
}
227227
},
228228
'deprecated-1.6': {
@@ -237,8 +237,8 @@ module.exports = {
237237
'deprecated-1.3': {
238238
extends: 'plugin:no-jquery/deprecated-1.2',
239239
rules: {
240-
'no-jquery/no-box-model': 'error',
241-
'no-jquery/no-browser': 'error'
240+
'no-jquery/no-box-model': 'warn',
241+
'no-jquery/no-browser': 'warn'
242242
}
243243
},
244244
'deprecated-1.2': {
@@ -251,80 +251,80 @@ module.exports = {
251251
// Use this config to disallow all usage of jQuery
252252
all: {
253253
rules: {
254-
'no-jquery/no-other-methods': 'error',
255-
'no-jquery/no-other-utils': 'error',
256-
'no-jquery/no-jquery-constructor': 'error',
254+
'no-jquery/no-other-methods': 'warn',
255+
'no-jquery/no-other-utils': 'warn',
256+
'no-jquery/no-jquery-constructor': 'warn',
257257

258258
// methods
259-
'no-jquery/no-animate': 'error',
260-
'no-jquery/no-bind': 'error',
261-
'no-jquery/no-class': 'error',
262-
'no-jquery/no-closest': 'error',
263-
'no-jquery/no-delegate': 'error',
264-
'no-jquery/no-each-collection': 'error',
265-
'no-jquery/no-event-shorthand': 'error',
266-
'no-jquery/no-fade': 'error',
267-
'no-jquery/no-find-collection': 'error',
268-
'no-jquery/no-has': 'error',
269-
'no-jquery/no-html': 'error',
270-
'no-jquery/no-is': 'error',
271-
'no-jquery/no-live': 'error',
272-
'no-jquery/no-load': 'error',
273-
'no-jquery/no-map-collection': 'error',
274-
'no-jquery/no-parent': 'error',
275-
'no-jquery/no-parents': 'error',
276-
'no-jquery/no-ready-shorthand': 'error',
277-
'no-jquery/no-serialize': 'error',
278-
'no-jquery/no-size': 'error',
279-
'no-jquery/no-slide': 'error',
280-
'no-jquery/no-trigger': 'error',
281-
'no-jquery/no-val': 'error',
282-
'no-jquery/no-visibility': 'error',
283-
'no-jquery/no-wrap': 'error',
259+
'no-jquery/no-animate': 'warn',
260+
'no-jquery/no-bind': 'warn',
261+
'no-jquery/no-class': 'warn',
262+
'no-jquery/no-closest': 'warn',
263+
'no-jquery/no-delegate': 'warn',
264+
'no-jquery/no-each-collection': 'warn',
265+
'no-jquery/no-event-shorthand': 'warn',
266+
'no-jquery/no-fade': 'warn',
267+
'no-jquery/no-find-collection': 'warn',
268+
'no-jquery/no-has': 'warn',
269+
'no-jquery/no-html': 'warn',
270+
'no-jquery/no-is': 'warn',
271+
'no-jquery/no-live': 'warn',
272+
'no-jquery/no-load': 'warn',
273+
'no-jquery/no-map-collection': 'warn',
274+
'no-jquery/no-parent': 'warn',
275+
'no-jquery/no-parents': 'warn',
276+
'no-jquery/no-ready-shorthand': 'warn',
277+
'no-jquery/no-serialize': 'warn',
278+
'no-jquery/no-size': 'warn',
279+
'no-jquery/no-slide': 'warn',
280+
'no-jquery/no-trigger': 'warn',
281+
'no-jquery/no-val': 'warn',
282+
'no-jquery/no-visibility': 'warn',
283+
'no-jquery/no-wrap': 'warn',
284284

285285
// Utils
286-
'no-jquery/no-ajax': 'error',
287-
'no-jquery/no-camel-case': 'error',
288-
'no-jquery/no-contains': 'error',
289-
'no-jquery/no-deferred': 'error',
290-
'no-jquery/no-each-util': 'error',
291-
'no-jquery/no-error': 'error',
292-
'no-jquery/no-extend': 'error',
293-
'no-jquery/no-find-util': 'error',
294-
'no-jquery/no-global-eval': 'error',
295-
'no-jquery/no-grep': 'error',
296-
'no-jquery/no-hold-ready': 'error',
297-
'no-jquery/no-in-array': 'error',
298-
'no-jquery/no-is-array': 'error',
299-
'no-jquery/no-is-empty-object': 'error',
300-
'no-jquery/no-is-function': 'error',
301-
'no-jquery/no-is-numeric': 'error',
302-
'no-jquery/no-is-plain-object': 'error',
303-
'no-jquery/no-is-window': 'error',
304-
'no-jquery/no-map-util': 'error',
305-
'no-jquery/no-merge': 'error',
306-
'no-jquery/no-node-name': 'error',
307-
'no-jquery/no-noop': 'error',
308-
'no-jquery/no-now': 'error',
309-
'no-jquery/no-param': 'error',
310-
'no-jquery/no-parse-html': 'error',
311-
'no-jquery/no-parse-json': 'error',
312-
'no-jquery/no-parse-xml': 'error',
313-
'no-jquery/no-proxy': 'error',
314-
'no-jquery/no-trim': 'error',
315-
'no-jquery/no-type': 'error',
316-
'no-jquery/no-unique': 'error',
317-
'no-jquery/no-when': 'error',
286+
'no-jquery/no-ajax': 'warn',
287+
'no-jquery/no-camel-case': 'warn',
288+
'no-jquery/no-contains': 'warn',
289+
'no-jquery/no-deferred': 'warn',
290+
'no-jquery/no-each-util': 'warn',
291+
'no-jquery/no-error': 'warn',
292+
'no-jquery/no-extend': 'warn',
293+
'no-jquery/no-find-util': 'warn',
294+
'no-jquery/no-global-eval': 'warn',
295+
'no-jquery/no-grep': 'warn',
296+
'no-jquery/no-hold-ready': 'warn',
297+
'no-jquery/no-in-array': 'warn',
298+
'no-jquery/no-is-array': 'warn',
299+
'no-jquery/no-is-empty-object': 'warn',
300+
'no-jquery/no-is-function': 'warn',
301+
'no-jquery/no-is-numeric': 'warn',
302+
'no-jquery/no-is-plain-object': 'warn',
303+
'no-jquery/no-is-window': 'warn',
304+
'no-jquery/no-map-util': 'warn',
305+
'no-jquery/no-merge': 'warn',
306+
'no-jquery/no-node-name': 'warn',
307+
'no-jquery/no-noop': 'warn',
308+
'no-jquery/no-now': 'warn',
309+
'no-jquery/no-param': 'warn',
310+
'no-jquery/no-parse-html': 'warn',
311+
'no-jquery/no-parse-json': 'warn',
312+
'no-jquery/no-parse-xml': 'warn',
313+
'no-jquery/no-proxy': 'warn',
314+
'no-jquery/no-trim': 'warn',
315+
'no-jquery/no-type': 'warn',
316+
'no-jquery/no-unique': 'warn',
317+
'no-jquery/no-when': 'warn',
318318

319319
// Method+utils
320-
'no-jquery/no-attr': 'error',
321-
'no-jquery/no-clone': 'error',
322-
'no-jquery/no-css': 'error',
323-
'no-jquery/no-data': 'error',
324-
'no-jquery/no-filter': 'error',
325-
'no-jquery/no-prop': 'error',
326-
'no-jquery/no-sub': 'error',
327-
'no-jquery/no-text': 'error'
320+
'no-jquery/no-attr': 'warn',
321+
'no-jquery/no-clone': 'warn',
322+
'no-jquery/no-css': 'warn',
323+
'no-jquery/no-data': 'warn',
324+
'no-jquery/no-filter': 'warn',
325+
'no-jquery/no-prop': 'warn',
326+
'no-jquery/no-sub': 'warn',
327+
'no-jquery/no-text': 'warn'
328328

329329
}
330330
}

0 commit comments

Comments
 (0)