-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* MC-41858: Eslint jQuery migration tests * MC-41858: Updated eslint jQuery configuration * MC-41858: Fixed eslint jQuery static tests * MC-41858: Fixed eslint jQuery static tests * MC-41858: Fixed eslint jQuery static tests * MC-41858: Fixed eslint jQuery static tests
- Loading branch information
1 parent
95445b3
commit 979c0f7
Showing
35 changed files
with
302 additions
and
54 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
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
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
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
5 changes: 3 additions & 2 deletions
5
dev/tests/static/testsuite/Magento/Test/Js/_files/eslint/.eslintrc
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,6 +1,7 @@ | ||
{ | ||
"extends": [ | ||
"./.eslintrc-reset", | ||
"./.eslintrc-magento" | ||
"./.eslintrc-magento", | ||
"./.eslintrc-jquery" | ||
] | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
dev/tests/static/testsuite/Magento/Test/Js/_files/eslint/.eslintrc-jquery
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 @@ | ||
{ | ||
"rules": { | ||
"jquery-no-andSelf": 2, | ||
"jquery-no-bind-unbind": 2, | ||
"jquery-no-click-event-shorthand": 2, | ||
"jquery-no-delegate-undelegate": 2, | ||
"jquery-no-event-shorthand": 2, | ||
"jquery-no-size": 2, | ||
"jquery-no-trim": 2 | ||
} | ||
} |
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
26 changes: 26 additions & 0 deletions
26
dev/tests/static/testsuite/Magento/Test/Js/_files/eslint/rules/jquery/jquery-no-andSelf.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,26 @@ | ||
'use strict' | ||
|
||
const utils = require('./utils.js') | ||
|
||
module.exports = { | ||
meta: { | ||
docs: {}, | ||
schema: [] | ||
}, | ||
|
||
create: function(context) { | ||
return { | ||
CallExpression: function(node) { | ||
if (node.callee.type !== 'MemberExpression') return | ||
if (node.callee.property.name !== 'andSelf') return | ||
|
||
if (utils.isjQuery(node)) { | ||
context.report({ | ||
node: node, | ||
message: 'jQuery.andSelf() removed, use jQuery.addBack()' | ||
}) | ||
} | ||
} | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...ests/static/testsuite/Magento/Test/Js/_files/eslint/rules/jquery/jquery-no-bind-unbind.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,26 @@ | ||
'use strict' | ||
|
||
const utils = require('./utils.js') | ||
|
||
module.exports = { | ||
meta: { | ||
docs: {}, | ||
schema: [] | ||
}, | ||
|
||
create: function(context) { | ||
return { | ||
CallExpression: function(node) { | ||
if (node.callee.type !== 'MemberExpression') return | ||
if (!['bind', 'unbind'].includes(node.callee.property.name)) return | ||
|
||
if (utils.isjQuery(node)) { | ||
context.report({ | ||
node: node, | ||
message: 'jQuery $.bind and $.unbind are deprecated, use $.on and $.off instead' | ||
}) | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.