每当我在重构时更改导出的成员名称时,我都会在编辑器(Visual Studio Code)中得到一个Module "x" has no exported member "y"。这非常方便,因为它帮助我知道哪些文件导入了导出的成员。但不幸的是,这个错误只出现在当前打开的文件中。 是的,我知道我可以重命名这个符号,这应该会改变引用它的每个文件。但我不会到处使用Visual Studio代码,我也不想依赖IDE linter来告诉我需要在哪里修复问题。我也希望在ESLint命令行界面输出中启用此功能。正因为如此,编辑器向我展示的内容才是对等的。 有关此错误在VSCo
ESLint似乎无法解析".eslintrc.js“文件。
复制步骤:我设置了一个新的"hello world“TypeScript项目,如下所示:
# Make a new directory for our new project
mkdir test
# Go into the new directory
cd test
# Create a "package.json" file
npm init --yes
# Install TypeScript
npm install typescript --save-dev
# Install ESLint (
我的设置
我使用的是和vim。ESLint可执行文件和选项文件(.eslintrc.js)在~/.vimrc中配置
let g:ale_javascript_eslint_executable="/usr/local/bin/eslint"
let g:ale_javascript_eslint_options="-c /Users/adam/team-standard/.eslintrc.js"
...
let g:ale_linters = {
我有以下存储库结构:
cypress文件夹
.eslintrc.jstsconfig.jsonbasic.spec.ts
src文件夹
.eslintrc.js
tsconfig.base.json
tsconfig.json
我的目的是只为src文件夹设置根src,.eslintrc.js也是如此。然后,我尝试为tsconfig.json文件夹配置.eslintrc.js和cypress文件夹。但是,在运行ESLint时会出现以下错误:
Parsing error: "parserOptions.project" has been set for @typescript-es