0.1.3 • Published 3 years ago

@sfdocs-internal/no-tabs-except-codeblocks v0.1.3

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

no-tabs-except-codeblocks

Warn when hard tabs (\t) are used instead of spaces in the markdown content except that of code blocks.

Fix

@sfdocs-internal/no-tabs-except-codeblocks uses spaces where tabs are used for indentation, but retains tabs used in codeblocks.

Example

ok.md
In

Note: · represents a space.

Foo Bar

····Foo
Out

No messages.

not-ok.md
In

Note: » represents a tab.

»Here's one before a code block.

Here's a tab:», and here is another:».

And this is in `inline»code`.

>»This is in a block quote.

*»And…

»1.»in a list.

And this is a tab as the last character.»
Out
1:1: Use spaces instead of tabs
3:14: Use spaces instead of tabs
3:37: Use spaces instead of tabs
5:23: Use spaces instead of tabs
7:2: Use spaces instead of tabs
9:2: Use spaces instead of tabs
11:1: Use spaces instead of tabs
11:4: Use spaces instead of tabs
13:41: Use spaces instead of tabs

Install

yarn install @sfdocs-internal/no-tabs-except-codeblocks

Use

You probably want to use it through a config file:

 …
 "pluginsConf": {
     …
     
+    "'sfdocs-lint:no-tabs-except-codeblocks': [require('@sfdocs-internal/no-tabs-except-codeblocks'), ['warning']]",
     …
 }
 …

License

MIT