turbo
turbo copied to clipboard
chore(linting): implement ESLint flat config compatibility for `eslin…
Description
- Add "flat/recommended" config to
eslint-plugin-turbo - Add
metaproperty to plugin - Update README.md accordingly with information on using flat config
- Add tests for flat config in
__tests__/cwdFlat.test.ts
Testing Instructions
Run the following command:
pnpm run test --filter=eslint-plugin-turbo
The latest updates on your projects. Learn more about Vercel for Git ↗︎
6 Skipped Deployments
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| examples-basic-web | ⬜️ Ignored (Inspect) | Visit Preview | Nov 12, 2024 6:08pm | |
| examples-designsystem-docs | ⬜️ Ignored (Inspect) | Visit Preview | Nov 12, 2024 6:08pm | |
| examples-native-web | ⬜️ Ignored (Inspect) | Visit Preview | Nov 12, 2024 6:08pm | |
| examples-svelte-web | ⬜️ Ignored (Inspect) | Visit Preview | Nov 12, 2024 6:08pm | |
| examples-tailwind-web | ⬜️ Ignored (Inspect) | Visit Preview | Nov 12, 2024 6:08pm | |
| examples-vite-web | ⬜️ Ignored (Inspect) | Visit Preview | Nov 12, 2024 6:08pm |
@jeremy-code is attempting to deploy a commit to the Vercel Team on Vercel.
A member of the Team first needs to authorize it.
Previous PR was #8054, @anthonyshew
Really appreciate this! Do you have a repo I could test this out in? I haven't gotten to try out Flat Config yet.
@jeremy-code We'd love to get this merged! Are you able to fix up the conflicts so we can try this out with a canary release?
@anthonyshew Sorry, I didn't realize y'all were blocked on me. I have fixed any conflicts. Let me know if there's any issues. I ran the test suite again and saw no errors.
Removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@types/[email protected]
@jeremy-code No worries. I went on parental leave so I wasn't able to come back and review sooner - and I neglected to let anyone know to come review this one. Totally my fault!
I'm trying this out now in a create-next-app and it doesn't appear to be picking up issues.
However, I'm not sure that I'm configuring things right. I haven't had a chance to work with the new ESLint configuration format, so it might be silently failing. Do you have an example repo where I can hand test this?
Oh so that's what you meant by example repo -- I thought you just meant the ESLint config file.
The above is a quick and (very) dirty proof of concept to show it works with the the environmental variable rule. The corresponding repo is here: jeremy-code/turborepo-test.
If you're wondering why it's not underlining in VSCode, you have to enable "eslint.useFlatConfig" to true or have the ENV variable "ESLINT_USE_FLAT_CONFIG" for the ESLint extension.
EDIT:
I made some changes to try to make it a bit cleaner than it was previously. The corresponding repo is here: jeremy-code/turborepo-test. Here's a more thorough testing of it:
The ENV variables error or don't error correctly with the exception of process.env.TEST_ENV_IN_DOT_ENV (I think this is a recent change so not sure whether this is expected?). Also, apps/docs uses the flat config and doesn't error.
I'm getting Error: Cannot find package '/Users/anthonyshew/projects/debugs/turborepo-test/packages/eslint-config/node_modules/eslint-plugin-turbo/package.json' imported from /Users/anthonyshew/projects/debugs/turborepo-test/packages/eslint-config/index.mjs in that repo. Do you know why that is?
Did you run pnpm run build beforehand (or more specifically tsup in packages/eslint-plugin-turbo)? I just straight up copied-pasted all the code necessary for the ESLint plugin just for a quick sanity check.
On Tue, Nov 12, 2024 at 9:10 AM Anthony Shew @.***> wrote:
I'm getting Error: Cannot find package '/Users/anthonyshew/projects/debugs/turborepo-test/packages/eslint-config/node_modules/eslint-plugin-turbo/package.json' imported from /Users/anthonyshew/projects/debugs/turborepo-test/packages/eslint-config/index.mjs in that repo. Do you know why that is?
— Reply to this email directly, view it on GitHub https://github.com/vercel/turborepo/pull/8606#issuecomment-2471112835, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKKBKOXZQOJMA4OQRYPS44T2AIY6RAVCNFSM6AAAAABJ5CJDAGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZRGEYTEOBTGU . You are receiving this because you were mentioned.Message ID: @.***>
Oops, I thought I had done that but apparently not. This looks great!
Sorry about my commits above. I messed up history and am getting back on track.
Nono I am pretty certain it's my fault I thought (hoped?) I fixed these merge issues since the original commit was a bit of time ago. Let me see if I can make a new PR with a different branch