Skip to content

Commit

Permalink
jquery: Enable no-done-fail and no-fx
Browse files Browse the repository at this point in the history
Raise eslint-plugin-no-jquery to 3.1.0+ to provide new rules.
  • Loading branch information
jdforrester committed Dec 2, 2024
1 parent 91e9a0b commit 8dfc4f3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 15 deletions.
2 changes: 2 additions & 0 deletions jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
"no-jquery/no-animate-toggle": "error",
"no-jquery/no-class-state": "error",
"no-jquery/no-constructor-attributes": "error",
"no-jquery/no-done-fail": "error",
"no-jquery/no-each-util": "error",
"no-jquery/no-error": "error",
"no-jquery/no-extend": [ "error", { "allowDeep": true } ],
"no-jquery/no-fade": "error",
"no-jquery/no-fx": "error",
"no-jquery/no-global-eval": "error",
"no-jquery/no-global-selector": "error",
"no-jquery/no-grep": "error",
Expand Down
26 changes: 13 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"eslint-plugin-mediawiki": "^0.7.0",
"eslint-plugin-mocha": "^10.4.3",
"eslint-plugin-n": "^17.7.0",
"eslint-plugin-no-jquery": "^3.0.2",
"eslint-plugin-no-jquery": "^3.1.0",
"eslint-plugin-qunit": "^8.1.1",
"eslint-plugin-security": "^1.7.1",
"eslint-plugin-unicorn": "^53.0.0",
Expand Down
8 changes: 7 additions & 1 deletion test/fixtures/jquery/invalid.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
// eslint-disable-next-line no-jquery/no-trim
$.trim( ' foo ' );

// eslint-disable-next-line no-jquery/no-done-fail
$.promise().done( function () {} );

// Recommended
// eslint-disable-next-line no-jquery/variable-pattern
div = $div.find( '.foo' );
Expand Down Expand Up @@ -122,7 +125,10 @@
// eslint-disable-next-line no-jquery/no-delegate
$x.delegate();

// eslint-disable-next-line no-jquery/no-fx-interval
// eslint-disable-next-line no-jquery/no-fx
$.fx;

// eslint-disable-next-line no-jquery/no-fx, no-jquery/no-fx-interval
$.fx.interval;

// eslint-disable-next-line no-jquery/no-parse-json
Expand Down

0 comments on commit 8dfc4f3

Please sign in to comment.