Linting rules for checking jQuery version compatibility
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-jquery-compat
:
$ npm install @frogeducation/eslint-plugin-jquery-compat --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-jquery-compat
globally.
Add jquery-compat
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"@frogeducation/jquery-compat"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"@frogeducation/jquery-compat/no-parse-json": 2
}
}
Alternatively, extend the recommended config:
{
"extends": [
// enables all recommended rules
"plugin:@frogeducation/jquery-compat/recommended",
]
}
There are also two tags v1.9
and v3.0
for the upgrade checkpoints, and special tags for every version that enable only the fixes that can be applied at every three-digit version up to 3.4.1 (i.e. while preparing for an upgrade from 1.7 to 1.9, anything added in 1.8 is not yet fixable as you have not yet upgraded the jQuery version)
{
"extends": [
// enables only the rules required to upgrade 1.0 to 1.9
"plugin:@frogeducation/jquery-compat/v1.9",
// enables only the rules that are fixable from v1.7 upwards
"plugin:@frogeducation/jquery-compat/fixable-from-v1.7.0"
]
}
and finally, rules that only apply to JMVC users:
{
"extends": [
// enables only the rules required for JMVC users
"plugin:@frogeducation/jquery-compat/jmvc"
]
}
rule | deprecated | fixable from | removed | --fix |
recommended |
---|---|---|---|---|---|
attr-select | 1.9.0 | 1.6.0 | 1.9.0 | Yes | Yes |
deferred-use-state | 1.7.0 | 1.7.0 | 1.8.0 | Yes | Yes |
html-string-must-start-with-tag | 1.9.0 | 1.0.0 | 1.9.0 | Yes | |
jmvc/no-hover-event | 1.8.0 | 1.0.0 | 1.9.0 | ||
jmvc/no-null-model-calls | 1.8.0 | 1.0.0 | 1.8.0 | Yes | |
jmvc/no-trailing-comma-after-selector | 1.9.0 | 1.0.0 | 1.9.0 | Yes | |
no-andself | 1.8.0 | 1.8.0 | 3.0.0 | Yes | Yes |
no-attr-value | 1.9.0 | 1.6.0 | 1.9.0 | Yes | |
no-attrfn | 1.8.0 | (must rewrite) | 1.9.0 | Yes | |
no-box-model | 1.3.0 | 1.0.0 | 1.8.0 | Yes | |
no-browser | 1.3.0 | 1.0.0 | 1.9.0 | Yes | |
no-buildFragment | 1.8.0 | 1.0.0 | 1.8.0 | Yes | |
no-capitalised-html-data-attributes | 3.0.0 | 1.0.0 | 3.0.0 | Yes | Yes |
no-clean | 1.9.0 | (must rewrite) | 1.9.0 | Yes | |
no-deferred-pipe | 1.8.0 | 1.8.0 | Yes | Yes | |
no-deprecated-event-methods | 1.8.0 | 1.7.0 | 3.0.0 | Yes | Yes |
no-die | 1.7.0 | 1.7.0 | 1.9.0 | Yes | Yes |
no-document-on-ready | 1.8.0 | 1.0.0 | Yes | Yes | |
no-fn-data-events | 1.9.0 | (must rewrite) | 1.9.0 | Yes | |
no-fn-size | 1.8.0 | 1.0.0 | 3.0.0 | Yes | Yes |
no-global-handle | 1.7.0 | (must rewrite) | 1.9.0 | Yes | |
no-global-trigger | 1.9.0 | (must rewrite) | 1.9.0 | Yes | |
no-hover-event | 1.8.0 | 1.0.0 | 1.9.0 | Yes | Yes |
no-live | 1.7.0 | 1.7.0 | 1.9.0 | Yes | Yes |
no-null-param | 1.8.0 | 1.0.0 | 1.8.0 | Yes | |
no-parse-json | 3.0.0 | 1.0.0 | Yes | Yes | |
no-scoped-ajax-events | 1.9.0 | 1.0.0 | 1.9.0 | Yes | |
no-sub | 1.7.0 | (must rewrite) | 1.9.0 | Yes | |
no-swap | 1.9.0 | (must rewrite) | Yes | ||
no-toggle-handler | 1.8.0 | 1.0.0 | 1.9.0 | Yes | |
no-trailing-text-in-html-strings | 1.9.0 | 1.0.0 | 1.9.0 | Yes | |
quoted-hash-attribute-selectors | 1.11.0 | 1.0.0 | 1.11.0 | Yes | Yes |
JQMIGRATE: jQuery.data() always sets/gets camelCased names
Data attribute capitalisation is now standardised in jQuery; only word-boundaries in kebab-cased HTML data attributes are respected.
Keeping HTML data attributes lowercased avoids confusion.
Examples of incorrect code for this rule:
$('<div data-helloWorld="no" />').data('helloWorld') // --> undefined
$('<div data-helloWorld="no" />').data('helloworld') // --> "no"
Examples of correct code for this rule:
$('<div data-hello-world="yes" />')
Further reading:
Included in 83 configs
- v3.0
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: `jQuery.fn.attr('selected')` might use property instead of attribute
Cause: Prior to jQuery 1.9, $().attr("checked")
etc. would sometimes use the checked|selected property instead of the attribute when interacting with non-XML elements, despite the fact that browsers and the HTML specifications allow the properties (current state) to differ from the attributes (initial/default state). This was a holdover from earlier versions of jQuery that did not offer $().prop
.
Solution: Boolean properties should generally not be passed to $().attr
at all; replace with $().prop
unless you truly intend to update the underlying HTML attribute.
Examples of incorrect code for this rule:
if ($foo.attr("selected")) { /* ... */ }
if ($foo.attr("checked")) { /* ... */ }
if ($foo.attr("disabled")) { /* ... */ }
Examples of correct code for this rule:
if ($foo.prop("selected")) { /* ... */ }
if ($foo.prop("checked")) { /* ... */ }
if ($foo.prop("disabled")) { /* ... */ }
Further reading:
Included in 52 configs
- v1.9
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: `deferred.isResolved()` / `deferred.isRejected()` is deprecated
deferred.isRejected()
and deferred.isResolved()
were removed in jQuery 1.8;
use deferred.state() === 'rejected'
and deferred.state() === 'resolved'
instead (deferred.state()
may also return 'pending'
).
Examples of incorrect code for this rule:
var myDeferred = $.Deferred()
if (myDeferred.isRejected()) {
/* ...snip... */
} else (myDeferred.isResolved()) {
/* ...snip... */
}
Examples of correct code for this rule:
var myDeferred = $.Deferred()
if (myDeferred.state() === 'rejected') {
/* ...snip... */
} else (myDeferred.state() === 'resolved') {
/* ...snip... */
}
Further reading:
Included in 46 configs
- v1.9
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: `$(html)` HTML strings must start with '<' character
Cause: In jQuery 1.9, HTML strings passed to $()
must start with a tag; in other words the first character of the string must be a <
character. There cannot be any preceding characters, including whitespace. This is done to reduce the chances of inadvertent execution of scripts that might be present in HTML that is obtained from the URL, AJAX, or other sources. Use of simple literal HTML strings like $("<div />")
or $("<p>hello</p>")
are unaffected since they should not have leading spaces or text.
Solution: Use the $.parseHTML()
method to parse arbitrary HTML, especially HTML from external sources. To obtain a jQuery object that has the parsed HTML without running scripts, use $($.parseHTML("string"))
. To run scripts in the HTML as well, use $($.parseHTML("string", document, true))
instead. We do not recommend running $.trim()
on the string to circumvent this check.
Examples of incorrect code for this rule:
$("hello <strong>world</strong>")
Examples of correct code for this rule:
$($.parseHTML("hello <strong>world</strong>"))
$("<span>hello <strong>world</strong></span>")
Further reading:
Included in 83 configs
- v1.9
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
$.param no longer encodes null/undefined
Cause: jQuery.param()
(used to build query string parameters in api calls from models) no longer encodes null
or undefined
as strings; in stead it encodes them as empty strings.
Solution: Rewrite any code that passes null
or undefined
to model calls to pass these as strings, or omit them, as appropriate.
Examples of incorrect code for this rule:
Foo.Models.Bar.baz({ foo: null, bar: undefined, baz: 42 })
Examples of correct code for this rule:
Foo.Models.Bar.baz({ foo: "null", bar: "undefined", baz: 42 })
Foo.Models.Bar.baz({ baz: 42 })
Further reading:
Included in 83 configs
- v1.9
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: `jQuery.fn.andSelf()` replaced by `jQuery.fn.addBack()`
The .andSelf() method has been renamed to .addBack() as of jQuery 1.9 to better reflect its purpose of adding back the previous set of results.
Replace any use of .andSelf() with .addBack().
Examples of incorrect code for this rule:
$('.foo').find('.bar').andSelf()
Examples of correct code for this rule:
$('.foo').find('.bar').addBack()
Further reading:
Included in 42 configs
- v1.9
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: `jQuery.fn.attr('value')` no longer gets properties
Prior to jQuery 1.9, $().attr("value")
retrieved the value property instead of
the value attribute (which generally reflects the value that was read from HTML
markup). $().attr( "value", val )
set the value property instead of the value
attribute. This caused inconsistent behavior with selectors referencing the
value attribute.
Use
Examples of incorrect code for this rule:
var value = $('input.foo').attr('value')
$('input.foo').attr('value', 'newValue')
Examples of correct code for this rule:
var value = $('input.foo').val()
$('input.foo').val('newValue')
var value2 = $('div.bar').prop('value')
$('div.bar').prop('value', 'newValue')
Included in 52 configs
- v1.9
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: `jQuery.attrFn` is deprecated
Cause: Prior to jQuery 1.8, the undocumented jQuery.attrFn
object provided a list of properties supported by the $(html, props)
method. It is no longer required as of jQuery 1.8, but some developers "discovered" it by reading the source and began to use it. Their code still expects jQuery.attrFn
to be present, attempts to assign values to it, and will throw errors if it is not present.
Solution: Ensure that you are using the latest version of jQuery UI (1.8.21 or later) and jQuery Mobile (1.2.1 or later); they no longer use jQuery.attrFn
. Examine any third-party plugins for the string attrFn
and report its use to the plugin authors (not to jQuery team).
Examples of incorrect code for this rule:
$.attrFn.foo = "bar"
Examples of correct code for this rule:
(none provided)
Further reading:
Included in 83 configs
- v1.9
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: `jQuery.boxModel` / `jQuery.support.boxModel` is deprecated
These two deprecated properties are false when the page is using Quirks mode, and true when the page is in standards mode. Quirks mode was never supported in jQuery so these properties were removed.
Do not use jQuery in Quirks mode, it has never been supported.
Examples of incorrect code for this rule:
if ($.boxModel) { /* ...snip... */ }
if ($.support.boxModel) { /* ...snip... */ }
if (jQuery.boxModel) { /* ...snip... */ }
if (jQuery.support.boxModel) { /* ...snip... */ }
Examples of correct code for this rule:
// use feature detection in stead
Further reading:
Included in 83 configs
- v1.9
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: jQuery.browser is deprecated
jQuery.browser was deprecated in version 1.3, and finally removed in 1.9. Browser sniffing is notoriously unreliable as means of detecting whether to implement particular features.
Where possible, use feature detection to make code decisions rather than trying to detect a specific browser. The Modernizr library provides a wide variety of feature detections. As a last resort, you can directly look at the navigator.userAgent string to detect specific strings returned by the browser.
Examples of incorrect code for this rule:
if (!$.browser.msie) {
console.log("supported!")
}
Examples of correct code for this rule:
if (window.someFeature) {
console.log("supported!")
}
Further reading:
Included in 83 configs
- v1.9
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: jQuery.buildFragment() is deprecated
Cause: jQuery.buildFragment()
and jQuery.clean()
are undocumented internal methods. The signature of jQuery.buildFragment()
was changed in jQuery 1.8 and 1.9, and jQuery.clean()
was removed in 1.9. However, we are aware of some plugins or other code that might be using them.
Solution: Rewrite any code that makes use of these or any other undocumented methods. For example the jQuery.parseHTML()
method, introduced in jQuery 1.8, can convert HTML to an array of DOM elements that you can append to a document fragment.
Examples of incorrect code for this rule:
$.buildFragment()
Examples of correct code for this rule:
(none provided)
Further reading:
Included in 83 configs
- v1.9
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: jQuery.clean() is deprecated
Cause: jQuery.buildFragment()
and jQuery.clean()
are undocumented internal methods. The signature of jQuery.buildFragment()
was changed in jQuery 1.8 and 1.9, and jQuery.clean()
was removed in 1.9. However, we are aware of some plugins or other code that might be using them.
Solution: Rewrite any code that makes use of these or any other undocumented methods. For example the jQuery.parseHTML()
method, introduced in jQuery 1.8, can convert HTML to an array of DOM elements that you can append to a document fragment.
Examples of incorrect code for this rule:
$.clean()
Examples of correct code for this rule:
(none provided)
Further reading:
Included in 83 configs
- v1.9
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: deferred.pipe() is deprecated
The .pipe() method on a jQuery.Deferred object was deprecated as of jQuery 1.8, when the .then() method was changed to perform the same function.
In most cases it is sufficient to change all occurrences of .pipe() to .then(). Ensure that you aren't relying on context/state propagation (e.g., using this) or synchronous callback invocation, which were dropped from .then() for Promises/A+ interoperability as of jQuery 3.0.
Examples of incorrect code for this rule:
$.Deferred().pipe(fn)
Examples of correct code for this rule:
$.Deferred().then(fn)
Further reading:
Included in 42 configs
- v1.9
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: jQuery.fn.error() is deprecated
Many shortcut methods for attaching certain event handlers to elements were
deprecated in jQuery 1.8/1.9, such as $.fn.load
, $.fn.error
, etc.
For most cases, simply changing the code to use $.fn.on('<event>', handler)
instead will suffice, eg
Examples of incorrect code for this rule:
$('.foo').error(handler)
$('.foo').find('.bar').error(handler)
jQuery('.foo').error(handler)
$foo.error(handler)
$('.foo').load(handler)
$('.foo').unload(handler)
Examples of correct code for this rule:
$('.foo').on('error', handler)
$('.foo').find('.bar').on('error', handler)
jQuery('.foo').on('error', handler)
$foo.on('error', handler)
$('.foo').on('load', handler)
$('.foo').on('unload', handler)
Further reading:
- JQMIGRATE: jQuery.fn.error() is deprecated
- JQMIGRATE: jQuery.fn.load() is deprecated
- JQMIGRATE: jQuery.fn.unload() is deprecated
.error()
.load()
.unload()
.on()
Included in 46 configs
- v1.9
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: jQuery.fn.die() is deprecated
.die()
was removed in jQuery 1.9 - use .off()
instead.
Examples of incorrect code for this rule:
$('.something').die('click')
Examples of correct code for this rule:
$('body').off('click', '.something')
Further reading:
Included in 46 configs
- v1.9
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: 'ready' event is deprecated
Cause: Using one of jQuery's API methods to bind a "ready" event, e.g. $( document ).on( "ready", fn )
, will cause the function to be called when the document is ready, but only if it is attached before the browser fires its own DOMContentLoaded
event. That makes it unreliable for many uses, particularly ones where jQuery or its plugins are loaded asynchronously after page load.
Solution: Replace any use of $( document ).on( "ready", fn )
with $( document ).ready( fn )
or more simply, just $( fn )
. These alternative methods work reliably even when the document is already loaded.
Examples of incorrect code for this rule:
$(document).on("ready", callback)
Examples of correct code for this rule:
$(document).ready(callback)
$(callback)
Included in 83 configs
- v1.9
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: Use of jQuery.fn.data('events') is deprecated
Prior to 1.9, .data("events") could be used to retrieve jQuery's undocumented internal event data structure for an element if no other code had defined a data element with the name "events". This special case has been removed in 1.9.
There is no public interface to retrieve this internal data structure, and it remains undocumented. The only useful applications might be for debugging. The data is available via jQuery._data("events") but this is not a documented interface.
If this rule is flagging up code where an element is known to have custom data with the name "events", either use a different name to avoid confusion, or disable the rule for that particular piece of code:
$('.foo').data('events', 'my-custom-event-data')
// ...snip...
// eslint-disable-next-line jquery-compat/no-fn-data-events
var customEventData = $('.foo').data('events')
Examples of incorrect code for this rule:
$('.foo').data('events')
Examples of correct code for this rule:
$('.foo').data('custom-events')
Further reading:
Included in 83 configs
- v1.9
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: jQuery.fn.size() is deprecated; use the .length property
The .size() method returns the number of elements in the current jQuery object, but duplicates the more-efficient .length property which provides the same functionality. As of jQuery 1.9 the .length property is the preferred way to retrieve this value.
Solution: Replace any use of .size() with .length.
Examples of incorrect code for this rule:
$('.foo').size()
Examples of correct code for this rule:
$('.foo').length
Further reading:
Included in 83 configs
- v1.9
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: jQuery.event.handle is undocumented and deprecated
Cause: jQuery.event.handle
was never documented, and deprecated with jQuery 1.7 (see http://forum.jquery.com/topic/deprecated-event-properties-used-in-jquery). As of jQuery 1.9, it has been removed.
Solution: Use documented jQuery APIs, such as .trigger
.
Examples of incorrect code for this rule:
jQuery.event.handle
Examples of correct code for this rule:
(none provided)
Further reading:
Included in 83 configs
- v1.9
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: Global events are undocumented and deprecated
Cause: jQuery 1.9 does not support globally triggered events. The only documented global events were the AJAX events and they are now triggered only on document
as discussed above. jQuery never provided a documented interface for outside code to trigger global events.
Solution: Change the program to avoid the use of global events. The jQuery Migrate plugin warns about this case but does not restore the previous behavior since it was undocumented.
Examples of incorrect code for this rule:
$.event.trigger(/*...*/)
Examples of correct code for this rule:
(none provided)
Included in 83 configs
- v1.9
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: 'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'
Cause: Until jQuery 1.9, the string "hover" was allowed as an alias for the string "mouseenter mouseleave" when attaching an event handler. This unusual exception provided no real benefit and prevented the use of the name "hover" as a triggered event. Note: This is not related to the .hover()
method, which has not been deprecated.
Solution: Replace use of the string "hover" with "mouseenter mouseleave" within any .on()
, .bind()
, .delegate()
, or .live()
event binding method.
Examples of incorrect code for this rule:
$foo.on("hover", callback)
Examples of correct code for this rule:
$foo.on("mouseenter mouseleave", inOutCallback)
$foo.on("mouseenter", inCallback)
$foo.hover(inCallback, outCallback)
$foo.hover(inOutCallback)
Further reading:
Included in 83 configs
- v1.9
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: jQuery.fn.live() is deprecated
.live()
was removed in jQuery 1.9 - use .on()
instead.
Examples of incorrect code for this rule:
$('.something').live('click', function() {})
Examples of correct code for this rule:
$('body').on('click', '.something', function() {})
Further reading:
Included in 46 configs
- v1.9
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
$.param no longer encodes null/undefined
Cause: jQuery.param()
(used to build query string parameters in $.ajax
) no longer encodes null
or undefined
as strings; in stead it encodes them as empty strings.
Solution: Rewrite any code that passes null
or undefined
to $.param
or $.ajax
to pass these as strings, or omit them, as appropriate.
Examples of incorrect code for this rule:
$.param({ foo: null, bar: undefined, baz: 42 })
Examples of correct code for this rule:
$.param({ foo: "null", bar: "undefined", baz: 42 })
$.param({ baz: 42 })
Further reading:
Included in 83 configs
- v1.9
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: jQuery.parseJSON requires a valid JSON string
As of jQuery 1.9+ $.parseJSON
is identical to native JSON.parse
and will not
attempt to "fix" invalid JSON.
To retain the old behaviour and "fix" invalid falsy behaviour, use:
JSON.parse(input || 'null')
Examples of incorrect code for this rule:
$.parseJSON(input)
jQuery.parseJSON(input)
Examples of correct code for this rule:
JSON.parse(input)
JSON.parse(input || 'null')
Further reading:
Included in 83 configs
- v1.9
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: AJAX events should be attached to document
Cause: As of jQuery 1.9, the global AJAX events (ajaxStart, ajaxStop, ajaxSend, ajaxComplete, ajaxError, and ajaxSuccess) are only triggered on the document
element.
Solution: Change the program to listen for the AJAX events on the document.
Examples of incorrect code for this rule:
$("#status").ajaxStart(function(){ $(this).text("Ajax started"); });
Examples of correct code for this rule:
$(document).ajaxStart(function(){ $("#status").text("Ajax started"); });
Further reading:
Included in 83 configs
- v1.9
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: jQuery.sub() is deprecated
Cause: The jQuery.sub()
method provided an imperfect way for a plugin to isolate itself from changes to the jQuery
object. Due to its shortcomings, it was deprecated in version 1.8 and removed in 1.9.
Solution: Rewrite the code that depends on jQuery.sub()
, use the minified production version of the jQuery Migrate plugin to provide the functionality, or extract the jQuery.sub()
method from the plugin's source and use it in the application.
Examples of incorrect code for this rule:
$.sub(/*...*/)
Examples of correct code for this rule:
(none provided)
Further reading:
Included in 1 configs
- v1.9
JQMIGRATE: jQuery.swap() is undocumented and deprecated
Cause: The jQuery.swap()
method temporarily exchanges a set of CSS properties. It was never documented as part of jQuery's public API and should not be used because it can cause performance problems due to forced layout.
Solution: Rework the code to avoid calling jQuery.swap()
, or explicitly set and restore the properties you need to change.
Examples of incorrect code for this rule:
$.swap(/*...*/)
Examples of correct code for this rule:
(none provided)
Further reading:
Included in 83 configs
- v1.9
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: `jQuery.fn.toggle(handler, handler...)` is deprecated
There are two completely different meanings for the .toggle() method. The use of .toggle() to show or hide elements is not affected. The use of .toggle() as a specialized click handler was deprecated in 1.8 and removed in 1.9.
Rewrite the code that depends on
Examples of incorrect code for this rule:
$('.foo').toggle(function() {
console.log('.foo first click handler')
}, function() {
console.log('.foo second click handler')
})
Examples of correct code for this rule:
$('.foo').toggle(1000, function() {
console.log('.foo animation done')
})
Further reading:
- JQMIGRATE: jQuery.fn.toggle(handler, handler...) is deprecated
.toggle() (event)
.toggle() (animation)
Included in 83 configs
- v1.9
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: `$(html)` text after last tag is ignored
HTML strings passed to $() should begin and end with tags. Any text following the last tag is ignored. When upgrading to jQuery 1.9 and using $.parseHTML(), note that leading or trailing text is not ignored, and those text nodes will be part of the data returned.
Usually this warning is due to an error in the HTML string, where text is
present when it should not be there. Remove the leading or trailing text before
passing the string to
Examples of incorrect code for this rule:
$('<h1>foo</h1>bar')
$('<h1>foo</h1>' + 'bar')
var text = '<h1>foo</h1>bar'
$(text)
var text = '<h1>foo</h1>' + 'bar'
$(text)
Examples of correct code for this rule:
$('<h1>foo</h1>')
$('<h1>foo</h1>' + '<h2>bar</h2>')
var text = '<h1>foo</h1>'
$(text)
Further reading:
Included in 83 configs
- v1.9
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: Attribute selector with '#' must be quoted
Selectors such as a[href=#main] are not valid CSS syntax because the value contains special characters that are not quoted. Until jQuery 1.11.3/2.1.4 this was accepted, but the behavior is non-standard and was never documented. In later versions this selector throws an error. In some cases with complex selectors, Migrate may not attempt a repair. In those cases a fatal error will be logged on the console and you will need to fix the selector manually.
Put quotes around any attribute values that have special characters, e.g. a[href="#main"]. The warning message contains the selector that caused the problem, use that to find the selector in the source files.
Examples of incorrect code for this rule:
$('[href=#main]')
var selector = '[href=#main']
Examples of correct code for this rule:
$('[href="#main"]')
var selector = '[href="#main"]'
Further reading:
Included in 83 configs
- v1.9
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
JQMIGRATE: 'hover' pseudo-event is deprecated, use 'mouseenter mouseleave' (JMVC)
jQuery 1.9+ no longer supports the 'hover' event name. In stead, it expects 'mouseenter' or 'mouseleave'.
This rule ensures JMVC event listeners do not rely on the 'hover' event.
Examples of incorrect code for this rule:
$.Controller('MyController', {
}, {
"div.something hover": function() { /* ...snip... */ }
})
Examples of correct code for this rule:
$.Controller('MyController', {
}, {
"div.something mouseenter": function() { /* ...snip... */ },
"div.something mouseleave": function() { /* ...snip... */ }
})
Included in 83 configs
- jmvc
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
Disallow trailing commas after jQuery selectors in JMVC event listeners
jQuery 1.9+ will throw a parsing error if a selector contains a trailing comma.
This rule ensures JMVC event listeners do not have a trailing comma after the selector.
Examples of incorrect code for this rule:
$.Controller('MyController', {
}, {
"div.something, click": function() { /* ...snip... */ }
})
Examples of correct code for this rule:
$.Controller('MyController', {
}, {
"div.something click": function() { /* ...snip... */ }
})
$.Controller('MyController', {
}, {
"div.something,div.another click": function() { /* ...snip... */ }
})
Included in 83 configs
- jmvc
- fixable-from-v1.0.0
- fixable-from-v1.0.1
- fixable-from-v1.0.2
- fixable-from-v1.0.3
- fixable-from-v1.0.4
- fixable-from-v1.1.0
- fixable-from-v1.1.1
- fixable-from-v1.1.2
- fixable-from-v1.1.3
- fixable-from-v1.1.4
- fixable-from-v1.2.0
- fixable-from-v1.2.1
- fixable-from-v1.2.2
- fixable-from-v1.2.3
- fixable-from-v1.2.4
- fixable-from-v1.2.5
- fixable-from-v1.2.6
- fixable-from-v1.3.0
- fixable-from-v1.3.0
- fixable-from-v1.3.1
- fixable-from-v1.3.2
- fixable-from-v1.4.0
- fixable-from-v1.4.0
- fixable-from-v1.4.1
- fixable-from-v1.4.2
- fixable-from-v1.4.3
- fixable-from-v1.4.4
- fixable-from-v1.5.0
- fixable-from-v1.5.0
- fixable-from-v1.5.1
- fixable-from-v1.5.2
- fixable-from-v1.6.0
- fixable-from-v1.6.0
- fixable-from-v1.6.1
- fixable-from-v1.6.2
- fixable-from-v1.6.3
- fixable-from-v1.6.4
- fixable-from-v1.7.0
- fixable-from-v1.7.0
- fixable-from-v1.7.1
- fixable-from-v1.7.2
- fixable-from-v1.8.0
- fixable-from-v1.8.1
- fixable-from-v1.8.2
- fixable-from-v1.8.3
- fixable-from-v1.9.0
- fixable-from-v1.9.1
- fixable-from-v1.10.0
- fixable-from-v1.10.1
- fixable-from-v1.10.2
- fixable-from-v1.11.0
- fixable-from-v1.11.1
- fixable-from-v1.11.2
- fixable-from-v1.11.3
- fixable-from-v1.12.0
- fixable-from-v1.12.1
- fixable-from-v1.12.2
- fixable-from-v1.12.3
- fixable-from-v1.12.4
- fixable-from-v2.0.0
- fixable-from-v2.0.1
- fixable-from-v2.0.2
- fixable-from-v2.0.3
- fixable-from-v2.1.0
- fixable-from-v2.1.1
- fixable-from-v2.1.2
- fixable-from-v2.1.3
- fixable-from-v2.1.4
- fixable-from-v2.2.0
- fixable-from-v2.2.1
- fixable-from-v2.2.2
- fixable-from-v2.2.3
- fixable-from-v2.2.4
- fixable-from-v3.0.0
- fixable-from-v3.1.0
- fixable-from-v3.1.1
- fixable-from-v3.2.0
- fixable-from-v3.2.1
- fixable-from-v3.3.0
- fixable-from-v3.3.1
- fixable-from-v3.4.0
- fixable-from-v3.4.1
- Run tests with
npm run test
- Please format commits using the conventional commit format
- Releases are handled by semantic-release via travis-ci
- Regenerate this readme by running
node ./build/generate-readme.js