Skip to content

Commit

Permalink
docs: make language mappings more explicit
Browse files Browse the repository at this point in the history
Co-authored-by: Nicholas C. Zakas <[email protected]>
  • Loading branch information
DMartens and nzakas committed Apr 13, 2024
1 parent a7d2783 commit af81ab2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ 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, 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>.
The virtual filename's extension will match the fenced code block's syntax tag, except for the following:

* `javascript` and `ecmascript` are mapped to `js`
* `typescript` is mapped to `ts`
* `markdown` is mapped to `md`

For example, <code>```js</code> code blocks in `README.md` would match `README.md/*.js` and <code>``typescript</code> in `CONTRIBUTING.md` would match `CONTRIBUTING.md/*.ts`.

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 af81ab2

Please sign in to comment.