Skip to content

Inline ignore comments ​

For JS/TS files, use oxfmt-ignore to skip formatting the next statement:

js
// oxfmt-ignore
const a    = 42;

/* oxfmt-ignore */
const x = () => { return 2; };

<>
  {/* oxfmt-ignore */}
  <span   ugly   format=""   />
</>;

For JS in Vue, Svelte, and Astro files, use oxfmt-ignore inside the <script> tag:

vue
<script>
// oxfmt-ignore
const a    = 42;
</script>

Trailing ignore comments are also supported:

js
const a    = 42; // oxfmt-ignore

Other native languages also support oxfmt-ignore in their own comment syntax:

  • <!-- oxfmt-ignore --> for HTML, Vue, and Markdown
  • /* oxfmt-ignore */ for CSS, SCSS, and Less
  • # oxfmt-ignore for YAML and GraphQL

For the rest of Svelte and Astro files (e.g., markup, <style>) and other Prettier-backed files, use prettier-ignore comment. See also Prettier's ignore documentation.

Currently, TOML files do not support ignore comments.

Prettier compatibility ​

  • prettier-ignore comment is also supported