-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
294 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[//]: # (This file is generated by eslint-docgen. Do not edit it directly.) | ||
|
||
# no-done-fail | ||
|
||
Disallows the [`.done`](https://api.jquery.com/deferred.done/)/[`.fail`](https://api.jquery.com/deferred.fail/) methods. Prefer `.then`. | ||
|
||
📋 This rule is enabled in `plugin:no-jquery/all`. | ||
|
||
## Rule details | ||
|
||
❌ Examples of **incorrect** code: | ||
```js | ||
promise.done( callback ); | ||
promise.fail( callback ); | ||
``` | ||
|
||
✔️ Examples of **correct** code: | ||
```js | ||
promise.then( doneCallback, failCallback ); | ||
done(); | ||
fail(); | ||
``` | ||
|
||
## Resources | ||
|
||
* [Rule source](/src/rules/no-done-fail.js) | ||
* [Test source](/tests/rules/no-done-fail.js) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[//]: # (This file is generated by eslint-docgen. Do not edit it directly.) | ||
|
||
# no-fx | ||
|
||
Disallows `$.fx`. | ||
|
||
📋 This rule is enabled in `plugin:no-jquery/slim`. | ||
|
||
## Rule details | ||
|
||
❌ Examples of **incorrect** code: | ||
```js | ||
$.fx; | ||
$.fx.interval; | ||
$.fx.off; | ||
$.fx.speeds.slow; | ||
$.fx.start(); | ||
``` | ||
|
||
✔️ Examples of **correct** code: | ||
```js | ||
fx; | ||
fx.interval; | ||
a.fx; | ||
``` | ||
|
||
## Resources | ||
|
||
* [Rule source](/src/rules/no-fx.js) | ||
* [Test source](/tests/rules/no-fx.js) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
|
||
const utils = require( '../utils.js' ); | ||
|
||
module.exports = utils.createUniversalMethodRule( | ||
[ 'done', 'fail' ], | ||
( node ) => node === true ? | ||
'Prefer `.then`' : | ||
`Prefer .then to .${ node.callee.property.name }`, | ||
( method ) => `[\`.${ method }\`](https://api.jquery.com/deferred.${ method }/)` | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
|
||
const utils = require( '../utils.js' ); | ||
|
||
module.exports = { | ||
meta: { | ||
type: 'suggestion', | ||
docs: { | ||
description: 'Disallows `$.fx`.' | ||
}, | ||
schema: [] | ||
}, | ||
|
||
create: ( context ) => ( { | ||
MemberExpression: ( node ) => { | ||
if ( | ||
!utils.isjQueryConstructor( context, node.object.name ) || | ||
node.property.name !== 'fx' | ||
) { | ||
return; | ||
} | ||
|
||
context.report( { | ||
node, | ||
message: '$.fx is not allowed' | ||
} ); | ||
} | ||
} ) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// eslint-disable-next-line self/variable-pattern | ||
var foo = $( '.foo' ); | ||
const foo = $( '.foo' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.