Skip to content

Conversation

@lilnasy
Copy link
Contributor

@lilnasy lilnasy commented Nov 19, 2025

Copilot AI review requested due to automatic review settings November 19, 2025 10:10
@lilnasy lilnasy changed the title exclude linted files in fixtures when formatting style(oxlint/plugins): update oxfmt config to only format plugins in oxlint fixtures Nov 19, 2025
@github-actions github-actions bot added the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Nov 19, 2025
Copilot finished reviewing on behalf of lilnasy November 19, 2025 10:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refines the formatting configuration to prevent CI auto-formatting from breaking test assertions in fixture files. Previously, all files under apps/oxlint/test/fixtures/ were included for formatting; now only files specifically named plugin.ts are formatted.

Key Changes

  • Modified the ignore pattern from including all fixture files to only including plugin.ts files
  • This prevents test input files (which may intentionally contain linting errors) from being auto-formatted

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lilnasy lilnasy force-pushed the style/linter/plugins branch from cae92b7 to d7694c3 Compare November 19, 2025 12:24
@overlookmotel
Copy link
Member

Personally, I like formatting everything that can be formatted. We can use // prettier-ignore comments on parts of files where whitespace etc matters.

Unless this is going to be a major ball-ache for token APIs?

@lilnasy
Copy link
Contributor Author

lilnasy commented Nov 20, 2025

This doesn't uniquely affect token APIs. Edit: maybe I spoke too soon. I imagine there will be more cases like this: #15861 (comment).

I was thrown off by the autofix CI autobreaking already written tests. I'll add // prettier-ignore for now and refactor the assertions at a later point.

@lilnasy lilnasy closed this Nov 20, 2025
@overlookmotel
Copy link
Member

I don't know what editor you use. I use VS Code, and have installed the Oxc VS Code extension, with "experimental format" and "format on save" options enabled. That's quite useful for this, as when editing fixture files, you see immediately if the file is going to get formatted in a way that you don't want, and it's obvious where to put the // prettier-ignore comments.

But Oxfmt is alpha, so completely understand if you don't want to use it.

Prettier doesn't support a // prettier-ignore-file comment to skip formatting on whole file, so currently Oxfmt doesn't support it either. But we can request that feature (seems useful to me), and that'd make all this rather easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants