diff --git a/package-lock.json b/package-lock.json index e9dd84061..7479f63a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1319,9 +1319,9 @@ "dev": true }, "node_modules/@types/react": { - "version": "18.2.55", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.55.tgz", - "integrity": "sha512-Y2Tz5P4yz23brwm2d7jNon39qoAtMMmalOQv6+fEFt1mT+FcM3D841wDpoUvFXhaYenuROCy3FZYqdTjM7qVyA==", + "version": "18.2.56", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.56.tgz", + "integrity": "sha512-NpwHDMkS/EFZF2dONFQHgkPRwhvgq/OAvIaGQzxGSBmaeR++kTg6njr15Vatz0/2VcCEwJQFi6Jf4Q0qBu0rLA==", "dev": true, "dependencies": { "@types/prop-types": "*", @@ -7430,6 +7430,7 @@ "dependencies": { "@file-services/node": "^8.3.3", "@stylable/core": "^5.16.0", + "@typescript-eslint/scope-manager": "^7.0.1", "@typescript-eslint/utils": "^7.0.1", "postcss-safe-parser": "^7.0.0" } diff --git a/packages/eslint-plugin-stylable/package.json b/packages/eslint-plugin-stylable/package.json index 60c7528ca..f43ec3504 100644 --- a/packages/eslint-plugin-stylable/package.json +++ b/packages/eslint-plugin-stylable/package.json @@ -15,6 +15,7 @@ "@file-services/node": "^8.3.3", "@stylable/core": "^5.16.0", "@typescript-eslint/utils": "^7.0.1", + "@typescript-eslint/scope-manager": "^7.0.1", "postcss-safe-parser": "^7.0.0" }, "keywords": [ diff --git a/packages/eslint-plugin-stylable/src/stylable-es-lint.ts b/packages/eslint-plugin-stylable/src/stylable-es-lint.ts index a2149508b..b45707466 100644 --- a/packages/eslint-plugin-stylable/src/stylable-es-lint.ts +++ b/packages/eslint-plugin-stylable/src/stylable-es-lint.ts @@ -8,6 +8,7 @@ import { ASTUtils, TSESTree as esTree, } from '@typescript-eslint/utils'; +import { DefinitionType } from '@typescript-eslint/scope-manager'; import { createRequire } from 'node:module'; import { pathToFileURL } from 'node:url'; @@ -78,8 +79,9 @@ export default createRule({ return; } const { type } = varDefs.defs[varDefs.defs.length - 1]; - // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison - return local.name === varDefs.name && type === 'ImportBinding'; + return ( + local.name === varDefs.name && type === DefinitionType.ImportBinding + ); }); if (!variable) {