Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
background-color: #f0f0f0;
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Import styles, initialize component theme here.
// import '../src/common.css';
import './common.css';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting this was already here 😅

6 changes: 4 additions & 2 deletions packages/knip/src/plugins/playwright-ct/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { IsPluginEnabled, Plugin } from '../../types/config.js';
import { hasDependency } from '../../util/plugin.js';
import { entry, resolveConfig } from '../playwright/index.js';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could still re-use this entry I guess?

import { resolveConfig } from '../playwright/index.js';

// https://playwright.dev/docs/test-components

Expand All @@ -10,7 +10,9 @@ const enablers = [/^@playwright\/experimental-ct-/];

const isEnabled: IsPluginEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);

const config = ['playwright-ct.config.{js,ts}', 'playwright/index.{js,ts,jsx,tsx}'];
const config = ['playwright-ct.config.{js,ts}'];

const entry = ['**/*.@(spec|test).?(c|m)[jt]s?(x)', 'playwright/index.{js,ts,jsx,tsx}']

export default {
title,
Expand Down
2 changes: 1 addition & 1 deletion packages/knip/src/plugins/playwright/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const isEnabled: IsPluginEnabled = ({ dependencies }) => hasDependency(dependenc

const config = ['playwright.config.{js,ts,mjs}'];

export const entry = ['**/*.@(spec|test).?(c|m)[jt]s?(x)'];
const entry = ['**/*.@(spec|test).?(c|m)[jt]s?(x)'];

const toEntryPatterns = (
testMatch: string | RegExp | Array<string | RegExp>,
Expand Down
1 change: 1 addition & 0 deletions packages/knip/test/plugins/playwright-ct.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ test('Find dependencies with the Playwright for components plugin', async () =>

assert.deepEqual(counters, {
...baseCounters,
files: 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not expect this change. Maybe it's because this fixture does not have a .css compiler installed? What's the file being flagged as unused here?

devDependencies: 0,
unlisted: 0,
processed: 3,
Expand Down
Loading