npm run lint
TypeError: Error while loading rule '@typescript-eslint/no-unused-expressions': Cannot read properties of undefined (reading 'allowShortCircuit')
Occurred while linting /path-to-project/cdk/bin/cdk.ts
at Object.create (/path-to-project/node_modules/eslint/lib/rules/no-unused-expressions.js:75:13)
at create (/path-to-project/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.js:28:32)
...
重新安装所有节点模块(RM -RF node_modules && npm install)
使用兼容版本安装了所有相关软件包(@typecript-eslint/eslint-plugin,eslint及其配置) 有人对可能导致此问题的原因有什么建议,或者如何进一步调试?
// ref: https://typescript-eslint.io/getting-started/
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
export default tseslint.config(eslint.configs.recommended, ...tseslint.configs.recommended, {
ignores: ['node_modules/', 'dist/', 'cdk.out/', 'build/'],
});
提前感谢您的帮助!
我有同样的问题。 trone this:npm update eslint @typescript-eslint/eslint-plugin @typescript-eslint/parser
然后