eslint-plugin-svelte 2.20.0 → 2.20.2

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.
@@ -55,6 +55,9 @@ exports.default = (0, utils_1.createRule)("block-lang", {
55
55
  type: "suggestion",
56
56
  },
57
57
  create(context) {
58
+ if (!context.parserServices.isSvelte) {
59
+ return {};
60
+ }
58
61
  const enforceScriptPresent = context.options[0]?.enforceScriptPresent ?? false;
59
62
  const enforceStylePresent = context.options[0]?.enforceStylePresent ?? false;
60
63
  const scriptOption = context.options[0]?.script ?? null;
@@ -5,7 +5,7 @@ const utils_1 = require("../utils");
5
5
  const ast_utils_1 = require("../utils/ast-utils");
6
6
  const svelte_eslint_parser_1 = require("svelte-eslint-parser");
7
7
  function extractTickReferences(context) {
8
- const referenceTracker = new eslint_utils_1.ReferenceTracker(context.getScope());
8
+ const referenceTracker = new eslint_utils_1.ReferenceTracker(context.getSourceCode().scopeManager.globalScope);
9
9
  const a = referenceTracker.iterateEsmReferences({
10
10
  svelte: {
11
11
  [eslint_utils_1.ReferenceTracker.ESM]: true,
@@ -22,7 +22,7 @@ function extractTickReferences(context) {
22
22
  });
23
23
  }
24
24
  function extractTaskReferences(context) {
25
- const referenceTracker = new eslint_utils_1.ReferenceTracker(context.getScope());
25
+ const referenceTracker = new eslint_utils_1.ReferenceTracker(context.getSourceCode().scopeManager.globalScope);
26
26
  const a = referenceTracker.iterateGlobalReferences({
27
27
  setTimeout: { [eslint_utils_1.ReferenceTracker.CALL]: true },
28
28
  setInterval: { [eslint_utils_1.ReferenceTracker.CALL]: true },
@@ -5,7 +5,7 @@ const eslint_utils_1 = require("eslint-utils");
5
5
  const ts_utils_1 = require("../../utils/ts-utils");
6
6
  const ast_utils_1 = require("../../utils/ast-utils");
7
7
  function* extractStoreReferences(context, storeNames = ["writable", "readable", "derived"]) {
8
- const referenceTracker = new eslint_utils_1.ReferenceTracker(context.getScope());
8
+ const referenceTracker = new eslint_utils_1.ReferenceTracker(context.getSourceCode().scopeManager.globalScope);
9
9
  for (const { node, path } of referenceTracker.iterateEsmReferences({
10
10
  "svelte/store": {
11
11
  [eslint_utils_1.ReferenceTracker.ESM]: true,
@@ -29,7 +29,7 @@ exports.default = (0, utils_1.createRule)("require-event-dispatcher-types", {
29
29
  if (!isTs) {
30
30
  return;
31
31
  }
32
- const referenceTracker = new eslint_utils_1.ReferenceTracker(context.getScope());
32
+ const referenceTracker = new eslint_utils_1.ReferenceTracker(context.getSourceCode().scopeManager.globalScope);
33
33
  for (const { node: n } of referenceTracker.iterateEsmReferences({
34
34
  svelte: {
35
35
  [eslint_utils_1.ReferenceTracker.ESM]: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-svelte",
3
- "version": "2.20.0",
3
+ "version": "2.20.2",
4
4
  "description": "ESLint plugin for Svelte using AST",
5
5
  "repository": "git+https://github.com/ota-meshi/eslint-plugin-svelte.git",
6
6
  "homepage": "https://ota-meshi.github.io/eslint-plugin-svelte",