我有一个使用 eslint 和 prettier 设置的 Angular 10 应用程序,到目前为止它可以很好地处理 Typescript 文件。我现在正在尝试按照此文档整理我的组件模板文件。
但是当我运行它时,eslint . --ext .js,.ts,.component.html --fix我不断得到
Error while loading rule '@typescript-eslint/dot-notation': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.
Run Code Online (Sandbox Code Playgroud)
我的.eslintrc.js看起来像这样(注意本overrides节中的第二个块):
module.exports = {
extends: [
"plugin:@angular-eslint/recommended",
// For spec files
"plugin:jasmine/recommended",
// AirBnB Styleguide rules
"airbnb-typescript/base",
// Settings for Prettier
"prettier/@typescript-eslint",
"plugin:prettier/recommended",
],
plugins: [
"prettier",
"jasmine",
], …Run Code Online (Sandbox Code Playgroud)