reactjsvisual-studio-codeviteeslintprettier

ESLint Not Working Properly in Vite + React + TypeScript


I'm working on a Vite + React + TypeScript project and using ESLint with the following configuration:

Relevant ESLint Config (.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" }
    }
  }
}

Issue:

When I run ESLint (eslint . --ext .ts,.tsx), I get no errors, but some of my teammates (who are on Windows) see multiple linting errors.

Environment Differences:

Could this be an issue with path resolution, line endings (LF vs. CRLF), or case sensitivity? Any insights would be helpful!

What I’ve Tried:


Solution

  • try using this on your package.json

    "lint": "tsc --noEmit && eslint \"src/**/*.{ts,tsx}\" --cache --max-warnings=0",