@starci/eslint-canon-fe 3.0.1 → 3.0.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.
Files changed (2) hide show
  1. package/class-names.mjs +2 -1
  2. package/package.json +1 -1
package/class-names.mjs CHANGED
@@ -11,7 +11,8 @@ const isCn = (node) => node?.type === "Identifier" && node.name === "cn"
11
11
 
12
12
  const importedClassNames = (context) => {
13
13
  const imports = new Set()
14
- for (const statement of context.getSourceCode().ast.body) {
14
+ const sourceCode = context.sourceCode || context.getSourceCode()
15
+ for (const statement of sourceCode.ast.body) {
15
16
  if (statement.type !== "ImportDeclaration" || statement.source.value !== "./classNames") continue
16
17
  for (const specifier of statement.specifiers) imports.add(specifier.local.name)
17
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starci/eslint-canon-fe",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "The StarCi front-end lint canon: every rule its laws publish, gathered as one flat-config plugin.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",