remark-lint
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -5,2 +5,8 @@ <!--remark setext--> | ||
4.0.1 / 2016-06-13 | ||
================== | ||
* Update docs ([`149a4a1`](https://github.com/wooorm/remark-lint/commit/149a4a1)) | ||
* Update dev-dependencies ([`59ce8b5`](https://github.com/wooorm/remark-lint/commit/59ce8b5)) | ||
4.0.0 / 2016-06-06 | ||
@@ -7,0 +13,0 @@ ================== |
{ | ||
"name": "remark-lint", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "Lint markdown with remark", | ||
@@ -45,7 +45,8 @@ "license": "MIT", | ||
"jscs-jsdoc": "^2.0.0", | ||
"remark": "^4.0.0", | ||
"remark-comment-config": "^3.0.0", | ||
"remark-github": "^4.0.1", | ||
"remark": "^5.0.0", | ||
"remark-cli": "^1.0.0", | ||
"remark-comment-config": "^4.0.0", | ||
"remark-github": "^5.0.0", | ||
"remark-toc": "^3.0.0", | ||
"remark-validate-links": "^3.0.0", | ||
"remark-validate-links": "^4.0.0", | ||
"mocha": "^2.0.0", | ||
@@ -52,0 +53,0 @@ "vfile": "^1.0.0" |
172
readme.md
# ![remark-lint][logo] | ||
[![Build Status][travis-badge]][travis-ci] | ||
[![Coverage Status][coverage-badge]][coverage-ci] | ||
[![Build Status][build-badge]][build-status] | ||
[![Coverage Status][coverage-badge]][coverage-status] | ||
[![Chat][chat-badge]][chat] | ||
<!--lint disable list-item-spacing--> | ||
**remark-lint** is a markdown code style linter. Another linter? Yes. | ||
Ensuring the markdown you (and contributors) write is of great quality will | ||
provide better rendering in all the different markdown parsers, and makes | ||
sure less refactoring is needed afterwards. What is quality? That’s up to you, | ||
sure less refactoring is needed afterwards. What is quality? That’s up to you, | ||
but the defaults are sensible :ok_hand:. | ||
**remark-lint** has lots of tests. Supports Node, io.js, and the browser. | ||
100% coverage. 50+ rules. It’s built on [**remark**][remark], | ||
a powerful markdown processor powered by [plugins][remark-plugins] | ||
(such as this one). | ||
**remark-lint** is built on [**remark**][remark], a powerful markdown | ||
processor powered by [plugins][remark-plugins] (such as this one). | ||
@@ -22,2 +23,3 @@ ## Table of Contents | ||
* [Programmatic](#programmatic) | ||
* [remark.use(lint\[, options\])](#remarkuselint-options) | ||
* [Rules](#rules) | ||
@@ -33,3 +35,3 @@ * [Configuring remark-lint](#configuring-remark-lint) | ||
[npm][npm-install]: | ||
[npm][]: | ||
@@ -47,6 +49,6 @@ ```bash | ||
Use remark-lint together with remark: | ||
Use `remark-lint` together with [`remark-cli`][cli]: | ||
```bash | ||
npm install --global remark remark-lint | ||
npm install --global remark-cli remark-lint | ||
``` | ||
@@ -62,14 +64,9 @@ | ||
Then, to run **remark-lint** on `example.md`: | ||
Now, running `remark example.md -u remark-lint` yields: | ||
```bash | ||
remark example.md -u remark-lint | ||
# | ||
# Yields: | ||
# | ||
# example.md | ||
# 1:3 warning Incorrect list-item indent: add 2 spaces list-item-indent | ||
# 3:1-3:10 warning Found reference to undefined definition no-undefined-references | ||
# | ||
# ⚠ 2 warnings | ||
```txt | ||
example.md | ||
1:3 warning Incorrect list-item indent: add 2 spaces list-item-indent | ||
3:1-3:10 warning Found reference to undefined definition no-undefined-references | ||
⚠ 2 warnings | ||
``` | ||
@@ -82,5 +79,52 @@ | ||
[`doc/api.md`][api] describes how to use **remark-lint**’s | ||
programatic interface in JavaScript. | ||
Use `remark-lint` together with [`remark`][api]: | ||
```bash | ||
npm install remark remark-lint | ||
``` | ||
Let’s say `example.js` looks as follows: | ||
```js | ||
var report = require('vfile-reporter'); | ||
var remark = require('remark'); | ||
var lint = require('remark-lint'); | ||
var file = remark().use(lint).process('## Hello world!'); | ||
console.log(report(file)); | ||
``` | ||
Now, running `node example.js` yields: | ||
```txt | ||
<stdin> | ||
1:1 warning Missing newline character at end of file final-newline | ||
1:1-1:16 warning First heading level should be `1` first-heading-level | ||
1:1-1:16 warning Don’t add a trailing `!` to headings no-heading-punctuation | ||
⚠ 3 warnings | ||
``` | ||
### `remark.use(lint[, options])` | ||
Adds warnings for style violations to the processed [virtual file][vfile]. | ||
When processing a file, these warnings are available at `file.messages`, and | ||
look as follows: | ||
```js | ||
{ | ||
file: '~/example.md', | ||
reason: 'First heading level should be `1`', | ||
line: 1, | ||
column: 1, | ||
location: Position { start: [Object], end: [Object] }, | ||
ruleId: 'first-heading-level', | ||
fatal: false, | ||
source: 'remark-lint' } | ||
``` | ||
See [`VFileMessage`][vfile-message] for more information. | ||
## Rules | ||
@@ -93,5 +137,4 @@ | ||
**remark-lint** is just a **remark** plug-in. Meaning, you can opt to | ||
configure using configuration files. Read more about these files | ||
(`.remarkrc` or `package.json`) in [**remark**’s docs][remarkrc]. | ||
**remark-lint** is a **remark** plug-in and supports configuration | ||
through its [configuration files][cli]. | ||
@@ -103,3 +146,3 @@ An example `.remarkrc` file could look as follows: | ||
"plugins": { | ||
"lint": { | ||
"remark-lint": { | ||
"no-multiple-toplevel-headings": false, | ||
@@ -109,5 +152,2 @@ "list-item-indent": false, | ||
} | ||
}, | ||
"settings": { | ||
"commonmark": true | ||
} | ||
@@ -117,6 +157,4 @@ } | ||
Where the object at `plugins.lint` is a map of `ruleId`s and their values. The | ||
object at `settings` determines how **remark** parses (and compiles) | ||
markdown code. Read more about the latter on | ||
[**remark**’s readme][remark-process]. | ||
Where the object at `plugins['remark-lint']` is a map of `ruleId`s and | ||
their values. | ||
@@ -131,20 +169,16 @@ Using our `example.md` from before: | ||
We now run the below command _without_ the `-u remark-lint` since | ||
our `.remarkrc` includes the lint plugin. | ||
Now, running `remark example.md` (**without `-u remark-lint`** since | ||
our `.remarkrc` includes the lint plugin) yields: | ||
```bash | ||
remark example.md | ||
# | ||
# Yields: | ||
# | ||
# example.md | ||
# 3:1-3:10 warning Found reference to undefined definition no-undefined-references | ||
# | ||
# ⚠ 2 warnings | ||
example.md | ||
3:1-3:10 warning Found reference to undefined definition no-undefined-references | ||
⚠ 2 warnings | ||
``` | ||
In addition, you can also provide configuration comments to turn a rule | ||
on or off inside a file. Note that you cannot change what a setting, | ||
such as `maximum-line-length`, checks for, as you’re either enabling | ||
or disabling warnings). Read more about configuration comments in | ||
on or off inside a file. Note that you cannot change what a setting, | ||
such as `maximum-line-length`, just whether they are shown or not. | ||
Read more about configuration comments in | ||
[**remark-message-control**][message-control]s documentation. | ||
@@ -180,3 +214,3 @@ | ||
One of **remark**’s cool parts is that it compiles to very clean, and highly | ||
cross-vendor supported markdown. It’ll ensure list items use a single bullet, | ||
cross-vendor supported markdown. It’ll ensure list items use a single bullet, | ||
emphasis and strong use a standard marker, and that your table fences are | ||
@@ -193,3 +227,3 @@ aligned. | ||
I’m very interested in more integrations. Let me know if I can help. | ||
I’m very interested in more integrations. Let me know if I can help. | ||
@@ -205,19 +239,13 @@ ## List of External Rules | ||
— Ensure list items are in alphabetical order; | ||
* [`vhf/remark-lint-blank-lines-1-0-2`](https://github.com/vhf/remark-lint-blank-lines-1-0-2) | ||
— Ensure a specific number of lines between blocks; | ||
* [`vhf/remark-lint-books-links`](https://github.com/vhf/remark-lint-books-links) | ||
— Ensure links in lists of books follow a standard format; | ||
* [`Qard/remark-lint-code`](https://github.com/Qard/remark-lint-code) | ||
— Lint fenced code blocks by corresponding language tags, | ||
currently supporting [ESLint](https://github.com/Qard/remark-lint-code-eslint). | ||
* [`vhf/remark-lint-no-empty-sections`](https://github.com/vhf/remark-lint-no-empty-sections) | ||
— Ensure every heading is followed by content (forming a section); | ||
* [`chcokr/remark-lint-sentence-newline`](https://github.com/chcokr/remark-lint-sentence-newline) | ||
— Ensure sentences are followed by a newline; | ||
* [`vhf/remark-lint-no-url-trailing-slash`](https://github.com/vhf/remark-lint-no-url-trailing-slash) | ||
@@ -237,16 +265,24 @@ — Ensure that the `href` of links has no trailing slash. | ||
[travis-badge]: https://img.shields.io/travis/wooorm/remark-lint.svg | ||
[build-badge]: https://img.shields.io/travis/wooorm/remark-inline-links.svg | ||
[travis-ci]: https://travis-ci.org/wooorm/remark-lint | ||
[build-status]: https://travis-ci.org/wooorm/remark-inline-links | ||
[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/remark-lint.svg | ||
[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/remark-inline-links.svg | ||
[coverage-ci]: https://codecov.io/github/wooorm/remark-lint | ||
[coverage-status]: https://codecov.io/github/wooorm/remark-inline-links | ||
[npm-install]: https://docs.npmjs.com/cli/install | ||
[chat-badge]: https://img.shields.io/gitter/room/wooorm/remark.svg | ||
[releases]: https://github.com/wooorm/remark-lint/releases | ||
[chat]: https://gitter.im/wooorm/remark | ||
[releases]: https://github.com/wooorm/remark-inline-links/releases | ||
[license]: LICENSE | ||
[author]: http://wooorm.com | ||
[npm]: https://docs.npmjs.com/cli/install | ||
[remark]: https://github.com/wooorm/remark | ||
[logo]: https://cdn.rawgit.com/wooorm/remark-lint/master/logo.svg | ||
@@ -258,16 +294,14 @@ | ||
[api]: doc/api.md | ||
[api]: https://github.com/wooorm/remark/tree/master/packages/remark | ||
[license]: LICENSE | ||
[cli]: https://github.com/wooorm/remark/tree/master/packages/remark-cli | ||
[remark]: https://github.com/wooorm/remark | ||
[remark-plugins]: https://github.com/wooorm/remark/blob/master/doc/plugins.md | ||
[remarkrc]: https://github.com/wooorm/remark/blob/master/doc/remarkrc.5.md | ||
[linter-markdown]: https://atom.io/packages/linter-markdown | ||
[remark-process]: https://github.com/wooorm/remark#remarkprocessvalue-options-done | ||
[message-control]: https://github.com/wooorm/remark-message-control#markers | ||
[linter-markdown]: https://atom.io/packages/linter-markdown | ||
[vfile]: https://github.com/wooorm/vfile | ||
[message-control]: https://github.com/wooorm/remark-message-control#markers | ||
[vfile-message]: https://github.com/wooorm/vfile#vfilemessage |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
144505
293
15
63