Skip to content

Commit

Permalink
docs: explain code block language mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
DMartens committed Apr 12, 2024
1 parent a9552ad commit a7d2783
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Expand Up @@ -53,7 +53,10 @@ You can manually include the Markdown processor by setting the `processor` optio

Each fenced code block inside a Markdown document has a virtual filename appended to the Markdown file's path.

The virtual filename's extension will match the fenced code block's syntax tag, so for example, <code>```js</code> code blocks in <code>README.md</code> would match <code>README.md/*.js</code>.
The virtual filename's extension will match the fenced code block's syntax tag, except for the following: `javascript`, `ecmascript`, `typescript` and `markdown`.
The exceptions are mapped to their shorter syntax tag variants: `js`, `js`, `ts` and `md` respectively.
So for example, <code>```js</code> code blocks in <code>README.md</code> would match <code>README.md/*.js</code> and <code>``typescript</code> in <code>CONTRIBUTING.md</code> would match <code>CONTRIBUTING.md/*.ts</code>.

You can use glob patterns for these virtual filenames to customize configuration for code blocks without affecting regular code.
For more information on configuring processors, refer to the [ESLint documentation](https://eslint.org/docs/user-guide/configuring#specifying-processor).

Expand Down

0 comments on commit a7d2783

Please sign in to comment.