Skip to content

Commit e45738e

Browse files
authored
Introduce eslint-plugin-jquery (#19690)
Introduce the plugin that allows us to gradually forbid jQuery code. I've enabled all rules that already pass. Next step will be to go through each rule and fix the issues by using native DOM equivalents, which I think can be done in separate PRs, but if prefered I could also start here.
1 parent 368baf9 commit e45738e

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

.eslintrc

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ plugins:
1313
- eslint-plugin-import
1414
- eslint-plugin-vue
1515
- eslint-plugin-html
16+
- eslint-plugin-jquery
1617

1718
extends:
1819
- plugin:vue/recommended
@@ -140,6 +141,55 @@ rules:
140141
import/unambiguous: [0]
141142
indent: [2, 2, {SwitchCase: 1}]
142143
init-declarations: [0]
144+
jquery/no-ajax-events: [2]
145+
jquery/no-ajax: [0]
146+
jquery/no-animate: [2]
147+
jquery/no-attr: [0]
148+
jquery/no-bind: [2]
149+
jquery/no-class: [0]
150+
jquery/no-clone: [2]
151+
jquery/no-closest: [0]
152+
jquery/no-css: [0]
153+
jquery/no-data: [0]
154+
jquery/no-deferred: [2]
155+
jquery/no-delegate: [2]
156+
jquery/no-each: [0]
157+
jquery/no-extend: [2]
158+
jquery/no-fade: [0]
159+
jquery/no-filter: [0]
160+
jquery/no-find: [0]
161+
jquery/no-global-eval: [2]
162+
jquery/no-grep: [2]
163+
jquery/no-has: [2]
164+
jquery/no-hide: [0]
165+
jquery/no-html: [0]
166+
jquery/no-in-array: [2]
167+
jquery/no-is-array: [2]
168+
jquery/no-is-function: [2]
169+
jquery/no-is: [0]
170+
jquery/no-load: [2]
171+
jquery/no-map: [0]
172+
jquery/no-merge: [2]
173+
jquery/no-param: [2]
174+
jquery/no-parent: [0]
175+
jquery/no-parents: [0]
176+
jquery/no-parse-html: [2]
177+
jquery/no-prop: [0]
178+
jquery/no-proxy: [2]
179+
jquery/no-ready: [0]
180+
jquery/no-serialize: [2]
181+
jquery/no-show: [0]
182+
jquery/no-size: [2]
183+
jquery/no-sizzle: [0]
184+
jquery/no-slide: [0]
185+
jquery/no-submit: [0]
186+
jquery/no-text: [0]
187+
jquery/no-toggle: [0]
188+
jquery/no-trigger: [0]
189+
jquery/no-trim: [2]
190+
jquery/no-val: [0]
191+
jquery/no-when: [2]
192+
jquery/no-wrap: [2]
143193
key-spacing: [2]
144194
keyword-spacing: [2]
145195
line-comment-position: [0]

package-lock.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"eslint": "8.15.0",
4949
"eslint-plugin-html": "6.2.0",
5050
"eslint-plugin-import": "2.26.0",
51+
"eslint-plugin-jquery": "1.5.1",
5152
"eslint-plugin-unicorn": "42.0.0",
5253
"eslint-plugin-vue": "8.7.1",
5354
"jest": "28.1.0",

0 commit comments

Comments
 (0)