mightyiam / eslint-config-love

A TypeScript ESLint config that loves you
MIT License
743 stars 64 forks source link

feat(deps): bump minimum @typescript-eslint to v7.0.0 #1471

Closed mihaerzen closed 3 months ago

mihaerzen commented 3 months ago

What is the purpose of this pull request? (put an "X" next to item)

Hi all! 👋🏼

I was annoyed by the outdated @typescript-eslint/parser and I really wanted to use this amazing set of eslint rules, so I went ahead and updated it.

This is my first PR to this project, so please do let me know if I made some apparent mistakes. Thank you for maintaining this project! 🙇🏼

What changes did you make? (Give an overview)

I have updated the @typescript-eslint/parser. I had to also update the @typescript-eslint/eslint-plugin.

Which issue (if any) does this pull request address?

Fixes #1453 Closes #1431

mightyiam commented 3 months ago

I feel that there's some stuff that should occur before this. For one, the absorbing of eslint-config-standard. Which requires some test changes. I have quite a lot of time tomorrow and Thursday...

mihaerzen commented 3 months ago

absorbing of eslint-config-standard

My apologies, I do not exactly understand what you mean by this. Can you elaborate what you mean with this exactly and how is this related to this PR so I can fix it. Thank you 🙏🏼

mightyiam commented 3 months ago

It's related because it simplifies the testing.

But it's not strictly necessary. I'm sure your PR can be brought through without it.

I'll take another look.

matthargett commented 3 months ago

A quick +1 on the intent of the PR. When using nx and migrating to its latest version (18.2.0), we'd (seemingly) have to abandon eslint-config-love to do so. It looks like merging this PR (and publishing a new release) would help get us unblocked.

npm ERR! Found: @typescript-eslint/eslint-plugin@7.4.0
npm ERR! node_modules/@typescript-eslint/eslint-plugin
npm ERR!   dev @typescript-eslint/eslint-plugin@"7.4.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @typescript-eslint/eslint-plugin@"^6.4.0" from eslint-config-love@43.1.0
npm ERR! node_modules/eslint-config-love
npm ERR!   dev eslint-config-love@"^43.1.0" from the root project

Happy to test an -rc or similar package, if that's helpful!

mightyiam commented 3 months ago

Sorry for breaking your PR, @mihaerzen !

It was broken with #1483 which was a precursor for #1484 which provides the test coverage needed in order to safely absorb eslint-config-standard.

If you're upset and want me to bump typescript-eslint, please let me know.

mihaerzen commented 3 months ago

If you're upset and want me to bump typescript-eslint, please let me know.

Not a problem, happy to rebase. Seeing resolved-config.ts isn't this making the standard.ts and equivalents.ts (maybe also some other tests) redundant? Personally I feel resolved-config.ts is a much better test as it covers a full end result and it could be considered the "source of truth". It is also a lot easier to understand as a contributor 🤷

I have rebased and with the necessary upgrade of typescript-eslint plugin, the existing prefer-promise-reject-errors according to how to use section should be disabled.

Let me know what you think.

Cheers ✌️

matthargett commented 3 months ago

Integration tested our repo against this PR's branch, and it all works beautifully. To get an idea of the integration environment, here's a fragment:

    "devDependencies": {
        "@babel/core": "^7.24.3",
        "@babel/preset-react": "^7.24.1",
        "@nx/esbuild": "18.2.1",
        "@nx/eslint-plugin": "18.2.1",
        "@nx/jest": "18.2.1",
        "@nx/js": "18.2.1",
        "@nx/linter": "18.2.1",
        "@nx/node": "18.2.1",
        "@nx/react": "18.2.1",
        "@nx/webpack": "18.2.1",
        "@nx/workspace": "18.2.1",
        "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
        "@sentry/webpack-plugin": "^2.14.2",
        "@swc/cli": "~0.3.12",
        "@swc/core": "~1.4.11",
        "@swc/helpers": "~0.5.8",
        "@swc/jest": "~0.2.36",
        "@testing-library/react": "^14.2.2",
        "@types/jest": "^29.5.12",
        "@types/node": "~20.12.2",
        "@types/react": "~18.2.73",
        "@types/react-dom": "~18.2.23",
        "@typescript-eslint/eslint-plugin": "~7.5.0",
        "@typescript-eslint/parser": "~7.5.0",
        "babel-jest": "^29.7.0",
        "esbuild": "~0.19.12",
        "eslint": "~8.57.0",
        "eslint-config-prettier": "~9.1.0",
        "eslint-config-love": "mihaerzen/eslint-config-love#mihaerzen/1453-update-typescript-eslint-parser",
        "eslint-plugin-import": "^2.29.1",
        "eslint-plugin-jest": "^27.9.0",
        "eslint-plugin-jsx-a11y": "^6.8.0",
        "eslint-plugin-n": "^16.6.2",
        "eslint-plugin-prettier": "^5.1.3",
        "eslint-plugin-promise": "^6.1.1",
        "eslint-plugin-react": "^7.34.1",
        "eslint-plugin-react-hooks": "^4.6.0",
        "express": "^4.18.2",
        "fake-indexeddb": "^5.0.1",
        "http": "^0.0.1-security",
        "jest": "^29.7.0",
        "jest-environment-jsdom": "^29.7.0",
        "jest-environment-node": "^29.7.0",
        "jsdom": "^24.0.0",
        "nx": "18.2.1",
        "path": "^0.12.7",
        "prettier": "^3.2.5"
}
mightyiam commented 3 months ago

Thank you for revising.

I found that v7.0.0 had a peerDep related bug. So we're bumping to v7.0.1 in which that seems to have been fixed.

I found that the package-lock.json had seemingly unrelated changes. So I re-did the lock change.

I also set the bottom versions to v7.0.1 (they were v7.4.0).

mightyiam commented 3 months ago

Thank you, @mihaerzen .

mihaerzen commented 3 months ago

@mightyiam Thank you for your patience ✌️

standard-cd-bot[bot] commented 3 months ago

:tada: This PR is included in version 44.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: