iamturns / eslint-config-airbnb-typescript

Airbnb's ESLint config with TypeScript support
MIT License
1.05k stars 98 forks source link

Update range of compatibility for @typescript-eslint's plugin and parser #332

Closed mgrinstein closed 8 months ago

mgrinstein commented 9 months ago

Issue

typescript-eslint recently released v7.0.1 and eslint-config-airbnb-typescript does not support it yet

Current version support:

    "@typescript-eslint/eslint-plugin": "^5.13.0 || ^6.0.0",
    "@typescript-eslint/parser": "^5.0.0 || ^6.0.0",

Desired version support: To also include ^7.0.1

ab14bhardwaj commented 9 months ago

+1 issue

eduardosanzb commented 8 months ago

can we merge this?

adirzoari commented 8 months ago

any update on the merge?

TobiTenno commented 8 months ago

fwiw, this is my "working" overrides in my pacakge.json

{
  "overrides": {
    "eslint-config-airbnb-typescript": {
      "eslint": "^8.57.0",
      "@typescript-eslint/parser": "^7.0.2",
      "@typescript-eslint/eslint-plugin": "^7.0.2"
    }
  }
}
ab14bhardwaj commented 8 months ago

@iamturns Can you please merge this PR? https://github.com/iamturns/eslint-config-airbnb-typescript/pull/333

adirzoari commented 8 months ago

@TobiTenno how did you installed it? just add overrides in package.json with those libraries and run npm i?

TobiTenno commented 8 months ago

@TobiTenno how did you installed it? just add overrides in package.json with those libraries and run npm i?

yeah, override my local copies of those dependencies to those new versions and npm i. sometimes i had to clear my node_modules and package-lock to fully avoid it resolving some old versions from an old overrides

adirzoari commented 8 months ago

you mean instead add them in devDependencies, you added them in new section of overrides? can you share you package.json?

TobiTenno commented 8 months ago

you mean instead add them in devDependencies, you added them in new section of overrides? can you share you package.json?

it's not pushed up anywhere yet. and no, i don't mean instead of adding them. i said specifically overriding my local copies, so overriding package.json#devDependencies manually.

in my case i was adding eslint-config-airbnb-typescript, so...

adirzoari commented 8 months ago

@TobiTenno

"devDependencies": {
    "eslint-config-airbnb-typescript":"???"
  },
  "overrides": {
    "eslint-config-airbnb-typescript": {
      "eslint": "^8.57.0",
      "@typescript-eslint/parser": "^7.0.2",
      "@typescript-eslint/eslint-plugin": "^7.0.2"
    }
  }

what version of eslint-config-airbnb-typescript?

TobiTenno commented 8 months ago

@adirzoari i'm on the latest version... same way you'd need to be if you were running it normally 🤣

adirzoari commented 8 months ago

@TobiTenno The truth is something very strange. when I configure my eslintrc.json file, it doesn't display any comments for all the Airbnb rules, as I would expect. For example, I wrote to it:

  function getFullName(user: any) {
    const { firstName } = user;
    const { lastName } = user;

    return `${firstName} ${lastName}`;
  }

I expected to get the error prefer-destructuring

my eslint json:

{
  "root": true,
  "env": {
    "browser": true,
    "es2021": true
  },
  "extends": [
    "airbnb",
    "airbnb-typescript",
    "plugin:import/typescript",
    "plugin:prettier/recommended"
  ],

  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    },
    "ecmaVersion": "latest",
    "sourceType": "module",
    "project": "./tsconfig.json"
  },
  "plugins": ["@typescript-eslint", "react"],
  "overrides": [{ "files": ["./src/**/*.{js,jsx,ts,tsx}"] }],

  "rules": {},
  "ignorePatterns": ["node_modules", "build", "dist", "public"]
}

tsconfig.json:

{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx",
    "baseUrl": "."
  },
  "include": ["src"],
  "exclude": ["node_modules"]
}

I run eslint --quiet 'src/**/*.{js,jsx,ts,tsx}'

TobiTenno commented 8 months ago

@adirzoari we should probably take this out of here, cause this seems like an issue for your setup, not for my overrides suggestion. Feel free to message me on discord @ tobiah.

DePasqualeOrg commented 8 months ago

This package gets over 2 million weekly downloads on NPM, but it appears to be barely maintained. Wouldn't it make sense for @airbnb to maintain it instead?

iamturns commented 8 months ago

:tada: This issue has been resolved in version 18.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

iamturns commented 8 months ago

Appreciate all your patience, life has become busy for me.

Given how popular this config has become I'd be very happy to handover to Airbnb to maintain. Does anyone have a contact I could connect with?