ts项目中const时报错
ESLint: Cannot read properties of undefined (reading 'loc') Occurred while linting xxx
每次一写const,右下角马上弹出。
原因是没使用@typescript-eslint/indent插件,把indent换成@typescript-eslint/indent即可。
.eslintrc.cjs文件中修改
- 'indent': [
+ '@typescript-eslint/indent': [
'error',
4
],
