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

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

Open
crgwbr opened this issue Feb 20, 2024 · 0 comments
Open

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

crgwbr opened this issue Feb 20, 2024 · 0 comments
Assignees

Comments

@crgwbr
Copy link

crgwbr commented Feb 20, 2024

Parsing code like this in a .vue file:

defineProps<{
    foo: MyType;
}>();

Results in a type error:

Oops! Something went wrong! :(

ESLint: 8.56.0

TypeError: Cannot read properties of undefined (reading 'loc')
Occurred while linting FOO.vue:21
Rule: "@silvermine/silvermine/call-indentation"
    at validateCallIndentation (<FOO>/node_modules/@silvermine/eslint-plugin-silvermine/lib/rules/call-indentation.js:34:51)
    at CallExpression (<FOO>/node_modules/@silvermine/eslint-plugin-silvermine/lib/rules/call-indentation.js:140:13)
    at ruleErrorHandler (<FOO>/node_modules/eslint/lib/linter/linter.js:1076:28)
    at <FOO>/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (<FOO>/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (<FOO>/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (<FOO>/node_modules/eslint/lib/linter/node-event-generator.js:326:22)
    at NodeEventGenerator.enterNode (<FOO>/node_modules/eslint/lib/linter/node-event-generator.js:340:14)
    at CodePathAnalyzer.enterNode (<FOO>/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:803:23)

It seems that lib/rules/call-indentation.js#L29-L30 fails to consider the possibility that a multi-line call does not have any arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants