oxc icon indicating copy to clipboard operation
oxc copied to clipboard

feat(linter): eslint-plugin-next/no-html-link-for-pages

Open Dunqing opened this issue 9 months ago • 7 comments

Dunqing avatar May 07 '24 13:05 Dunqing

  • #3196 Graphite 👈
  • main

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @Dunqing and the rest of your teammates on Graphite Graphite

Dunqing avatar May 07 '24 13:05 Dunqing

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

codspeed-hq[bot] avatar May 07 '24 13:05 codspeed-hq[bot]

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?

Dunqing avatar May 08 '24 06:05 Dunqing

Are we able to provide a cached fs in LintContext?

Boshen avatar May 08 '24 14:05 Boshen

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

Dunqing avatar May 09 '24 00:05 Dunqing

It seems like we don't need the resolver, we just need to walk the directories and cache the found files ...

Boshen avatar Sep 19 '24 08:09 Boshen

@Dunqing mind if I take this PR over?

DonIsaac avatar Sep 27 '24 17:09 DonIsaac