Skip to content

fix(ignores): stop ignoring .playwright and .storybook - #40

Merged
stevensacks merged 2 commits into
mainfrom
fix/lint-playwright-and-storybook-dirs
Jul 21, 2026
Merged

fix(ignores): stop ignoring .playwright and .storybook#40
stevensacks merged 2 commits into
mainfrom
fix/lint-playwright-and-storybook-dirs

Conversation

@stevensacks

Copy link
Copy Markdown
Contributor

Problem

.storybook and .playwright were bare entries in the ignores defaults. A config object carrying only ignores is a global ignore in flat config, and a global ignore beats any later block's files. The two blocks that scope themselves to those directories were therefore shadowed by the defaults they ship alongside:

  • playwright scopes itself to .playwright/**/*.ts?(x) and never matched a file. Fully inert, including the playwright/expect-expect options this package tunes by hand.
  • storybook kept its *.stories.* rules (those files live outside the directory) but its .storybook/main.* rules never ran.

The composed config read as though both directories were covered. Downstream, pnpm lint reported zero problems for code nothing had checked.

Change

  • Drop .storybook and .playwright from defaultIgnores. What remains names only generated output, non-source assets, and tool-owned script directories; authored source stays out.
  • Add src/configs/ignores.test.ts, which asks ESLint itself (isPathIgnored) which paths survive the defaults. A future directory-level entry that shadows a scoped block now fails a test instead of shipping. The catch-all files block in that suite is load-bearing: flat config treats a file matched by no configuration as ignored, so without it every path answers true and the suite proves nothing.
  • README: correct the playwright row (e2e/ was never the glob) and note the storybook block's .storybook/main.* half.
  • Minor changeset, with the opt-out for consumers who want a directory to stay exempt.

Downstream impact

Verified against gaia-react/gaia, which composes this preset: un-ignoring both directories surfaces 78 problems across 11 files, 59 of them auto-fixable. The manual remainder is mostly no-underscore-dangle on harness globals whose names are fixed by contract, plus two genuine Playwright-rule violations (playwright/no-conditional-in-test, playwright/no-skipped-test) that the inert block should have been catching all along.

Consumers see new lint errors on upgrade. ...lint.ignores({extra: ['.playwright', '.storybook']}) restores the old behavior for anyone who wants it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01728LepSoRCrVZ7L2HkEoHa

stevensacks and others added 2 commits July 22, 2026 00:50
Both directories were bare entries in the ignores defaults. A config object
carrying only `ignores` is a GLOBAL ignore in flat config, and a global ignore
beats any later block's `files`, so the two blocks scoped to those directories
were shadowed by the defaults they ship alongside. `playwright` scopes itself
to `.playwright/**/*.ts?(x)` and never matched a file; `storybook` kept its
`*.stories.*` rules but its `.storybook/main.*` rules never ran. The composed
config read as covering directories nothing checked, and `pnpm lint` reported
zero problems for them.

The defaults now name only generated output, non-source assets, and tool-owned
script directories. Authored source stays out of the list.

Add an `ignores` suite that asks ESLint which paths survive the defaults, so a
future directory-level entry that shadows a scoped block fails a test rather
than shipping. The catch-all `files` block in that suite is load-bearing: flat
config treats a file matched by no configuration as ignored, so without it
every path answers `true`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01728LepSoRCrVZ7L2HkEoHa
Un-ignoring `.playwright` runs `no-skipped-test` against real specs for the
first time, and the recommended set's default flags both forms of `test.skip`.
The bare call is a test switched off at author time and stays flagged. The
two-argument form is Playwright's own API for a test that does not apply to the
environment it just found, which is the shape GAIA's own template uses for a
capability its projects may not have enabled, so flagging it would fail lint on
shipped template code.

Severity stays at the recommended set's `warn`; only the option changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01728LepSoRCrVZ7L2HkEoHa
@stevensacks
stevensacks merged commit 1ed4f1b into main Jul 21, 2026
1 check passed
@stevensacks
stevensacks deleted the fix/lint-playwright-and-storybook-dirs branch July 21, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant