enhancementhelp wanted
Metriche repository
- Star
- (51 star)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
Is your feature request related to a problem? Please describe.
MDX files are not currently sorted and unused imports and exports are not removed
Describe the solution you'd like
Similar to Vue support, also support MDX files (.mdx extension), which can include import and export statements
Example file from MDX homepage:
index.mdx
import {Chart} from './snowfall.js'
export const year = 2023
# Last year’s snowfall
In {year}, the snowfall was above average.
It was followed by a warm spring which caused
flood conditions in many of the nearby rivers.
<Chart year={year} color="#fcb32c" />
This will probably require:
- A custom parser (maybe with
@mdx-js/mdx? or maybe something lower level from the unified ecosystem) - Maybe also a custom formatter? Although the imports / exports should be "just JavaScript"...
Describe alternatives you've considered
Avoiding parsing: Match and format only import and export statements at the top of the document (eg. using regular expressions)
But this would be brittle and would fail in many cases.
Additional context
--