-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conflicting Eslint rules based on import order #76
Comments
package.json "types": "./dist/index.d.ts" Build output: ESM dist/card.mjs 50.00 B
ESM dist/chunk-MFXFT5EY.mjs 730.00 B
ESM dist/index.css 5.67 KB
ESM dist/index.mjs 50.00 B
ESM ⚡️ Build success in 273ms
DTS ⚡️ Build success in 582ms
DTS dist/card.d.mts 188.00 B
DTS dist/index.d.mts 51.00 B So, valid package.json should be like: "types": "./dist/index.d.mts" Or better: tsup.config.ts format: [
"esm",
+"cjs"
], |
That still doesn't work, as I export two types files from my
I still have to place the typescript eslint rule below browser + react (which isn't how it is in the
My tsup config within the UI directory:
I think adding some documentation about extends order would suffice? |
This might need a docs overhaul. I think we are going to do a rewrite soon for flat configs anyway... so might leave it until then? |
@mrmckeb makes sense, thanks for tackling! |
@mrmckeb if you are going to do a rewrite. Might I also ask to make a modular turbo repo example. Where the configs are a package in the package folder. And configs are nested. Like base ---> node --> react --> nextjs for example. This would allow us to use the same set of base rules everywhere in our repos. Thanks, looking forward to Flat configs! But Next.js does not support that yet, right ? |
I followed the with-tailwind example, which uses the new eslint rules from vercel/styleguide. I was having issues getting eslint to recognize imports from the
packages
directory, even though typescript could parse it fine.From the example, the
next.js
eslint file lists the plugins in this order:Expected behavior
Imports from UI directory are able to be resolved correctly
Actual behavior
This error, which fails when linting and within my IDE:
Workaround solution
I reordered the style guide rules so that the typescript rules come last:
I only found this when I was digging through the repo and found this configuration:
Proposed solution
Operating system
Apple M1 pro
Setup / packages
Next 13.5
Postcss + tailwind
turborepo
typescript
custom eslint
Project layout
The text was updated successfully, but these errors were encountered: