Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-invalid-this issue exception after upgrading to eslint 8.7.0 #4444

Closed
3 tasks done
doberkofler opened this issue Jan 16, 2022 · 2 comments · Fixed by #4448
Closed
3 tasks done

no-invalid-this issue exception after upgrading to eslint 8.7.0 #4444

doberkofler opened this issue Jan 16, 2022 · 2 comments · Fixed by #4448
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@doberkofler
Copy link
Contributor

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

{
  "rules": {
    "@typescript-eslint/no-invalid-this": "warn"
  }
}
export function buttonChangeAddress(callback: UiButtonCallbackType): string { // eslint-disable-line promise/prefer-await-to-callbacks

Expected Result

no error thrown

Actual Result

After upgrading to eslint 8.7.0!

> eslint --cache --report-unused-disable-directives "./**/*.{js,jsx,ts,tsx}"


Oops! Something went wrong! :(

ESLint: 8.7.0

TypeError: rules.FunctionDeclaration is not a function
Occurred while linting /Users/doberkofler/MyDev/ljs_app/trunk/periscope/src/components/addAddressDialog/index.ts:30
Rule: "@typescript-eslint/no-invalid-this"
    at FunctionDeclaration (/Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.js:51:23)
    at ruleErrorHandler (/Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/eslint/lib/linter/linter.js:1079:28)
    at /Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (/Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
    at NodeEventGenerator.enterNode (/Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/eslint/lib/linter/node-event-generator.js:340:14)
    at CodePathAnalyzer.enterNode (/Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:795:23)
    at /Users/doberkofler/MyDev/ljs_app/trunk/periscope/node_modules/eslint/lib/linter/linter.js:1110:32

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 5.9.1
@typescript-eslint/parser 5.9.1
TypeScript 4.5.4
ESLint 8.7.0Z
node 16.13.2
@doberkofler doberkofler added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Jan 16, 2022
@bradzacher bradzacher added bug Something isn't working accepting prs Go ahead, send a pull request that resolves this issue good first issue Good for newcomers help wanted Extra attention is needed and removed triage Waiting for maintainers to take a look labels Jan 16, 2022
@WikiRik
Copy link

WikiRik commented Jan 16, 2022

For the person that has the time to look into this and make a PR; the ESLint PR that caused this issue is eslint/eslint#15495

@doberkofler
Copy link
Contributor Author

Thank you!

Hazmi35 added a commit to Hazmi35/eslint-config that referenced this issue Jan 17, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants