eslint-plugin-no-jquery 4.0.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +13 -3
- package/src/rules/no-proxy.js +9 -1
- package/src/rules/no-sizzle.js +1 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-no-jquery",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Disallow jQuery functions with native equivalents.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,13 +27,23 @@
|
|
|
27
27
|
"src"
|
|
28
28
|
],
|
|
29
29
|
"engine": {
|
|
30
|
-
"node": ">=
|
|
30
|
+
"node": ">=24"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"eslint": ">=8.0.0
|
|
33
|
+
"eslint": ">=8.0.0",
|
|
34
|
+
"oxlint": ">=1.52.0"
|
|
35
|
+
},
|
|
36
|
+
"peerDependenciesMeta": {
|
|
37
|
+
"eslint": {
|
|
38
|
+
"optional": true
|
|
39
|
+
},
|
|
40
|
+
"oxlint": {
|
|
41
|
+
"optional": true
|
|
42
|
+
}
|
|
34
43
|
},
|
|
35
44
|
"devDependencies": {
|
|
36
45
|
"codecov": "^3.8.3",
|
|
46
|
+
"eslint": "^8.57.1",
|
|
37
47
|
"eslint-config-wikimedia": "^0.32.3",
|
|
38
48
|
"eslint-docgen": "^0.7.1",
|
|
39
49
|
"eslint-plugin-eslint-plugin": "^6.5.0",
|
package/src/rules/no-proxy.js
CHANGED
|
@@ -12,7 +12,15 @@ module.exports = utils.createUtilMethodRule(
|
|
|
12
12
|
node.arguments.length >= 2 &&
|
|
13
13
|
node.arguments[ 1 ].type !== 'Literal'
|
|
14
14
|
) {
|
|
15
|
-
|
|
15
|
+
// check can be removed when ESLint v8 support is dropped,
|
|
16
|
+
// as `context.sourceCode` will always be defined.
|
|
17
|
+
// `getSourceCode` is deprecated in ESLint v9, and removed in ESLint v10,
|
|
18
|
+
// so we need to support both APIs for now.
|
|
19
|
+
// istanbul ignore next
|
|
20
|
+
const sourceCode = context.sourceCode !== undefined ?
|
|
21
|
+
context.sourceCode :
|
|
22
|
+
context.getSourceCode();
|
|
23
|
+
const fnText = sourceCode.getText( node.arguments[ 0 ] );
|
|
16
24
|
return [
|
|
17
25
|
fixer.replaceText( node.callee, fnText + '.bind' ),
|
|
18
26
|
fixer.removeRange( [
|