Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

remark-lint-checkbox-character-style

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-lint-checkbox-character-style

remark-lint rule to warn when list item checkboxes violate a given style

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
71K
decreased by-7.42%
Maintainers
1
Weekly downloads
 
Created
Source

remark-lint-checkbox-character-style

Warn when list item checkboxes violate a given style.

Options: Object or 'consistent', default: 'consistent'.

'consistent' detects the first used checked and unchecked checkbox styles and warns when subsequent checkboxes use different styles.

Styles can also be passed in like so:

{ checked: 'x', unchecked: ' ' }

Presets

This rule is included in the following presets:

PresetSetting
remark-preset-lint-consistent

Example

valid.md

When configured with { checked: 'x' }.

In
- [x] List item
- [x] List item
Out

No messages.

valid.md

When configured with { checked: 'X' }.

In
- [X] List item
- [X] List item
Out

No messages.

valid.md

When configured with { unchecked: ' ' }.

In

Note: · represents a space.

- [ ] List item
- [ ] List item
- [ ]··
- [ ]
Out

No messages.

valid.md

When configured with { unchecked: '\t' }.

In

Note: » represents a tab.

- [»] List item
- [»] List item
Out

No messages.

invalid.md
In

Note: » represents a tab.

- [x] List item
- [X] List item
- [ ] List item
- [»] List item
Out
2:4-2:5: Checked checkboxes should use `x` as a marker
4:4-4:5: Unchecked checkboxes should use ` ` as a marker
invalid.md

When configured with { unchecked: '!' }.

Out
1:1: Invalid unchecked checkbox marker `!`: use either `'\t'`, or `' '`
invalid.md

When configured with { checked: '!' }.

Out
1:1: Invalid checked checkbox marker `!`: use either `'x'`, or `'X'`

Install

npm install remark-lint-checkbox-character-style

Usage

You probably want to use it on the CLI through a config file:

 ...
 "remarkConfig": {
   "plugins": [
     ...
     "lint",
+    "lint-checkbox-character-style",
     ...
   ]
 }
 ...

Or use it on the CLI directly

remark -u lint -u lint-checkbox-character-style readme.md

Or use this on the API:

 var remark = require('remark');
 var report = require('vfile-reporter');

 remark()
   .use(require('remark-lint'))
+  .use(require('remark-lint-checkbox-character-style'))
   .process('_Emphasis_ and **importance**', function (err, file) {
     console.error(report(err || file));
   });

License

MIT © Titus Wormer

Keywords

FAQs

Package last updated on 17 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc