43081j / eslint-plugin-wc

ESLint rules for Web Components
MIT License
98 stars 11 forks source link

TypeError: Cannot read property 'getJSDocComment' of undefined #140

Open adamsr123 opened 1 month ago

adamsr123 commented 1 month ago

Could this be related to the new release?

Error:

[2024-10-07T09:22:37.312Z] > eslint "src/v2" "--quiet"
[2024-10-07T09:22:37.312Z] 
[2024-10-07T09:22:38.815Z] 
[2024-10-07T09:22:38.815Z] Oops! Something went wrong! :(
[2024-10-07T09:22:38.815Z] 
[2024-10-07T09:22:38.815Z] ESLint: 7.32.0
[2024-10-07T09:22:38.815Z] 
[2024-10-07T09:22:38.815Z] TypeError: Cannot read property 'getJSDocComment' of undefined
[2024-10-07T09:22:38.815Z] Occurred while linting /app/client/src/v2/app/components/admin-config/admin-config.js:6
[2024-10-07T09:22:38.815Z]     at ClassDeclaration,ClassExpression (/app/client/node_modules/eslint-plugin-wc/lib/rules/no-constructor-attributes.js:113:71)
[2024-10-07T09:22:38.815Z]     at /app/client/node_modules/eslint/lib/linter/safe-emitter.js:45:58
[2024-10-07T09:22:38.815Z]     at Array.forEach (<anonymous>)
[2024-10-07T09:22:38.816Z]     at Object.emit (/app/client/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
[2024-10-07T09:22:38.816Z]     at NodeEventGenerator.applySelector (/app/client/node_modules/eslint/lib/linter/node-event-generator.js:293:26)
[2024-10-07T09:22:38.816Z]     at NodeEventGenerator.applySelectors (/app/client/node_modules/eslint/lib/linter/node-event-generator.js:322:22)
[2024-10-07T09:22:38.816Z]     at NodeEventGenerator.enterNode (/app/client/node_modules/eslint/lib/linter/node-event-generator.js:336:14)
[2024-10-07T09:22:38.816Z]     at CodePathAnalyzer.enterNode (/app/client/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:711:23)
[2024-10-07T09:22:38.816Z]     at /app/client/node_modules/eslint/lib/linter/linter.js:960:32
[2024-10-07T09:22:38.816Z]     at Array.forEach (<anonymous>)
[2024-10-07T09:22:38.816Z]     at runRules (/app/client/node_modules/eslint/lib/linter/linter.js:955:15)
[2024-10-07T09:22:38.816Z]     at Linter._verifyWithoutProcessors (/app/client/node_modules/eslint/lib/linter/linter.js:1181:31)
[2024-10-07T09:22:38.816Z]     at Linter._verifyWithConfigArray (/app/client/node_modules/eslint/lib/linter/linter.js:1280:21)
[2024-10-07T09:22:38.816Z]     at Linter.verify (/app/client/node_modules/eslint/lib/linter/linter.js:1235:25)
[2024-10-07T09:22:38.816Z]     at Linter.verifyAndFix (/app/client/node_modules/eslint/lib/linter/linter.js:1428:29)
[2024-10-07T09:22:38.816Z]     at verifyText (/app/client/node_modules/eslint/lib/cli-engine/cli-engine.js:240:48)
[2024-10-07T09:22:38.816Z]     at CLIEngine.executeOnFiles (/app/client/node_modules/eslint/lib/cli-engine/cli-engine.js:808:28)
[2024-10-07T09:22:38.816Z]     at ESLint.lintFiles (/app/client/node_modules/eslint/lib/eslint/eslint.js:563:23)
[2024-10-07T09:22:38.816Z]     at Object.execute (/app/client/node_modules/eslint/lib/cli.js:301:36)
[2024-10-07T09:22:38.816Z]     at main (/app/client/node_modules/eslint/bin/eslint.js:132:52)
[2024-10-07T09:22:38.816Z]     at Object.<anonymous> (/app/client/node_modules/eslint/bin/eslint.js:136:2)
[2024-10-07T09:22:38.816Z]     at Module._compile (internal/modules/cjs/loader.js:1085:30)
[2024-10-07T09:22:38.816Z]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
[2024-10-07T09:22:38.816Z]     at Module.load (internal/modules/cjs/loader.js:950:32)
[2024-10-07T09:22:38.816Z]     at Function.Module._load (internal/modules/cjs/loader.js:791:14)
[2024-10-07T09:22:38.817Z]     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
[2024-10-07T09:22:38.817Z]     at internal/main/run_main_module.js:17:47
43081j commented 1 month ago

2.2.0 was recently published which requires eslint 8.x. this wasn't a breaking change (i.e. a major version) because we already have code in our rules which rely on 8.x and above

presumably your setup just wasn't hitting that code so far

do you have any option to upgrade from eslint 7.x to 8.x? the jump should be easier than to 9.x

herrbaehrt commented 4 weeks ago

Although you already have code compliant with the rules that relies on version 8.x and above, this change could, will and does potentially break existing implementations that depend on the semver policy, which allows minor version updates.

That said, this release definitely marks a breaking change

43081j commented 4 weeks ago

It really shouldn't have since we already required 8.x and above

That's why we really need an example from you so we can reproduce the problem

If you can reproduce the problem, showing that it works in the older version and now doesn't, at least I can investigate and see if it can be fixed