Skip to content

fencedCodeLanguages

Reports fenced code blocks without a language specified.

✅ This rule is included in the md stylistic preset.

Fenced code blocks in Markdown allow you to embed syntax-highlighted blocks of other languages. The language name is expected, but not required, after the initial three backticks.

It’s a good idea to provide a language because that allows editors and converters to properly syntax highlight the embedded code. Even if you’re just embedding plain text, it’s preferable to use text as the language to explicitly indicate your intention.

```
const message = "Hello, world!";
console.log(message);
```
```
plain text here
```

If you don’t mind languages being inferred rather than explicit, you can safely disable this rule.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.