🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →

eslint-plugin-no-jquery

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-no-jquery - npm Package Compare versions

Comparing version

to
2.4.0

# eslint-plugin-no-jquery release history
## v2.4.0
* New feature: Add specification of plugin return types to settings (Ed Sanders)
* New profile: Add new `deprecated-3.5` config (Ed Sanders)
* New rule: `no-find-collection`, split out of `no-find` (Ed Sanders)
* New rule: `no-find-util`, split out of `no-find` (Ed Sanders)
* Rule fix: Set all rules to type: `suggestion` (Ed Sanders)
* Rule fix: `no-global-selector`; add `allowIds` option to allow global selector by ID (Adam Roses Wight)
* Rule fix: `no-event-shorthand`; add `allowAjaxEvents` option and use in `deprecated-3.3` (Ed Sanders)
* Docs: Avoid duplicating name in "Prefer..." sentence (Ed Sanders)
* Docs: Build lists in README.md automatically (Ed Sanders)
* Docs: Consistently use `.methodOrProp` with collections, not `$.methodOrProp` (Ed Sanders)
* Docs: Link to jQuery documentation for each method/util/property (Ed Sanders)
* Docs: Show ruleset information in README (Ed Sanders)
* Release: State "MIT license" in LICENSE header (Ed Sanders)
* Release: Update devDependencies (Ed Sanders)
* code: Add `#odd` and `#even` to all methods lists, new in jQuery 3.5 (Ed Sanders)
* code: Add code coverage checks using Istanbul (Ed Sanders)
* code: Move index.js to src/ (Ed Sanders)
* code: Restructure files and folders (Ed Sanders)
* code: Setup codecov GitHub Action integration (Ed Sanders)
## v2.3.2

@@ -4,0 +40,0 @@

{
"name": "eslint-plugin-no-jquery",
"version": "2.3.2",
"version": "2.4.0",
"description": "Disallow jQuery functions with native equivalents.",

@@ -15,12 +15,13 @@ "repository": {

],
"main": "index.js",
"main": "src/index.js",
"scripts": {
"pretest": "eslint --report-unused-disable-directives .",
"test": "mocha --reporter dot tests/",
"test": "nyc mocha --reporter dot tests/** && git diff --exit-code docs/ src/ README.md",
"report": "nyc report --reporter=text-lcov > coverage.lcov",
"testpath": "mocha",
"doc": "rm docs/* && mocha --reporter dot tests/ --doc"
"doc": "rm -f docs/* && mocha --reporter dot tests/** --doc && node tools/build-readme.js",
"build": "npm run doc && node tools/build-all-methods.js"
},
"files": [
"index.js",
"rules/*"
"src"
],

@@ -31,6 +32,10 @@ "peerDependencies": {

"devDependencies": {
"codecov": "^3.6.5",
"eslint": "^6.4.0",
"eslint-config-wikimedia": "^0.15.0",
"eslint-config-wikimedia": "^0.15.1",
"eslint-plugin-rulesdir": "^0.1.0",
"mocha": "^7.1.0"
"jquery": "3.5.0",
"jsdom": "^16.2.2",
"mocha": "^7.1.1",
"nyc": "^15.0.1"
},

@@ -37,0 +42,0 @@ "bugs": {

@@ -0,1 +1,2 @@

<!-- This file is built by build-readme.js. Do not edit it directly; edit README.md.template instead. -->
# eslint-plugin-no-jquery

@@ -36,3 +37,3 @@

The pre-set profile `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 profiles targetting specific versions of jQuery if you know the environment in which your code will operate. There are profiles for jQuery 3.4.x+ environments (`deprecated-3.4`), 3.0.x+ (`deprecated-3.0`), and several others for completeness. Deprecation profiles are cumulative, so include all the rules for jQuery versions below them.
The pre-set profile `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 profiles targetting specific versions of jQuery if you know the environment in which your code will operate. There is a profile for jQuery 3.5.x+ environments (`deprecated-3.5`), and profiles for other minor releases that include deprecations (`deprecated-3.4`, `deprecated-1.10` etc.). Deprecation profiles are cumulative, so they include all the rules for jQuery versions below them.

@@ -47,2 +48,11 @@ Alternatively, you can pick out rules individually (see below).

* `variablePattern` - Regular expression pattern for matching jQuery variables. Defaults to `"^\\$."`. This pattern can be enforced with the [`no-jquery/variable-pattern`](docs/variable-pattern.md) 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.
* e.g. `$bar = $foo.stop()`
* `'accessor'` a plugin which only returns a jQuery collection when an argument is given.
* e.g. `w = $foo.width()`, `$bar = $foo.width( 200 )`
* `'valueAccessor'` a plugin which only returns a jQuery collection when more than one argument is given.
* e.g. `w = $foo.css( 'width' )`, `$bar = $foo.css( 'width', '1em' )`
* `'never'` (default) a plugin which never returns a jQuery collection.
* e.g. `arr = $foo.toArray()`

@@ -54,3 +64,6 @@ ```json

"constructorAliases": [ "$", "jQuery" ],
"variablePattern": "^\\$.|^element$"
"variablePattern": "^\\$.|^element$",
"collectionReturningPlugins": {
"datePicker": "always"
}
}

@@ -66,13 +79,13 @@ },

* [`no-jquery/variable-pattern`](docs/variable-pattern.md)
* [`no-jquery/no-ajax`](docs/no-ajax.md)
* [`no-jquery/no-ajax-events`](docs/no-ajax-events.md)
* [`no-jquery/no-and-self`](docs/no-and-self.md)
* [`no-jquery/no-animate`](docs/no-animate.md)
* [`no-jquery/no-animate-toggle`](docs/no-animate-toggle.md)
Where rules are included in the pre-set profiles `slim` or `deprecated-X.X` it is indicated below. Where rules are included with options this is indicated with a `†`.
* [`no-jquery/no-ajax`](docs/no-ajax.md) `slim`
* [`no-jquery/no-ajax-events`](docs/no-ajax-events.md) `slim`
* [`no-jquery/no-and-self`](docs/no-and-self.md) `1.8`
* [`no-jquery/no-animate`](docs/no-animate.md) `slim`
* [`no-jquery/no-animate-toggle`](docs/no-animate-toggle.md) `slim`
* [`no-jquery/no-attr`](docs/no-attr.md)
* [`no-jquery/no-bind`](docs/no-bind.md)
* [`no-jquery/no-box-model`](docs/no-box-model.md)
* [`no-jquery/no-browser`](docs/no-browser.md)
* [`no-jquery/no-camel-case`](docs/no-camel-case.md)
* [`no-jquery/no-bind`](docs/no-bind.md) `3.0`
* [`no-jquery/no-box-model`](docs/no-box-model.md) `1.3`
* [`no-jquery/no-browser`](docs/no-browser.md) `1.3`
* [`no-jquery/no-camel-case`](docs/no-camel-case.md) `3.3`
* [`no-jquery/no-class`](docs/no-class.md)

@@ -84,8 +97,7 @@ * [`no-jquery/no-class-state`](docs/no-class-state.md)

* [`no-jquery/no-contains`](docs/no-contains.md)
* [`no-jquery/no-context-prop`](docs/no-context-prop.md)
* [`no-jquery/no-context-prop`](docs/no-context-prop.md) `1.10`
* [`no-jquery/no-css`](docs/no-css.md)
* [`no-jquery/no-data`](docs/no-data.md)
* [`no-jquery/no-deferred`](docs/no-deferred.md)
* [`no-jquery/no-delegate`](docs/no-delegate.md)
* [`no-jquery/no-die`](docs/no-die.md)
* [`no-jquery/no-delegate`](docs/no-delegate.md) `3.0`
* [`no-jquery/no-each`](docs/no-each.md)

@@ -95,25 +107,28 @@ * [`no-jquery/no-each-collection`](docs/no-each-collection.md)

* [`no-jquery/no-error`](docs/no-error.md)
* [`no-jquery/no-error-shorthand`](docs/no-error-shorthand.md)
* [`no-jquery/no-event-shorthand`](docs/no-event-shorthand.md)
* [`no-jquery/no-error-shorthand`](docs/no-error-shorthand.md) `1.8`
* [`no-jquery/no-event-shorthand`](docs/no-event-shorthand.md) `3.5`, `3.3†`
* [`no-jquery/no-extend`](docs/no-extend.md)
* [`no-jquery/no-fade`](docs/no-fade.md)
* [`no-jquery/no-fade`](docs/no-fade.md) `slim`
* [`no-jquery/no-filter`](docs/no-filter.md)
* [`no-jquery/no-find`](docs/no-find.md)
* [`no-jquery/no-fx-interval`](docs/no-fx-interval.md)
* [`no-jquery/no-find-collection`](docs/no-find-collection.md)
* [`no-jquery/no-find-util`](docs/no-find-util.md)
* [`no-jquery/no-fx-interval`](docs/no-fx-interval.md) `3.0`
* [`no-jquery/no-global-eval`](docs/no-global-eval.md)
* [`no-jquery/no-global-selector`](docs/no-global-selector.md)
* [`no-jquery/no-grep`](docs/no-grep.md)
* [`no-jquery/no-has`](docs/no-has.md)
* [`no-jquery/no-hold-ready`](docs/no-hold-ready.md)
* [`no-jquery/no-hold-ready`](docs/no-hold-ready.md) `3.2`
* [`no-jquery/no-html`](docs/no-html.md)
* [`no-jquery/no-in-array`](docs/no-in-array.md)
* [`no-jquery/no-is-array`](docs/no-is-array.md)
* [`no-jquery/no-is`](docs/no-is.md)
* [`no-jquery/no-is-array`](docs/no-is-array.md) `3.2`
* [`no-jquery/no-is-empty-object`](docs/no-is-empty-object.md)
* [`no-jquery/no-is-function`](docs/no-is-function.md) `3.3`
* [`no-jquery/no-is-numeric`](docs/no-is-numeric.md) `3.3`
* [`no-jquery/no-is-plain-object`](docs/no-is-plain-object.md)
* [`no-jquery/no-is-function`](docs/no-is-function.md)
* [`no-jquery/no-is-numeric`](docs/no-is-numeric.md)
* [`no-jquery/no-is-window`](docs/no-is-window.md)
* [`no-jquery/no-is`](docs/no-is.md)
* [`no-jquery/no-live`](docs/no-live.md)
* [`no-jquery/no-load`](docs/no-load.md)
* [`no-jquery/no-load-shorthand`](docs/no-load-shorthand.md)
* [`no-jquery/no-is-window`](docs/no-is-window.md) `3.3`
* [`no-jquery/no-live`](docs/no-live.md) `1.7`
* [`no-jquery/no-load`](docs/no-load.md) `slim`
* [`no-jquery/no-load-shorthand`](docs/no-load-shorthand.md) `1.8`
* [`no-jquery/no-map`](docs/no-map.md)

@@ -123,6 +138,6 @@ * [`no-jquery/no-map-collection`](docs/no-map-collection.md)

* [`no-jquery/no-merge`](docs/no-merge.md)
* [`no-jquery/no-node-name`](docs/no-node-name.md)
* [`no-jquery/no-node-name`](docs/no-node-name.md) `3.2`
* [`no-jquery/no-noop`](docs/no-noop.md)
* [`no-jquery/no-now`](docs/no-now.md)
* [`no-jquery/no-on-ready`](docs/no-on-ready.md)
* [`no-jquery/no-now`](docs/no-now.md) `3.3`
* [`no-jquery/no-on-ready`](docs/no-on-ready.md) `1.8`
* [`no-jquery/no-param`](docs/no-param.md)

@@ -133,25 +148,22 @@ * [`no-jquery/no-parent`](docs/no-parent.md)

* [`no-jquery/no-parse-html-literal`](docs/no-parse-html-literal.md)
* [`no-jquery/no-parse-json`](docs/no-parse-json.md)
* [`no-jquery/no-parse-xml`](docs/no-parse-xml.md)
* [`no-jquery/no-parse-json`](docs/no-parse-json.md) `3.0`
* [`no-jquery/no-parse-xml`](docs/no-parse-xml.md) `slim`
* [`no-jquery/no-prop`](docs/no-prop.md)
* [`no-jquery/no-proxy`](docs/no-proxy.md)
* [`no-jquery/no-proxy`](docs/no-proxy.md) `3.3`
* [`no-jquery/no-ready`](docs/no-ready.md)
* [`no-jquery/no-ready-shorthand`](docs/no-ready-shorthand.md)
* [`no-jquery/no-global-selector`](docs/no-global-selector.md)
* [`no-jquery/no-selector-prop`](docs/no-selector-prop.md)
* [`no-jquery/no-ready-shorthand`](docs/no-ready-shorthand.md) `3.0`
* [`no-jquery/no-selector-prop`](docs/no-selector-prop.md) `1.7`
* [`no-jquery/no-serialize`](docs/no-serialize.md)
* [`no-jquery/no-size`](docs/no-size.md)
* [`no-jquery/no-sizzle`](docs/no-sizzle.md)
* [`no-jquery/no-slide`](docs/no-slide.md)
* [`no-jquery/no-sub`](docs/no-sub.md)
* [`no-jquery/no-size`](docs/no-size.md) `1.8`
* [`no-jquery/no-sizzle`](docs/no-sizzle.md) `3.4†`
* [`no-jquery/no-slide`](docs/no-slide.md) `slim`
* [`no-jquery/no-sub`](docs/no-sub.md) `1.7`
* [`no-jquery/no-submit`](docs/no-submit.md)
* [`no-jquery/no-support`](docs/no-support.md)
* [`no-jquery/no-support`](docs/no-support.md) `1.9`
* [`no-jquery/no-text`](docs/no-text.md)
* [`no-jquery/no-trigger`](docs/no-trigger.md)
* [`no-jquery/no-trim`](docs/no-trim.md)
* [`no-jquery/no-type`](docs/no-type.md)
* [`no-jquery/no-unbind`](docs/no-unbind.md)
* [`no-jquery/no-undelegate`](docs/no-undelegate.md)
* [`no-jquery/no-unique`](docs/no-unique.md)
* [`no-jquery/no-unload-shorthand`](docs/no-unload-shorthand.md)
* [`no-jquery/no-trim`](docs/no-trim.md) `3.5`
* [`no-jquery/no-type`](docs/no-type.md) `3.3`
* [`no-jquery/no-unique`](docs/no-unique.md) `3.0`
* [`no-jquery/no-unload-shorthand`](docs/no-unload-shorthand.md) `1.8`
* [`no-jquery/no-val`](docs/no-val.md)

@@ -161,8 +173,13 @@ * [`no-jquery/no-visibility`](docs/no-visibility.md)

* [`no-jquery/no-wrap`](docs/no-wrap.md)
* [`no-jquery/variable-pattern`](docs/variable-pattern.md)
### ⚠️ Deprecated
* [`no-jquery/no-hide`](docs/no-hide.md)
* [`no-jquery/no-show`](docs/no-show.md)
* [`no-jquery/no-toggle`](docs/no-toggle.md)
* [`no-jquery/no-die`](docs/no-die.md) (use [`no-jquery/no-live`](docs/no-live.md))
* [`no-jquery/no-hide`](docs/no-hide.md) (use [`no-jquery/no-visibility`](docs/no-visibility.md))
* [`no-jquery/no-show`](docs/no-show.md) (use [`no-jquery/no-visibility`](docs/no-visibility.md))
* [`no-jquery/no-toggle`](docs/no-toggle.md) (use [`no-jquery/no-visibility`](docs/no-visibility.md))
* [`no-jquery/no-unbind`](docs/no-unbind.md) (use [`no-jquery/no-bind`](docs/no-bind.md))
* [`no-jquery/no-undelegate`](docs/no-undelegate.md) (use [`no-jquery/no-delegate`](docs/no-delegate.md))
## 🤖 Development

@@ -184,3 +201,3 @@

```sh
npm run testpath tests/no-ajax
npm run testpath tests/rules/no-ajax
```

@@ -187,0 +204,0 @@

Sorry, the diff of this file is not supported yet