Gathering detailed insights and metrics for eslint-plugin-no-jquery
Gathering detailed insights and metrics for eslint-plugin-no-jquery
Gathering detailed insights and metrics for eslint-plugin-no-jquery
Gathering detailed insights and metrics for eslint-plugin-no-jquery
Control allowance of certain jQuery functions, and suggest or autofix alternatives.
npm install eslint-plugin-no-jquery
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
31 Stars
424 Commits
8 Forks
13 Watching
2 Branches
43 Contributors
Updated on 19 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-7.1%
33,453
Compared to previous day
Last week
-4.3%
144,784
Compared to previous week
Last month
53.6%
609,884
Compared to previous month
Last year
50.8%
4,567,663
Compared to previous year
1
Disallow jQuery functions, with suggestions for native equivalents where possible.
Originally a fork of eslint-plugin-jquery.
You'll first need to install ESLint:
1npm install eslint --save-dev
Next, install eslint-plugin-no-jquery
:
1npm install eslint-plugin-no-jquery --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-no-jquery
globally.
Add no-jquery
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
1{ 2 "extends": "plugin:no-jquery/deprecated", 3 "plugins": [ 4 "no-jquery" 5 ] 6}
The config plugin:no-jquery/recommended
includes the recommended rule no-jquery/variable-pattern
which is required for method rules to work correctly.
The config plugin:no-jquery/deprecated
includes all known deprecated and removed code, and is updated as new releases of jQuery come out. You can instead use configs targeting specific versions of jQuery if you know the environment in which your code will operate. There is a config for all minor versions from 1.0 to 3.6 (deprecated-1.0
, ..., deprecated-3.7
). Deprecation configs are cumulative, so they include all the rules for jQuery versions below them.
The config plugin:no-jquery/slim
includes all features excluded from the official "slim" build of jQuery, specifically the ajax and effects modules.
The config plugin:no-jquery/all
includes all methods and utilies and should be used when you are aiming to remove all jQuery usage from your code.
Alternatively, you can pick out rules individually (see below).
The following global settings can be used under the no-jquery
property to configure the linter:
constructorAliases
- An array of aliases for the jQuery constructor. Defaults to [ "$", "jQuery" ]
.variablePattern
- Regular expression pattern for matching jQuery variables. Defaults to "^\\$."
. This pattern can be enforced with the no-jquery/variable-pattern
rule.collectionReturningPlugins
- An object describing the return types of jQuery plugins. Keys are plugin method names, and values can be one of:
'always'
a plugin which always returns a jQuery collection.
$bar = $foo.stop()
'accessor'
a plugin which only returns a jQuery collection when an argument is given.
w = $foo.width()
, $bar = $foo.width( 200 )
'valueAccessor'
a plugin which only returns a jQuery collection when more than one argument is given.
w = $foo.css( 'width' )
, $bar = $foo.css( 'width', '1em' )
'never'
(default) a plugin which never returns a jQuery collection.
arr = $foo.toArray()
1{ 2 "settings": { 3 "no-jquery": { 4 "constructorAliases": [ "$", "jQuery" ], 5 "variablePattern": "^\\$.|^element$", 6 "collectionReturningPlugins": { 7 "datePicker": "always" 8 } 9 } 10 }, 11 "plugins": [ 12 "no-jquery" 13 ] 14}
Rules with options are indicated with ⚙️. Rules which are fixable are indicated with 🔧.
Where rules are included in the configs recommended
, slim
, all
or deprecated-X.X
it is indicated below. Where rules are included in a config with non-default options this is indicated with a †
.
no-jquery/no-ajax
slim
, all
no-jquery/no-ajax-events
slim
no-jquery/no-and-self
🔧 1.8
no-jquery/no-animate
⚙️ slim
, all
no-jquery/no-animate-toggle
slim
no-jquery/no-append-html
no-jquery/no-attr
all
no-jquery/no-bind
3.0
, all
no-jquery/no-box-model
1.3
no-jquery/no-browser
1.3
no-jquery/no-camel-case
3.3
, all
no-jquery/no-class
all
no-jquery/no-class-state
no-jquery/no-clone
all
no-jquery/no-closest
all
no-jquery/no-constructor-attributes
no-jquery/no-contains
all
no-jquery/no-context-prop
1.10
no-jquery/no-css
all
no-jquery/no-data
all
no-jquery/no-deferred
all
no-jquery/no-delegate
3.0
, all
no-jquery/no-done-fail
all
no-jquery/no-each
no-jquery/no-each-collection
all
no-jquery/no-each-util
all
no-jquery/no-error
🔧 all
no-jquery/no-error-shorthand
🔧 1.8
no-jquery/no-escape-selector
🔧 all
no-jquery/no-event-shorthand
⚙️ 🔧 3.5
, 3.3†
, all
no-jquery/no-extend
⚙️ 🔧 all
no-jquery/no-fade
slim
, all
no-jquery/no-filter
all
no-jquery/no-find
no-jquery/no-find-collection
all
no-jquery/no-find-util
all
no-jquery/no-fx
slim
no-jquery/no-fx-interval
3.0
no-jquery/no-global-eval
all
no-jquery/no-global-selector
⚙️no-jquery/no-grep
all
no-jquery/no-has
all
no-jquery/no-hold-ready
3.2
, all
no-jquery/no-html
⚙️ all
no-jquery/no-in-array
all
no-jquery/no-is
all
no-jquery/no-is-array
🔧 3.2
, all
no-jquery/no-is-empty-object
all
no-jquery/no-is-function
🔧 3.3
, all
no-jquery/no-is-numeric
3.3
, all
no-jquery/no-is-plain-object
all
no-jquery/no-is-window
3.3
, all
no-jquery/no-jquery-constructor
all
no-jquery/no-live
1.7
, all
no-jquery/no-load
slim
, all
no-jquery/no-load-shorthand
🔧 1.8
no-jquery/no-map
no-jquery/no-map-collection
all
no-jquery/no-map-util
all
no-jquery/no-merge
all
no-jquery/no-node-name
3.2
, all
no-jquery/no-noop
🔧 all
no-jquery/no-now
🔧 3.3
, all
no-jquery/no-on-ready
🔧 1.8
no-jquery/no-other-methods
all
no-jquery/no-other-utils
all
no-jquery/no-param
all
no-jquery/no-parent
all
no-jquery/no-parents
all
no-jquery/no-parse-html
all
no-jquery/no-parse-html-literal
⚙️ 🔧no-jquery/no-parse-json
🔧 3.0
, all
no-jquery/no-parse-xml
🔧 slim
, all
no-jquery/no-prop
all
no-jquery/no-proxy
🔧 3.3
, all
no-jquery/no-ready
no-jquery/no-ready-shorthand
🔧 3.0
, all
no-jquery/no-selector-prop
1.7
no-jquery/no-serialize
all
no-jquery/no-size
🔧 1.8
, all
no-jquery/no-sizzle
⚙️ 3.4†
no-jquery/no-slide
slim
, all
no-jquery/no-sub
1.7
, all
no-jquery/no-support
1.9
no-jquery/no-text
all
no-jquery/no-trigger
all
no-jquery/no-trim
3.5
, all
no-jquery/no-type
3.3
, all
no-jquery/no-unique
🔧 3.0
, all
no-jquery/no-unload-shorthand
🔧 1.8
no-jquery/no-val
all
no-jquery/no-visibility
all
no-jquery/no-when
all
no-jquery/no-wrap
all
no-jquery/variable-pattern
recommended
no-jquery/no-die
(use no-jquery/no-live
)no-jquery/no-hide
(use no-jquery/no-visibility
)no-jquery/no-show
(use no-jquery/no-visibility
)no-jquery/no-submit
(use no-jquery/no-event-shorthand
)no-jquery/no-toggle
(use no-jquery/no-visibility
)no-jquery/no-unbind
(use no-jquery/no-bind
)no-jquery/no-undelegate
(use no-jquery/no-delegate
)1npm install 2npm test
To update documentation after modifying a rule or its tests, use
1npm run doc
To run a specific test or tests:
1npm run testpath tests/rules/no-ajax
Distributed under the MIT license. See LICENSE for details.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
all changesets reviewed
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
7 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 8
Reason
2 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More