eSlint在Vite + React + Typescript中无法正常工作 我在Vite + React +打字条项目上工作,并使用以下配置使用ESLINT: 相关的ESLINT配置(.eslintrc.json) { “扩展”:[ “ Eslint:推荐...

问题描述 投票:0回答:0
(.eslintrc.json)

{ "extends": [ "eslint:recommended", "airbnb/hooks", "airbnb-typescript", "plugin:react/recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended" ], "parserOptions": { "project": "./tsconfig.json" }, "rules": { "react-hooks/exhaustive-deps": "off", "@typescript-eslint/no-explicit-any": "off", "import/order": [ "error", { "groups": [["external", "builtin"], "internal", "parent", "sibling", "index"], "alphabetize": { "order": "asc", "caseInsensitive": true } } ] }, "settings": { "import/resolver": { "typescript": { "project": "./tsconfig.json" } } } }

sissue:

当我运行Eslint(

eslint . --ext .ts,.tsx)时,我会遇到no错误

,但是我的一些队友(在Windows上)会看到多个绒毛错误。 环境差异:


Me:

macOS(无ESLINT错误)

  • 车队:

    Windows(查看ESLINT错误)

  • 认为这是
  • Path分辨率,线路结束(

    LFvs.CRLF

    )或案例灵敏度的问题吗?任何见解都会有所帮助!

我尝试的是:


确保所有队友都具有相同的
node_modules

eslint版本。

    删除
  • node_modules

    package-lock.json
    ,然后重新安装(
    npm install
    )。

  • 检查了全局ESLINT设置(禁用全局ESLINT)。

    仅使用ESLINT和Prettier启用

    VS代码
    手动运行ESLINT(外部与代码)。
    

  • 一个愚蠢的问题

  • 在包装上使用此操作。
  • "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --cache --max-warnings=0",

reactjs visual-studio-code vite eslint prettier
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.