oxc
oxc copied to clipboard
feat(linter): eslint-plugin-next/no-html-link-for-pages
This stack of pull requests is managed by Graphite. Learn more about stacking.
Join @Dunqing and the rest of your teammates on Graphite
CodSpeed Performance Report
Merging #3196 will not alter performance
Comparing 05-07-feat_linter_eslint-plugin-next_no-html-link-for-pages
(21f58b2) with main
(58fd6eb)
Summary
✅ 29
untouched benchmarks
Supporting this rule may result in significant performance degradation. Because we need to port https://github.com/vercel/next.js/blob/0edf4f951e18b357226f09b2a17d26516a40cf55/packages/eslint-plugin-next/src/utils/url.ts#L4-L34. We can't globally cache the results of fs.readdirSync, which would cause us to be doing the same thing every time we run this rule. @Boshen Do you have any advice for this?
Are we able to provide a cached fs in LintContext
?
Are we able to provide a cached fs in
LintContext
?
I will give a try. Also perhaps we could provide some sort of generic caching policy in the LintContext. As far as I know most rules could benefit from this
It seems like we don't need the resolver, we just need to walk the directories and cache the found files ...
@Dunqing mind if I take this PR over?