Migrate to oxlint#66
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
| "types": ["node"], | ||
| "rootDir": ".", |
There was a problem hiding this comment.
Note for reviewers:
oxlint-tsgolint requests these changes. We will need them anyway when we update TS5 to TS6.
There was a problem hiding this comment.
it would be good to recheck if the built dist files are correct after this change
There was a problem hiding this comment.
I checked, and the dist/ output looks fine. We are using tsup (and very soon tsdown) for generating dist/, and they won't be affected by the rootDir config (unlike tsc).
| globals: { | ||
| React: true, | ||
| JSX: true, | ||
| }, |
There was a problem hiding this comment.
Note for reviewers:
We're not using React in this project.
| "plugins": [ | ||
| "eslint", | ||
| "typescript", | ||
| "unicorn", | ||
| "oxc", | ||
| "import", | ||
| "node", | ||
| "vitest" | ||
| ], |
There was a problem hiding this comment.
Note for reviewers:
I enabled all default plugins, plus some other useful plugins. See https://oxc.rs/docs/guide/usage/linter/plugins.html#supported-plugins for a full list of plugins.
There was a problem hiding this comment.
I prefer to not have unicorn since it's a bunch of random lints but since it doesn't affect any code right now I'm fine with it.
| "eslint-config-prettier": "^9.1.0", | ||
| "eslint-plugin-only-warn": "^1.1.0", | ||
| "oxlint": "^1.63.0", | ||
| "oxlint-tsgolint": "^0.22.1", |
There was a problem hiding this comment.
hm, I think we are still not using TS Go (deliberately) in the main repo - perhaps it would be best to match the main repo for now and upgrade all repos at once at some point
There was a problem hiding this comment.
I want to enable type-aware linting so that I can find more errors, like the floating promise issue (e.g., missing await) that I have fixed, as shown in this PR.
For type-aware linting on ESLint, we can just enable type-aware linting with the already installed TypeScript v5 by enabling projectService.
For type-aware linting on oxlint, we have to install oxlint-tsgolint.
Just to be clear, installing oxlint-tsgolint won't install tsgo (@typescript/native-preview) in our repo. oxlint-tsgolint itself bundles the code from tsgo. Therefore, we won't have two different TypeScript versions installed in the repo.
bluwy
left a comment
There was a problem hiding this comment.
Looks good to me. I clicked "approve workflow runs" but I think it'll be expected to fail for the integration tests as this PR is from a fork.
# Conflicts: # pnpm-lock.yaml # pnpm-workspace.yaml
| dedupePeerDependents: true | ||
| minimumReleaseAge: 10080 | ||
| shellEmulator: true | ||
| trustPolicy: no-downgrade |
There was a problem hiding this comment.
My bad. I was thinking of adding back trustPolicy: no-downgrade during the conflict merging process, but I somehow removed it 🤦
Let me revert it.
Migrate ESLint to oxlint