Skip to content

Commit

Permalink
Ignore (only) the generated .astro/types.d.ts file
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Oct 17, 2023
1 parent 790407b commit 109cc3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
1 change: 1 addition & 0 deletions fixtures/plugins/astro/knip.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export default {
ignore: '.astro/types.d.ts',
compilers: {
astro: (text: string) => [...text.matchAll(/import[^;]+/g)].join('\n'),
css: (text: string) => [...text.matchAll(/(?<=@)import[^;]+/g)].join('\n'),
Expand Down
13 changes: 3 additions & 10 deletions tests/plugins/astro.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,14 @@ import baseCounters from '../helpers/baseCounters.js';
const cwd = resolve('fixtures/plugins/astro');

test('Find dependencies in Astro configuration', async () => {
const { issues, counters } = await main({
const { counters } = await main({
...baseArguments,
cwd,
});

assert(issues.unlisted['src/content/config.ts']['astro:content']);
assert(issues.unlisted['src/pages/rss.xml.js']['astro:content']);
assert(issues.unlisted['src/pages/blog/[...slug].astro']['astro:content']);
assert(issues.unlisted['src/pages/blog/index.astro']['astro:content']);
assert(issues.unlisted['src/layouts/BlogPost.astro']['astro:content']);

assert.deepEqual(counters, {
...baseCounters,
unlisted: 5,
processed: 17,
total: 17,
processed: 18,
total: 18,
});
});

0 comments on commit 109cc3b

Please sign in to comment.