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

Bug: (TypeError: Cannot read properties of undefined (reading 'loc')) #16219

Closed
1 task
c10342 opened this issue Aug 19, 2022 · 2 comments
Closed
1 task

Bug: (TypeError: Cannot read properties of undefined (reading 'loc')) #16219

c10342 opened this issue Aug 19, 2022 · 2 comments
Labels
3rd party plugin This is an issue related to a 3rd party plugin, config, or parser archived due to age This issue has been archived; please open a new issue for any further discussion
Projects

Comments

@c10342
Copy link

c10342 commented Aug 19, 2022

Environment

Node version: v16.15.1
npm version: v8.17.0
Local ESLint version: v8.22.0
Global ESLint version: Not found
Operating System: win32 10.0.22000

What parser are you using?

@typescript-eslint/parser

What did you do?

Configuration
<!-- Paste your configuration here -->
<!-- Paste your code here -->

What did you expect to happen?

There should be no errors

What actually happened?

when i input const,the following error will appear

1660891456(1)

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

I am using vscode and eslint. When I enter const in the TS file, an error will be reported。

The error occurred on the node_ modules\eslint\lib\rules\indent.js,line 1513

I tried to fix it

if (node.declarations[node.declarations.length - 1]?.loc.start.line > node.loc.start.line) { }

Then this error will not occur

@c10342 c10342 added bug ESLint is working incorrectly repro:needed labels Aug 19, 2022
@eslint-github-bot eslint-github-bot bot added this to Needs Triage in Triage Aug 19, 2022
@joaomaranhao
Copy link

You can add a rule to your eslint configuration file that solves that issue.

rules: {
"indent": "off"
}

@mdjermanovic mdjermanovic moved this from Needs Triage to Triaging in Triage Aug 22, 2022
@mdjermanovic mdjermanovic added 3rd party plugin This is an issue related to a 3rd party plugin, config, or parser and removed bug ESLint is working incorrectly repro:needed labels Aug 22, 2022
@mdjermanovic
Copy link
Member

Duplicate of #14538

This is an issue with @typescript-eslint/parser that allows invalid syntax: typescript-eslint/typescript-eslint#1852

@c10342 until this is fixed in @typescript-eslint/parser, you can configure the indent rule as described in #14538 (comment) to avoid these errors.

@mdjermanovic mdjermanovic closed this as not planned Won't fix, can't repro, duplicate, stale Aug 22, 2022
Triage automation moved this from Triaging to Complete Aug 22, 2022
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Feb 19, 2023
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3rd party plugin This is an issue related to a 3rd party plugin, config, or parser archived due to age This issue has been archived; please open a new issue for any further discussion
Projects
Archived in project
Triage
Complete
Development

No branches or pull requests

3 participants