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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-no-jquery",
3
- "version": "4.0.0",
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": ">=20"
30
+ "node": ">=24"
31
31
  },
32
32
  "peerDependencies": {
33
- "eslint": ">=8.0.0 <9.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",
@@ -12,7 +12,15 @@ module.exports = utils.createUtilMethodRule(
12
12
  node.arguments.length >= 2 &&
13
13
  node.arguments[ 1 ].type !== 'Literal'
14
14
  ) {
15
- const fnText = context.getSourceCode().getText( node.arguments[ 0 ] );
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( [
@@ -27,8 +27,7 @@ module.exports = {
27
27
  }
28
28
  ],
29
29
  defaultOptions: [
30
- { allowPositional: false },
31
- { allowOther: false }
30
+ { allowPositional: false, allowOther: false }
32
31
  ]
33
32
  },
34
33