From a7d2783abdb76414707e7fb2d536d2e9b2d8d690 Mon Sep 17 00:00:00 2001 From: Daniel Martens Date: Fri, 12 Apr 2024 16:45:55 +0200 Subject: [PATCH] docs: explain code block language mapping --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3d9f988..e304f17 100644 --- a/README.md +++ b/README.md @@ -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, ```js code blocks in README.md would match README.md/*.js. +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, ```js code blocks in README.md would match README.md/*.js and ``typescript 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).