我创建了一个新的 React Native 项目 --template typescript
我删除了template作为样板文件一部分的目录。
然后我继续添加 ESLint:
module.exports = {
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
extends: ["airbnb-typescript-prettier"]
};
Run Code Online (Sandbox Code Playgroud)
但是,当我打开时babel.config.js,出现此错误
解析错误:已为@typescript-eslint/parser 设置了“parserOptions.project”。
该文件与您的项目配置不匹配:
/Users/Dan/site/babel.config.js.该文件必须至少包含在提供的项目之一中。eslint