Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: map known code block languages to respective file extensions #246

Merged
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>.

DMartens marked this conversation as resolved.
Show resolved Hide resolved
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