"Cannot read property of 'loc' of undefined" when typing "const"
See original GitHub issueTell us about your environment
- ESLint Version: 6.8.0
- Node Version: 14.15.3
- npm Version: 6.14.10
What parser (default, @babel/eslint-parser
, @typescript-eslint/parser
, etc.) are you using?
parser: ‘@typescript-eslint/parser’,
Please show your full configuration:
Configuration
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/vue3-essential',
'@vue/airbnb',
'@vue/typescript/recommended',
],
parserOptions: {
ecmaVersion: 2020,
parser: '@typescript-eslint/parser',
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
},
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)',
],
env: {
jest: true,
},
},
],
};
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
When typing const
, VScode is returning the following error:
ESLint: Cannot read property 'loc' of undefined Occurred while linting /xxx.ts:1. at Object.VariableDeclaration [as listener] (/xxx/node_modules/eslint/lib/rules/indent.js:1384:69)
What did you expect to happen? No error message. Apparently this was also an issue a few years ago (issue 441).
What actually happened? Please include the actual, raw output from ESLint.
ESLint: Cannot read property 'loc' of undefined Occurred while linting /xxx.ts:1. at Object.VariableDeclaration [as listener] (/xxx/node_modules/eslint/lib/rules/indent.js:1384:69)
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
This worked. Thank you!
The problem is still not solved.