Skip to content
Back to skills

Prettier Knowledge Patch

ASecurity

Prettier

  • 25 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added December 1, 2026
developmentjavascripttypescriptjavavueangularnodeexpressgitapi

Works with

  • cursor
  • cli
  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 11 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill prettier-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Prettier Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Prettier Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-prettier-knowledge-patch-nevaberry-plugins/badge)](https://www.skillsdirectory.com/skills/nevaberry-prettier-knowledge-patch-nevaberry-plugins)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: prettier-knowledge-patch
description: Prettier
version: "3.10.1"
license: MIT
metadata:
  author: Nevaberry
---


# Prettier compatibility guidance

Load this skill when configuring Prettier, selecting parsers, integrating plugins,
or checking formatting behavior for the languages and templates indexed below.
The references contain syntax examples, API details, and version-specific fixes.

## Reference index

| Reference | Topics |
| --- | --- |
| [Configuration and CLI](references/configuration-cli.md) | Configuration discovery, Node.js and Bun, shared configurations, EditorConfig, installation, editors, pragmas, checks, caching |
| [Plugins and API](references/plugins-api.md) | OXC, Yuku, Hermes, parser inference, file URLs, cursor tracking, parser and printer hooks, comment attachment, types |
| [JavaScript and TypeScript](references/javascript-typescript.md) | Removed syntax, discard bindings, JSDoc, JSX, import types, deferred imports, declarations, signatures, quoting |
| [Flow](references/flow.md) | Type parameters, opaque bounds, variance, conditional types, match expressions, records, ambient declarations, annotations |
| [Styles](references/styles.md) | CSS selectors and values, Tailwind utilities, CSS-in-JS, CSS Modules, SCSS, Less |
| [Angular](references/angular.md) | Template expressions, control flow, content blocks, tag comments, inline styles, Markdown fences |
| [Templates](references/templates.md) | HTML, Vue, Handlebars, Glimmer, MJML, Lightning Web Components |
| [Markdown](references/markdown.md) | Markdown and MDX lists, headings, links, literal text, Liquid expressions, front matter, LWC fences |
| [Data and GraphQL](references/data-graphql.md) | JSON and JSONC parsers, literal preservation, YAML document markers, GraphQL syntax and selection sets |

## Compatibility changes

### Legacy import assertions

Prettier drops support for legacy import assertions using `assert`.
Use import attributes with `with`.

```js
import data from "./data.json" with { type: "json" };
```

### JavaScript Records and Tuples

Prettier drops support for syntax from the withdrawn JavaScript Records and
Tuples proposal.

### Parenthesized JSON values

Parenthesized values such as `[1, (2)]` raise a syntax error.
Remove the parentheses before formatting such files.

### TypeScript import type trailing commas

Prettier can add a trailing comma after the `with` property in multiline import
type options. TypeScript versions before 5.9 can reject that comma.

### CommonJS entrypoint compatibility

In 3.5.0 and 3.5.1, the `module-sync` export condition lets `require("prettier")`
select the ESM entrypoint on compatible Node.js versions. Version 3.5.2 restores
the CommonJS entrypoint after compatibility problems when CommonJS and ESM
plugins both imported built-in plugins.

## Configuration and runtime

### TypeScript configuration files

Prettier discovers `.prettierrc` and `prettier.config` files with `.ts`, `.mts`, or
`.cts` extensions. At the 3.5.0 release, native loading required Node.js 22.6.0 or later,
with `--experimental-strip-types` on Node.js 22.

```ts
// prettier.config.mts
const tabWidth: number = 4;
export default { tabWidth };
```

```sh
NODE_OPTIONS="--experimental-strip-types" prettier . --write
```

### JSONC configuration and formatting

With Bun 1.2 or later, Prettier can read the `prettier` field from a `package.json`
that uses JSONC. Formatting that file still requires a `jsonc` parser override
because `package.json` defaults to `json-stringify`.

Prettier 3.2.5 defaults `tsconfig.json` to `json`, and 3.2.4 restored `json` for
`.eslintrc.json`. Use a `jsonc` override to opt into JSONC formatting, which adds
trailing commas by default. Override examples are in the configuration and data
references.

### EditorConfig boundaries and width

A `.git` file marks the project boundary for EditorConfig lookup. Prettier stops
there before reaching the parent directories of a worktree or submodule.

With EditorConfig enabled, Prettier 2.8.5 and later interpret
`max_line_length = off` as `printWidth: Infinity`, disabling width-based wrapping
unless Prettier configuration overrides it.

## CLI controls

### Experimental CLI

Enable the experimental CLI with `--experimental-cli` or
`PRETTIER_EXPERIMENTAL_CLI=1`.

```sh
prettier . --check --experimental-cli
PRETTIER_EXPERIMENTAL_CLI=1 prettier . --check
```

### File opt-out pragmas

Enable `--check-ignore-pragma` on the CLI or set `checkIgnorePragma: true` in
config or API options. With a parser that supports it, a top-of-file `@noformat`
or `@noprettier` comment skips formatting for the whole file.

```js
/** @noformat */
export const identity = [1,0,0, 0,1,0, 0,0,1];
```

### Check failures and caching

`prettier --check` exits with status `2` when it cannot infer a parser for an
explicitly passed file. Prettier 3.5 could report the error and still exit with
status `0`.

`--cache --cache-strategy content` detects content edits that leave a file's
size unchanged. The earlier bug could reuse a cached result after such an edit.
Running `prettier .` without `--cache` leaves `node_modules/.cache/` uncreated.

## Parser selection and inference

### Separately installed parsers

Install `@prettier/plugin-oxc` separately and load it as a plugin. It provides
`oxc` for JavaScript and `oxc-ts` for TypeScript.

```sh
prettier --plugin @prettier/plugin-oxc --parser oxc-ts src/index.ts
```

Install `@prettier/plugin-hermes` separately to use the `hermes` parser for Flow.

```sh
prettier --plugin @prettier/plugin-hermes --parser hermes src/index.js
```

Install `@prettier/plugin-yuku` separately and load it to use `yuku` for
JavaScript or `yuku-ts` for TypeScript.

```sh
npm install --save-dev @prettier/plugin-yuku
prettier --plugin @prettier/plugin-yuku --parser yuku-ts src/index.ts
```

### Full-path detection and configured plugins

A plugin language can supply `isSupported({ filepath })` to decide whether its
parser applies based on the full path. The path can be virtual or point to a
file that does not exist.

`prettier.getFileInfo()` loads plugins from the resolved configuration to infer
parsers for custom languages; this also applies to CLI `--file-info` output.
A configured plugin can take precedence over a built-in language match during
parser inference, including a plugin that declares `.js` support.

## Language and template quick reference

### Angular expressions and Markdown fences

Prettier formats template literals in Angular 19.2 expressions, Angular 20 tagged
template literals and `in` or `void`, Angular 20.1 assignment operators in event
bindings, and Angular 21 regular expression literals in template expressions.

For Angular 21.1, it formats spread elements in arrays, objects, and call arguments,
and consecutive `@case` labels sharing one body. Put the body after the last label.
Prettier 3.8.2 accepts Angular 21.2 `@default never;`, arrow functions, and
`instanceof` in template expressions.

Use `angular-html` for Angular template fences and `angular-ts` for TypeScript
fences with inline Angular templates. Prettier formats Angular syntax in both.

### TypeScript syntax preservation

`quoteProps` applies to enum members and method signatures. `as-needed` removes
optional quotes; `consistent` quotes all keys in the group when a key such as
`"needs-quotes"` requires them.

Prettier 3.9.6 preserves `defer` on namespace imports and the quotes on a method
named `"new"`. Those quotes distinguish the method from a construct signature.

### JSON literal preservation

The `json-stringify` parser preserves the original spelling of numbers and
strings, including Unicode escapes, exponent notation, and numbers that would
round or overflow in JavaScript.

## API and plugin hooks

The public `plugins` option and the `config` option of `prettier.resolveConfig()`
accept `file:` URL objects and strings.

Pass `cursorOffset`, `rangeStart`, and `rangeEnd` together to
`prettier.formatWithCursor()`. Formatting with `cursorOffset` can also handle
nested embedded content, such as a Markdown TypeScript fence containing an
inline Angular template.

A plugin parser's `preprocess` hook can return a promise for the preprocessed
text. The `parse` hook also supports asynchronous work.

A printer's `canAttachComment(node, ancestors)` hook receives ancestors with the
immediate parent first. Use it to reject comments on AST children the printer
skips, such as a shorthand property's key when the printer emits only its value.

A printer can implement `printPrettierIgnored(path, options, print)` to control
nodes marked with `prettier-ignore`. It uses the same arguments as `print` and
can supply required parentheses or a leading semicolon.

Files in this skill

  • SKILL.md8.5 KB
  • coverage.json1.2 KB
  • references/angular.md3.4 KB
  • references/configuration-cli.md4.3 KB
  • references/data-graphql.md1.8 KB
  • references/flow.md2.7 KB
  • references/javascript-typescript.md3.4 KB
  • references/markdown.md2.1 KB
  • references/plugins-api.md4.8 KB
  • references/styles.md2 KB
  • references/templates.md2.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.