linter: import sorting and grouping #2858
Replies: 10 comments
-
I'd say that reporting whether the imports are sorted or not is kind of useless, I wonder if this should be a codemod, or a linter rule with |
Beta Was this translation helpful? Give feedback.
-
Yes, there should be a |
Beta Was this translation helpful? Give feedback.
-
Is there an existing eslint plugin for this? I'll make a decision if I have more contexts. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
The import plugin has |
Beta Was this translation helpful? Give feedback.
-
I think eslint-plugin-simple-import-sort just has good defaults. Oxc can have both configurable rule and with good default |
Beta Was this translation helpful? Give feedback.
-
import/order is doable but too complex. Has too much of configuration, require support. I will continue research about porting of simple-import-sort Also
|
Beta Was this translation helpful? Give feedback.
-
I'm wondering if we can do import grouping relying on workspace (reading package.json and glob matching) or tsconfig.json paths rather than just the import source. This should configure well, because I'd like to see the |
Beta Was this translation helpful? Give feedback.
-
What is the problem with import source? |
Beta Was this translation helpful? Give feedback.
-
import { useEffect } from 'react' // "react": "18.2.0"
import { cn } from '@repo/lib' // "@repo/lib": "workspace:*"
import { Button } from 'components' // "baseUrl": "src" By looking at the string after The question is whether linter is allowed to read any files in the workspace. |
Beta Was this translation helpful? Give feedback.
-
Need rule for lexicographical sorting and grouping of imports
Details
Beta Was this translation helpful? Give feedback.
All reactions