mirror of
https://github.com/remarkjs/remark-lint.git
synced 2024-09-11 19:57:15 +03:00
Rename mdast-github
> remark-github
This commit is contained in:
parent
63cdcab720
commit
811ce91c4c
@ -2,5 +2,5 @@ build/
|
||||
components/
|
||||
coverage/
|
||||
build.js
|
||||
mdast-lint.js
|
||||
mdast-lint.min.js
|
||||
remark-lint.js
|
||||
remark-lint.min.js
|
||||
|
@ -5,8 +5,8 @@
|
||||
"coverage/",
|
||||
"node_modules/",
|
||||
"build.js",
|
||||
"mdast-lint.js",
|
||||
"mdast-lint.min.js"
|
||||
"remark-lint.js",
|
||||
"remark-lint.min.js"
|
||||
],
|
||||
"jsDoc": {
|
||||
"checkAnnotations": "jsdoc3",
|
||||
|
10
bower.json
10
bower.json
@ -1,17 +1,17 @@
|
||||
{
|
||||
"name": "mdast-lint",
|
||||
"main": "mdast-lint.js",
|
||||
"description": "Lint markdown with mdast",
|
||||
"name": "remark-lint",
|
||||
"main": "remark-lint.js",
|
||||
"description": "Lint markdown with remark",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"markdown",
|
||||
"lint",
|
||||
"validate",
|
||||
"mdast"
|
||||
"remark"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/wooorm/mdast-lint.git"
|
||||
"url": "https://github.com/wooorm/remark-lint.git"
|
||||
},
|
||||
"authors": [
|
||||
"Titus Wormer <tituswormer@gmail.com>"
|
||||
|
@ -1,15 +1,15 @@
|
||||
{
|
||||
"name": "mdast-lint",
|
||||
"name": "remark-lint",
|
||||
"version": "1.1.1",
|
||||
"description": "Lint markdown with mdast",
|
||||
"description": "Lint markdown with remark",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"markdown",
|
||||
"lint",
|
||||
"validate",
|
||||
"mdast"
|
||||
"remark"
|
||||
],
|
||||
"repository": "wooorm/mdast-lint",
|
||||
"repository": "wooorm/remark-lint",
|
||||
"dependencies": {
|
||||
"sindresorhus/plur": "^2.0.0",
|
||||
"wooorm/mdast-range": "^1.0.0",
|
||||
|
12
doc/api.md
12
doc/api.md
@ -5,9 +5,9 @@
|
||||
Dependencies:
|
||||
|
||||
```javascript
|
||||
var mdast = require('mdast');
|
||||
var lint = require('mdast-lint');
|
||||
var processor = mdast().use(lint);
|
||||
var remark = require('remark');
|
||||
var lint = require('remark-lint');
|
||||
var processor = remark().use(lint);
|
||||
```
|
||||
|
||||
Example document.
|
||||
@ -49,10 +49,10 @@ processor.process(doc, function (err, file, res) {
|
||||
});
|
||||
```
|
||||
|
||||
## [mdast](https://github.com/wooorm/mdast#api).[use](https://github.com/wooorm/mdast#mdastuseplugin-options)(lint, options)
|
||||
## [remark](https://github.com/wooorm/remark#api).[use](https://github.com/wooorm/remark#remarkuseplugin-options)(lint, options)
|
||||
|
||||
Adds warnings for style violations to a given [virtual file](https://github.com/wooorm/mdast/blob/master/doc/mdast.3.md#file)
|
||||
using mdast’s [warning API](https://github.com/wooorm/mdast/blob/master/doc/mdast.3.md#filewarnreason-position).
|
||||
Adds warnings for style violations to a given [virtual file](https://github.com/wooorm/remark/blob/master/doc/remark.3.md#file)
|
||||
using remark’s [warning API](https://github.com/wooorm/remark/blob/master/doc/remark.3.md#filewarnreason-position).
|
||||
|
||||
When processing a file, these warnings are available at `file.messages`, and
|
||||
look as follows:
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
This table documents the similarity and difference between
|
||||
[**markdownlint**](https://github.com/mivok/markdownlint/blob/master/docs/RULES.md)
|
||||
rules and **mdast-lint**’s rules.
|
||||
rules and **remark-lint**’s rules.
|
||||
|
||||
| markdownlint | mdast | note |
|
||||
| markdownlint | remark | note |
|
||||
| ------------ | ----------------------------- | ---------------------------------------------------------------------------------------- |
|
||||
| MD001 | heading-increment | |
|
||||
| MD002 | first-heading-level | |
|
||||
@ -30,14 +30,14 @@ rules and **mdast-lint**’s rules.
|
||||
| MD026 | no-heading-punctuation | |
|
||||
| MD027 | blockquote-indentation | Won’t warn when that’s your preferred, consistent style |
|
||||
| MD028 | no-blockquote-without-caret | |
|
||||
| MD029 | ordered-list-marker-value | markdownlint defaults to `one`, whereas mdast-lint defaults to `ordered` |
|
||||
| MD029 | ordered-list-marker-value | markdownlint defaults to `one`, whereas remark-lint defaults to `ordered` |
|
||||
| MD030 | list-item-indent | |
|
||||
| MD031 | no-missing-blank-lines | |
|
||||
| MD032 | no-missing-blank-lines | |
|
||||
| MD033 | no-html | |
|
||||
| MD034 | no-literal-urls | |
|
||||
| MD035 | rule-style | |
|
||||
| MD036 | emphasis-heading | mdast-lint only warns when the emphasis is followed by a colon, but that might change. |
|
||||
| MD036 | emphasis-heading | remark-lint only warns when the emphasis is followed by a colon, but that might change. |
|
||||
| MD037 | no-inline-padding | |
|
||||
| MD038 | no-inline-padding | |
|
||||
| MD039 | no-inline-padding | |
|
||||
|
64
history.md
64
history.md
@ -5,78 +5,78 @@
|
||||
1.1.1 / 2015-09-12
|
||||
==================
|
||||
|
||||
* Add support for camel-case properties ([35c4066](https://github.com/wooorm/mdast-lint/commit/35c4066))
|
||||
* Add support for camel-case properties ([35c4066](https://github.com/wooorm/remark-lint/commit/35c4066))
|
||||
|
||||
1.1.0 / 2015-08-31
|
||||
==================
|
||||
|
||||
* Add en- and disabling multiple rules in one comment ([29976d0](https://github.com/wooorm/mdast-lint/commit/29976d0))
|
||||
* Replace `vfile` patching of data with vfile-namespaces ([c1136a1](https://github.com/wooorm/mdast-lint/commit/c1136a1))
|
||||
* Add en- and disabling multiple rules in one comment ([29976d0](https://github.com/wooorm/remark-lint/commit/29976d0))
|
||||
* Replace `vfile` patching of data with vfile-namespaces ([c1136a1](https://github.com/wooorm/remark-lint/commit/c1136a1))
|
||||
|
||||
1.0.0 / 2015-08-17
|
||||
==================
|
||||
|
||||
* Update dependencies ([4936d35](https://github.com/wooorm/mdast-lint/commit/4936d35))
|
||||
* Update dependencies ([4936d35](https://github.com/wooorm/remark-lint/commit/4936d35))
|
||||
|
||||
0.4.5 / 2015-08-08
|
||||
==================
|
||||
|
||||
* Fix typo in definition-case warning ([490ac16](https://github.com/wooorm/mdast-lint/commit/490ac16))
|
||||
* Fix typo in definition-case warning ([490ac16](https://github.com/wooorm/remark-lint/commit/490ac16))
|
||||
|
||||
0.4.4 / 2015-08-05
|
||||
==================
|
||||
|
||||
* Remove maximum-line-length warnings on definitions ([1119ca8](https://github.com/wooorm/mdast-lint/commit/1119ca8))
|
||||
* Add `linter-markdown` to `readme.md` ([7de8847](https://github.com/wooorm/mdast-lint/commit/7de8847))
|
||||
* Remove maximum-line-length warnings on definitions ([1119ca8](https://github.com/wooorm/remark-lint/commit/1119ca8))
|
||||
* Add `linter-markdown` to `readme.md` ([7de8847](https://github.com/wooorm/remark-lint/commit/7de8847))
|
||||
|
||||
0.4.3 / 2015-08-04
|
||||
==================
|
||||
|
||||
* Fix failure on block-quotes without children ([a9aaff7](https://github.com/wooorm/mdast-lint/commit/a9aaff7))
|
||||
* Update mdast dev-dependency ([34df79c](https://github.com/wooorm/mdast-lint/commit/34df79c))
|
||||
* Add vfile as a dev-dependency ([84d1ce3](https://github.com/wooorm/mdast-lint/commit/84d1ce3))
|
||||
* Fix failure on block-quotes without children ([a9aaff7](https://github.com/wooorm/remark-lint/commit/a9aaff7))
|
||||
* Update mdast dev-dependency ([34df79c](https://github.com/wooorm/remark-lint/commit/34df79c))
|
||||
* Add vfile as a dev-dependency ([84d1ce3](https://github.com/wooorm/remark-lint/commit/84d1ce3))
|
||||
|
||||
0.4.2 / 2015-07-12
|
||||
==================
|
||||
|
||||
* Remove peer-dependencies ([8d70fcf](https://github.com/wooorm/mdast-lint/commit/8d70fcf))
|
||||
* Remove peer-dependencies ([8d70fcf](https://github.com/wooorm/remark-lint/commit/8d70fcf))
|
||||
|
||||
0.4.1 / 2015-07-05
|
||||
==================
|
||||
|
||||
* Remove component support ([58d7e6b](https://github.com/wooorm/mdast-lint/commit/58d7e6b))
|
||||
* Refactor to externalise `lib/utilities/` ([eb78529](https://github.com/wooorm/mdast-lint/commit/eb78529))
|
||||
* Remove component support ([58d7e6b](https://github.com/wooorm/remark-lint/commit/58d7e6b))
|
||||
* Refactor to externalise `lib/utilities/` ([eb78529](https://github.com/wooorm/remark-lint/commit/eb78529))
|
||||
|
||||
0.4.0 / 2015-06-29
|
||||
==================
|
||||
|
||||
* Add gap support ([136e760](https://github.com/wooorm/mdast-lint/commit/136e760))
|
||||
* Update mdast ([2d122e4](https://github.com/wooorm/mdast-lint/commit/2d122e4))
|
||||
* Add gap support ([136e760](https://github.com/wooorm/remark-lint/commit/136e760))
|
||||
* Update mdast ([2d122e4](https://github.com/wooorm/remark-lint/commit/2d122e4))
|
||||
|
||||
0.3.0 / 2015-06-20
|
||||
==================
|
||||
|
||||
* Add checkbox-content-indent rule ([7b55519](https://github.com/wooorm/mdast-lint/commit/7b55519))
|
||||
* Fix dot-files from being read as fixtures ([ecbec2c](https://github.com/wooorm/mdast-lint/commit/ecbec2c))
|
||||
* Add checkbox-character-style rule ([7ed4579](https://github.com/wooorm/mdast-lint/commit/7ed4579))
|
||||
* Fix tests for invalid position given my mdast-range ([55d1128](https://github.com/wooorm/mdast-lint/commit/55d1128))
|
||||
* Add missing jsdoc comment ([63b83b9](https://github.com/wooorm/mdast-lint/commit/63b83b9))
|
||||
* Update eslint ([a3b0829](https://github.com/wooorm/mdast-lint/commit/a3b0829))
|
||||
* Update mdast, mdast-yaml-config ([52bac04](https://github.com/wooorm/mdast-lint/commit/52bac04))
|
||||
* Add checkbox-content-indent rule ([7b55519](https://github.com/wooorm/remark-lint/commit/7b55519))
|
||||
* Fix dot-files from being read as fixtures ([ecbec2c](https://github.com/wooorm/remark-lint/commit/ecbec2c))
|
||||
* Add checkbox-character-style rule ([7ed4579](https://github.com/wooorm/remark-lint/commit/7ed4579))
|
||||
* Fix tests for invalid position given my mdast-range ([55d1128](https://github.com/wooorm/remark-lint/commit/55d1128))
|
||||
* Add missing jsdoc comment ([63b83b9](https://github.com/wooorm/remark-lint/commit/63b83b9))
|
||||
* Update eslint ([a3b0829](https://github.com/wooorm/remark-lint/commit/a3b0829))
|
||||
* Update mdast, mdast-yaml-config ([52bac04](https://github.com/wooorm/remark-lint/commit/52bac04))
|
||||
|
||||
0.2.0 / 2015-06-13
|
||||
==================
|
||||
|
||||
* Remove mdast-usage, add mdast-yaml-config as dependencies ([053674f](https://github.com/wooorm/mdast-lint/commit/053674f))
|
||||
* Add images to blacklist for maximum-line-length ([ba6d270](https://github.com/wooorm/mdast-lint/commit/ba6d270))
|
||||
* Refactor to use rawgit references to images in `readme.md` ([3f6344c](https://github.com/wooorm/mdast-lint/commit/3f6344c))
|
||||
* Add support for external rules ([5162a09](https://github.com/wooorm/mdast-lint/commit/5162a09))
|
||||
* Refactor additional, fileless, rules support ([6d2ba65](https://github.com/wooorm/mdast-lint/commit/6d2ba65))
|
||||
* Adds support for automatic doc generation for file-less rules ([29965a3](https://github.com/wooorm/mdast-lint/commit/29965a3))
|
||||
* Add `reset` docs to rule generation script ([77b8bfd](https://github.com/wooorm/mdast-lint/commit/77b8bfd))
|
||||
* Adds `reset` rule to docs ([90a5f8a](https://github.com/wooorm/mdast-lint/commit/90a5f8a))
|
||||
* Update wording re rules in `readme.md` ([00d9ba4](https://github.com/wooorm/mdast-lint/commit/00d9ba4))
|
||||
* Update rule count in `readme.md` ([f937cf4](https://github.com/wooorm/mdast-lint/commit/f937cf4))
|
||||
* Remove mdast-usage, add mdast-yaml-config as dependencies ([053674f](https://github.com/wooorm/remark-lint/commit/053674f))
|
||||
* Add images to blacklist for maximum-line-length ([ba6d270](https://github.com/wooorm/remark-lint/commit/ba6d270))
|
||||
* Refactor to use rawgit references to images in `readme.md` ([3f6344c](https://github.com/wooorm/remark-lint/commit/3f6344c))
|
||||
* Add support for external rules ([5162a09](https://github.com/wooorm/remark-lint/commit/5162a09))
|
||||
* Refactor additional, fileless, rules support ([6d2ba65](https://github.com/wooorm/remark-lint/commit/6d2ba65))
|
||||
* Adds support for automatic doc generation for file-less rules ([29965a3](https://github.com/wooorm/remark-lint/commit/29965a3))
|
||||
* Add `reset` docs to rule generation script ([77b8bfd](https://github.com/wooorm/remark-lint/commit/77b8bfd))
|
||||
* Adds `reset` rule to docs ([90a5f8a](https://github.com/wooorm/remark-lint/commit/90a5f8a))
|
||||
* Update wording re rules in `readme.md` ([00d9ba4](https://github.com/wooorm/remark-lint/commit/00d9ba4))
|
||||
* Update rule count in `readme.md` ([f937cf4](https://github.com/wooorm/remark-lint/commit/f937cf4))
|
||||
|
||||
0.1.0 / 2015-06-11
|
||||
==================
|
||||
|
4
index.js
4
index.js
@ -2,8 +2,8 @@
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
* @license MIT
|
||||
* @module mdast:lint
|
||||
* @fileoverview Lint markdown with mdast.
|
||||
* @module remark:lint
|
||||
* @fileoverview Lint markdown with remark.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
@ -2,9 +2,9 @@
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
* @license MIT
|
||||
* @module mdast:lint:filter
|
||||
* @fileoverview mdast plug-in used internally by
|
||||
* mdast-lint to filter ruleId’s by enabled and disabled
|
||||
* @module remark:lint:filter
|
||||
* @fileoverview remark plug-in used internally by
|
||||
* remark-lint to filter ruleId’s by enabled and disabled
|
||||
* ranges, or by gaps.
|
||||
* @todo Externalise into its own repository.
|
||||
*/
|
||||
@ -25,7 +25,7 @@ function transformer(ast, file) {
|
||||
var gaps = [];
|
||||
var offset = 0;
|
||||
var isGap = false;
|
||||
var scope = file.namespace('mdast-lint').ranges;
|
||||
var scope = file.namespace('remark-lint').ranges;
|
||||
|
||||
if (!file || !file.messages || !file.messages.length) {
|
||||
return;
|
||||
|
32
lib/index.js
32
lib/index.js
@ -2,8 +2,8 @@
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
* @license MIT
|
||||
* @module mdast:lint:library
|
||||
* @fileoverview mdast plug-in providing warnings when
|
||||
* @module remark:lint:library
|
||||
* @fileoverview remark plug-in providing warnings when
|
||||
* detecting style violations.
|
||||
*/
|
||||
|
||||
@ -44,14 +44,14 @@ var cwd = process && process.cwd();
|
||||
*/
|
||||
function attachFactory(id, rule, options) {
|
||||
/**
|
||||
* Attach the rule to an mdast instance, unless `false`
|
||||
* Attach the rule to a remark instance, unless `false`
|
||||
* is passed as an option.
|
||||
*
|
||||
* @return {Function?} - See `plugin` below.
|
||||
*/
|
||||
function attach() {
|
||||
/**
|
||||
* Attach the rule to an mdast instance, unless `false`
|
||||
* Attach the rule to a remark instance, unless `false`
|
||||
* is passed as an option.
|
||||
*
|
||||
* @param {Node} ast - Root node.
|
||||
@ -59,7 +59,7 @@ function attachFactory(id, rule, options) {
|
||||
* @param {Function} next - Signal end.
|
||||
*/
|
||||
function plugin(ast, file, next) {
|
||||
var scope = file.namespace('mdast-lint');
|
||||
var scope = file.namespace('remark-lint');
|
||||
|
||||
/*
|
||||
* Track new messages per file.
|
||||
@ -200,15 +200,15 @@ function decamelizeSettings(source) {
|
||||
* a non-nully and non-false value.
|
||||
*
|
||||
* @example
|
||||
* var processor = lint(mdast, {
|
||||
* var processor = lint(remark, {
|
||||
* 'html': false // Ignore HTML warnings.
|
||||
* });
|
||||
*
|
||||
* @param {MDAST} mdast - Host object.
|
||||
* @param {Remark} remark - Host object.
|
||||
* @param {Object?} options - Hash of rule names mapping to
|
||||
* rule options.
|
||||
*/
|
||||
function lint(mdast, options) {
|
||||
function lint(remark, options) {
|
||||
var settings = decamelizeSettings(options || {});
|
||||
var reset = settings.reset;
|
||||
var rules = loadExternals(settings.external);
|
||||
@ -219,7 +219,7 @@ function lint(mdast, options) {
|
||||
* Ensure offset information is added.
|
||||
*/
|
||||
|
||||
mdast.use(range);
|
||||
remark.use(range);
|
||||
|
||||
/**
|
||||
* Get the latest state of a rule.
|
||||
@ -228,7 +228,7 @@ function lint(mdast, options) {
|
||||
* @param {File} [file] - File (optional)
|
||||
*/
|
||||
function getState(ruleId, file) {
|
||||
var scope = file && file.namespace('mdast-lint');
|
||||
var scope = file && file.namespace('remark-lint');
|
||||
var ranges = scope && scope.ranges && scope.ranges[ruleId];
|
||||
|
||||
if (ranges) {
|
||||
@ -250,7 +250,7 @@ function lint(mdast, options) {
|
||||
* @param {File} file - Virtual file.
|
||||
*/
|
||||
function store(file) {
|
||||
var scope = file.namespace('mdast-lint');
|
||||
var scope = file.namespace('remark-lint');
|
||||
var ranges = scope.ranges;
|
||||
var ruleId;
|
||||
|
||||
@ -271,7 +271,7 @@ function lint(mdast, options) {
|
||||
}
|
||||
}
|
||||
|
||||
mdast.use(function () {
|
||||
remark.use(function () {
|
||||
return function (ast, file) {
|
||||
store(file);
|
||||
};
|
||||
@ -282,7 +282,7 @@ function lint(mdast, options) {
|
||||
*/
|
||||
|
||||
for (id in rules) {
|
||||
mdast.use(attachFactory(id, rules[id], settings[id]));
|
||||
remark.use(attachFactory(id, rules[id], settings[id]));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -294,7 +294,7 @@ function lint(mdast, options) {
|
||||
* @param {*} ruleId - Rule to toggle.
|
||||
*/
|
||||
function toggle(file, marker, type, ruleId) {
|
||||
var scope = file.namespace('mdast-lint');
|
||||
var scope = file.namespace('remark-lint');
|
||||
var markers;
|
||||
var currentState;
|
||||
var previousState;
|
||||
@ -345,7 +345,7 @@ function lint(mdast, options) {
|
||||
}
|
||||
}
|
||||
|
||||
mdast.use(zone({
|
||||
remark.use(zone({
|
||||
'name': 'lint',
|
||||
'onparse': onparse
|
||||
}));
|
||||
@ -354,7 +354,7 @@ function lint(mdast, options) {
|
||||
* Filter.
|
||||
*/
|
||||
|
||||
mdast.use(filter);
|
||||
remark.use(filter);
|
||||
|
||||
/**
|
||||
* Transformer sort messages.
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @fileoverview
|
||||
* Warn when HTML nodes are used.
|
||||
*
|
||||
* Ignores comments, because they are used by this tool, mdast, and
|
||||
* Ignores comments, because they are used by this tool, remark, and
|
||||
* because markdown doesn’t have native comments.
|
||||
* @example
|
||||
* <!-- Invalid: -->
|
||||
|
1
mdast-lint.min.js
vendored
1
mdast-lint.min.js
vendored
File diff suppressed because one or more lines are too long
16
package.json
16
package.json
@ -1,15 +1,15 @@
|
||||
{
|
||||
"name": "mdast-lint",
|
||||
"name": "remark-lint",
|
||||
"version": "1.1.1",
|
||||
"description": "Lint markdown with mdast",
|
||||
"description": "Lint markdown with remark",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"markdown",
|
||||
"lint",
|
||||
"validate",
|
||||
"mdast"
|
||||
"remark"
|
||||
],
|
||||
"repository": "wooorm/mdast-lint",
|
||||
"repository": "wooorm/remark-lint",
|
||||
"author": "Titus Wormer <tituswormer@gmail.com>",
|
||||
"dependencies": {
|
||||
"decamelize": "^1.0.0",
|
||||
@ -17,7 +17,7 @@
|
||||
"mdast-util-heading-style": "^1.0.0",
|
||||
"mdast-util-position": "^1.0.0",
|
||||
"mdast-util-to-string": "^1.0.0",
|
||||
"mdast-zone": "^2.0.0-alpha.1",
|
||||
"mdast-zone": "^2.0.0",
|
||||
"plur": "^2.0.0",
|
||||
"unist-util-visit": "^1.0.0",
|
||||
"vfile-sort": "^1.0.0"
|
||||
@ -34,7 +34,7 @@
|
||||
"istanbul": "^0.3.0",
|
||||
"jscs": "^2.0.0",
|
||||
"jscs-jsdoc": "^1.0.0",
|
||||
"mdast": "^3.0.0-alpha.3",
|
||||
"mdast": "^3.0.0-alpha.5",
|
||||
"mdast-comment-config": "^2.0.0-alpha.1",
|
||||
"mdast-github": "^2.0.0-alpha.1",
|
||||
"mdast-toc": "^1.0.0",
|
||||
@ -53,8 +53,8 @@
|
||||
"make": "npm run lint && npm run test-coverage",
|
||||
"build-rules": "node script/build-rule-documentation.js",
|
||||
"build-md": "mdast . --quiet",
|
||||
"build-bundle": "browserify index.js --bare -s mdastLint > mdast-lint.js",
|
||||
"postbuild-bundle": "esmangle mdast-lint.js > mdast-lint.min.js",
|
||||
"build-bundle": "browserify index.js --bare -s remarkLint > remark-lint.js",
|
||||
"postbuild-bundle": "esmangle remark-lint.js > remark-lint.min.js",
|
||||
"build": "npm run build-rules && npm run build-md && npm run build-bundle"
|
||||
}
|
||||
}
|
||||
|
56
readme.md
56
readme.md
@ -1,16 +1,16 @@
|
||||
# ![mdast-lint](https://cdn.rawgit.com/wooorm/mdast-lint/master/logo.svg)
|
||||
# ![remark-lint](https://cdn.rawgit.com/wooorm/remark-lint/master/logo.svg)
|
||||
|
||||
[![Build Status](https://img.shields.io/travis/wooorm/mdast-lint.svg)](https://travis-ci.org/wooorm/mdast-lint) [![Coverage Status](https://img.shields.io/codecov/c/github/wooorm/mdast-lint.svg)](https://codecov.io/github/wooorm/mdast-lint)
|
||||
[![Build Status](https://img.shields.io/travis/wooorm/remark-lint.svg)](https://travis-ci.org/wooorm/remark-lint) [![Coverage Status](https://img.shields.io/codecov/c/github/wooorm/remark-lint.svg)](https://codecov.io/github/wooorm/remark-lint)
|
||||
|
||||
**mdast-lint** is a markdown code style linter. Another linter? Yes.
|
||||
**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,
|
||||
but the defaults are sensible :ok_hand:.
|
||||
but the defaults are sensible :ok\_hand:.
|
||||
|
||||
**mdast-lint** has lots of tests. Supports Node, io.js, and the browser.
|
||||
100% coverage. 50+ rules. It’s built on [**mdast**](https://github.com/wooorm/mdast),
|
||||
a powerful markdown processor powered by [plugins](https://github.com/wooorm/mdast/blob/master/doc/plugins.md)
|
||||
**remark-lint** has lots of tests. Supports Node, io.js, and the browser.
|
||||
100% coverage. 50+ rules. It’s built on [**remark**](https://github.com/wooorm/remark),
|
||||
a powerful markdown processor powered by [plugins](https://github.com/wooorm/remark/blob/master/doc/plugins.md)
|
||||
(such as this one).
|
||||
|
||||
## Table of Contents
|
||||
@ -19,8 +19,8 @@ a powerful markdown processor powered by [plugins](https://github.com/wooorm/mda
|
||||
* [Command line](#command-line)
|
||||
* [Programmatic](#programmatic)
|
||||
* [Rules](#rules)
|
||||
* [Configuring mdast-lint](#configuring-mdast-lint)
|
||||
* [Using mdast to fix your markdown](#using-mdast-to-fix-your-markdown)
|
||||
* [Configuring remark-lint](#configuring-remark-lint)
|
||||
* [Using remark to fix your markdown](#using-remark-to-fix-your-markdown)
|
||||
* [Editor Integrations](#editor-integrations)
|
||||
* [Related](#related)
|
||||
* [License](#license)
|
||||
@ -30,20 +30,20 @@ a powerful markdown processor powered by [plugins](https://github.com/wooorm/mda
|
||||
[npm](https://docs.npmjs.com/cli/install):
|
||||
|
||||
```bash
|
||||
npm install mdast-lint
|
||||
npm install remark-lint
|
||||
```
|
||||
|
||||
**mdast-lint** is also available for bower, duo, and for AMD,
|
||||
**remark-lint** is also available for bower, duo, and for AMD,
|
||||
CommonJS, and globals.
|
||||
|
||||
## Command line
|
||||
|
||||
![Example of how mdast-lint looks on screen](https://cdn.rawgit.com/wooorm/mdast-lint/master/screen-shot.png)
|
||||
![Example of how remark-lint looks on screen](https://cdn.rawgit.com/wooorm/remark-lint/master/screen-shot.png)
|
||||
|
||||
Use mdast-lint together with mdast:
|
||||
Use remark-lint together with remark:
|
||||
|
||||
```bash
|
||||
npm install --global mdast mdast-lint
|
||||
npm install --global remark remark-lint
|
||||
```
|
||||
|
||||
Let’s say `example.md` looks as follows:
|
||||
@ -54,10 +54,10 @@ Let’s say `example.md` looks as follows:
|
||||
- World
|
||||
```
|
||||
|
||||
Then, to run **mdast-lint** on `example.md`:
|
||||
Then, to run **remark-lint** on `example.md`:
|
||||
|
||||
```bash
|
||||
mdast -u mdast-lint example.md
|
||||
remark -u remark-lint example.md
|
||||
#
|
||||
# Yields:
|
||||
#
|
||||
@ -79,7 +79,7 @@ turn them off).
|
||||
|
||||
## Programmatic
|
||||
|
||||
[doc/api.md](doc/api.md) describes how to use **mdast-lint**’s
|
||||
[doc/api.md](doc/api.md) describes how to use **remark-lint**’s
|
||||
programatic interface in JavaScript.
|
||||
|
||||
## Rules
|
||||
@ -87,13 +87,13 @@ programatic interface in JavaScript.
|
||||
[doc/rules.md](doc/rules.md) describes all available rules, what they check
|
||||
for, examples of markdown they warn for, and how to fix their warnings.
|
||||
|
||||
## Configuring mdast-lint
|
||||
## Configuring remark-lint
|
||||
|
||||
**mdast-lint** is just an **mdast** plug-in. Meaning, you can opt to
|
||||
**remark-lint** is just a **remark** plug-in. Meaning, you can opt to
|
||||
configure using configuration files. Read more about these files
|
||||
(`.mdastrc` or `package.json`) in [**mdast**’s docs](https://github.com/wooorm/mdast/blob/master/doc/mdastrc.5.md).
|
||||
(`.remarkrc` or `package.json`) in [**remark**’s docs](https://github.com/wooorm/remark/blob/master/doc/remarkrc.5.md).
|
||||
|
||||
An example `.mdastrc` file could look as follows:
|
||||
An example `.remarkrc` file could look as follows:
|
||||
|
||||
```json
|
||||
{
|
||||
@ -112,8 +112,8 @@ An example `.mdastrc` file could look as follows:
|
||||
```
|
||||
|
||||
Where the object at `plugins.lint` is a map of `ruleId`s and their values.
|
||||
The object at `settings` determines how **mdast** parses (and compiles)
|
||||
markdown code. Read more about the latter on [**mdast**’s readme](https://github.com/wooorm/mdast#mdastprocessvalue-options-done).
|
||||
The object at `settings` determines how **remark** parses (and compiles)
|
||||
markdown code. Read more about the latter on [**remark**’s readme](https://github.com/wooorm/remark#remarkprocessvalue-options-done).
|
||||
|
||||
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
|
||||
@ -144,25 +144,25 @@ but the third is re-enabled):
|
||||
### Hello
|
||||
```
|
||||
|
||||
## Using mdast to fix your markdown
|
||||
## Using remark to fix your markdown
|
||||
|
||||
One of **mdast**’s cool parts is that it compiles to very clean, and highly
|
||||
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,
|
||||
emphasis and strong use a standard marker, and that your table fences are
|
||||
aligned.
|
||||
|
||||
**mdast** should be able to fix most of your styling issues automatically,
|
||||
**remark** should be able to fix most of your styling issues automatically,
|
||||
and I strongly suggest checking out how it can make your life easier :+1:
|
||||
|
||||
## Editor Integrations
|
||||
|
||||
Currently, **mdast-lint** is integrated with Atom through [**leipert/linter-markdown**](https://atom.io/packages/linter-markdown).
|
||||
Currently, **remark-lint** is integrated with Atom through [**leipert/linter-markdown**](https://atom.io/packages/linter-markdown).
|
||||
|
||||
I’m very interested in more integrations. Let me know if I can help.
|
||||
|
||||
## Related
|
||||
|
||||
* [`mdast-validate-links`](https://github.com/wooorm/mdast-validate-links)
|
||||
* [`remark-validate-links`](https://github.com/wooorm/remark-validate-links)
|
||||
— Validate if links point to existing headings and files in markdown.
|
||||
|
||||
## License
|
||||
|
@ -1,4 +1,4 @@
|
||||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.mdastLint = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
||||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.remarkLint = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -18,7 +18,7 @@ module.exports = require('./lib');
|
||||
* @license MIT
|
||||
* @module mdast:lint:filter
|
||||
* @fileoverview mdast plug-in used internally by
|
||||
* mdast-lint to filter ruleId’s by enabled and disabled
|
||||
* remark-lint to filter ruleId’s by enabled and disabled
|
||||
* ranges, or by gaps.
|
||||
* @todo Externalise into its own repository.
|
||||
*/
|
||||
@ -39,7 +39,7 @@ function transformer(ast, file) {
|
||||
var gaps = [];
|
||||
var offset = 0;
|
||||
var isGap = false;
|
||||
var scope = file.namespace('mdast-lint').ranges;
|
||||
var scope = file.namespace('remark-lint').ranges;
|
||||
|
||||
if (!file || !file.messages || !file.messages.length) {
|
||||
return;
|
||||
@ -150,7 +150,7 @@ function attacher() {
|
||||
|
||||
module.exports = attacher;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],3:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],3:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -212,7 +212,7 @@ function attachFactory(id, rule, options) {
|
||||
* @param {Function} next - Signal end.
|
||||
*/
|
||||
function plugin(ast, file, next) {
|
||||
var scope = file.namespace('mdast-lint');
|
||||
var scope = file.namespace('remark-lint');
|
||||
|
||||
/*
|
||||
* Track new messages per file.
|
||||
@ -381,7 +381,7 @@ function lint(mdast, options) {
|
||||
* @param {File} [file] - File (optional)
|
||||
*/
|
||||
function getState(ruleId, file) {
|
||||
var scope = file && file.namespace('mdast-lint');
|
||||
var scope = file && file.namespace('remark-lint');
|
||||
var ranges = scope && scope.ranges && scope.ranges[ruleId];
|
||||
|
||||
if (ranges) {
|
||||
@ -403,7 +403,7 @@ function lint(mdast, options) {
|
||||
* @param {File} file - Virtual file.
|
||||
*/
|
||||
function store(file) {
|
||||
var scope = file.namespace('mdast-lint');
|
||||
var scope = file.namespace('remark-lint');
|
||||
var ranges = scope.ranges;
|
||||
var ruleId;
|
||||
|
||||
@ -447,7 +447,7 @@ function lint(mdast, options) {
|
||||
* @param {*} ruleId - Rule to toggle.
|
||||
*/
|
||||
function toggle(file, marker, type, ruleId) {
|
||||
var scope = file.namespace('mdast-lint');
|
||||
var scope = file.namespace('remark-lint');
|
||||
var markers;
|
||||
var currentState;
|
||||
var previousState;
|
||||
@ -524,7 +524,7 @@ function lint(mdast, options) {
|
||||
|
||||
module.exports = lint;
|
||||
|
||||
},{"./filter":2,"./rules":20,"decamelize":60,"fs":undefined,"mdast-range":61,"mdast-zone":65,"path":undefined,"vfile-sort":68}],4:[function(require,module,exports){
|
||||
},{"./filter":2,"./rules":20,"decamelize":60,"fs":undefined,"mdast-range":62,"mdast-zone":66,"path":undefined,"vfile-sort":69}],4:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -635,7 +635,7 @@ function blockquoteIndentation(ast, file, preferred, done) {
|
||||
|
||||
module.exports = blockquoteIndentation;
|
||||
|
||||
},{"mdast-util-position":63,"mdast-util-to-string":64,"plur":66,"unist-util-visit":67}],5:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"mdast-util-to-string":65,"plur":67,"unist-util-visit":68}],5:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -821,7 +821,7 @@ function checkboxCharacterStyle(ast, file, preferred, done) {
|
||||
|
||||
module.exports = checkboxCharacterStyle;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],6:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],6:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -921,7 +921,7 @@ function checkboxContentIndent(ast, file, preferred, done) {
|
||||
|
||||
module.exports = checkboxContentIndent;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],7:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],7:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -1057,7 +1057,7 @@ function codeBlockStyle(ast, file, preferred, done) {
|
||||
|
||||
module.exports = codeBlockStyle;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],8:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],8:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -1134,7 +1134,7 @@ function definitionCase(ast, file, preferred, done) {
|
||||
|
||||
module.exports = definitionCase;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],9:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],9:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -1211,7 +1211,7 @@ function definitionSpacing(ast, file, preferred, done) {
|
||||
|
||||
module.exports = definitionSpacing;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],10:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],10:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -1298,7 +1298,7 @@ function emphasisMarker(ast, file, preferred, done) {
|
||||
|
||||
module.exports = emphasisMarker;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],11:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],11:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -1406,7 +1406,7 @@ function fencedCodeFlag(ast, file, preferred, done) {
|
||||
|
||||
module.exports = fencedCodeFlag;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],12:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],12:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -1523,7 +1523,7 @@ function fencedCodeMarker(ast, file, preferred, done) {
|
||||
|
||||
module.exports = fencedCodeMarker;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],13:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],13:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -1649,7 +1649,7 @@ function finalDefinition(ast, file, preferred, done) {
|
||||
|
||||
module.exports = finalDefinition;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],15:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],15:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -1745,7 +1745,7 @@ function firstHeadingLevel(ast, file, preferred, done) {
|
||||
|
||||
module.exports = firstHeadingLevel;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],17:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],17:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -1808,7 +1808,7 @@ function hardBreakSpaces(ast, file, preferred, done) {
|
||||
|
||||
module.exports = hardBreakSpaces;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],18:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],18:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -1874,7 +1874,7 @@ function headingIncrement(ast, file, preferred, done) {
|
||||
|
||||
module.exports = headingIncrement;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],19:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],19:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -1975,7 +1975,7 @@ function headingStyle(ast, file, preferred, done) {
|
||||
|
||||
module.exports = headingStyle;
|
||||
|
||||
},{"mdast-util-heading-style":62,"mdast-util-position":63,"unist-util-visit":67}],20:[function(require,module,exports){
|
||||
},{"mdast-util-heading-style":63,"mdast-util-position":64,"unist-util-visit":68}],20:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -2189,7 +2189,7 @@ function linkTitleStyle(ast, file, preferred, done) {
|
||||
|
||||
module.exports = linkTitleStyle;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],22:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],22:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -2269,7 +2269,7 @@ function listItemBulletIndent(ast, file, preferred, done) {
|
||||
|
||||
module.exports = listItemBulletIndent;
|
||||
|
||||
},{"mdast-util-position":63,"plur":66,"unist-util-visit":67}],23:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"plur":67,"unist-util-visit":68}],23:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -2384,7 +2384,7 @@ function listItemContentIndent(ast, file, preferred, done) {
|
||||
|
||||
module.exports = listItemContentIndent;
|
||||
|
||||
},{"mdast-util-position":63,"plur":66,"unist-util-visit":67}],24:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"plur":67,"unist-util-visit":68}],24:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -2535,7 +2535,7 @@ function listItemIndent(ast, file, preferred, done) {
|
||||
|
||||
module.exports = listItemIndent;
|
||||
|
||||
},{"mdast-util-position":63,"plur":66,"unist-util-visit":67}],25:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"plur":67,"unist-util-visit":68}],25:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -2656,7 +2656,7 @@ function listItemSpacing(ast, file, preferred, done) {
|
||||
|
||||
module.exports = listItemSpacing;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],26:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],26:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -2718,7 +2718,7 @@ function maximumHeadingLength(ast, file, preferred, done) {
|
||||
|
||||
module.exports = maximumHeadingLength;
|
||||
|
||||
},{"mdast-util-position":63,"mdast-util-to-string":64,"unist-util-visit":67}],27:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"mdast-util-to-string":65,"unist-util-visit":68}],27:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -2906,7 +2906,7 @@ function maximumLineLength(ast, file, preferred, done) {
|
||||
|
||||
module.exports = maximumLineLength;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],28:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],28:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -2993,7 +2993,7 @@ function noAutoLinkWithoutProtocol(ast, file, preferred, done) {
|
||||
|
||||
module.exports = noAutoLinkWithoutProtocol;
|
||||
|
||||
},{"mdast-util-position":63,"mdast-util-to-string":64,"unist-util-visit":67}],29:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"mdast-util-to-string":65,"unist-util-visit":68}],29:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -3080,7 +3080,7 @@ function noBlockquoteWithoutCaret(ast, file, preferred, done) {
|
||||
|
||||
module.exports = noBlockquoteWithoutCaret;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],30:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],30:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -3211,7 +3211,7 @@ function noConsecutiveBlankLines(ast, file, preferred, done) {
|
||||
|
||||
module.exports = noConsecutiveBlankLines;
|
||||
|
||||
},{"mdast-util-position":63,"plur":66,"unist-util-visit":67}],31:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"plur":67,"unist-util-visit":68}],31:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -3289,7 +3289,7 @@ function noDuplicateDefinitions(ast, file, preferred, done) {
|
||||
|
||||
module.exports = noDuplicateDefinitions;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],32:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],32:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -3365,7 +3365,7 @@ function noDuplicateHeadings(ast, file, preferred, done) {
|
||||
|
||||
module.exports = noDuplicateHeadings;
|
||||
|
||||
},{"mdast-util-position":63,"mdast-util-to-string":64,"unist-util-visit":67}],33:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"mdast-util-to-string":65,"unist-util-visit":68}],33:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -3449,7 +3449,7 @@ function noEmphasisAsHeading(ast, file, preferred, done) {
|
||||
|
||||
module.exports = noEmphasisAsHeading;
|
||||
|
||||
},{"mdast-util-position":63,"mdast-util-to-string":64,"unist-util-visit":67}],34:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"mdast-util-to-string":65,"unist-util-visit":68}],34:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -3766,7 +3766,7 @@ function noHeadingContentIndent(ast, file, preferred, done) {
|
||||
|
||||
module.exports = noHeadingContentIndent;
|
||||
|
||||
},{"mdast-util-heading-style":62,"mdast-util-position":63,"plur":66,"unist-util-visit":67}],40:[function(require,module,exports){
|
||||
},{"mdast-util-heading-style":63,"mdast-util-position":64,"plur":67,"unist-util-visit":68}],40:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -3870,7 +3870,7 @@ function noHeadingIndent(ast, file, preferred, done) {
|
||||
|
||||
module.exports = noHeadingIndent;
|
||||
|
||||
},{"mdast-util-position":63,"plur":66,"unist-util-visit":67}],41:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"plur":67,"unist-util-visit":68}],41:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -3944,7 +3944,7 @@ function noHeadingPunctuation(ast, file, preferred, done) {
|
||||
|
||||
module.exports = noHeadingPunctuation;
|
||||
|
||||
},{"mdast-util-position":63,"mdast-util-to-string":64,"unist-util-visit":67}],42:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"mdast-util-to-string":65,"unist-util-visit":68}],42:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -3992,7 +3992,7 @@ function html(ast, file, preferred, done) {
|
||||
|
||||
module.exports = html;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],43:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],43:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -4063,7 +4063,7 @@ function noInlinePadding(ast, file, preferred, done) {
|
||||
|
||||
module.exports = noInlinePadding;
|
||||
|
||||
},{"mdast-util-position":63,"mdast-util-to-string":64,"unist-util-visit":67}],44:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"mdast-util-to-string":65,"unist-util-visit":68}],44:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -4128,7 +4128,7 @@ function noLiteralURLs(ast, file, preferred, done) {
|
||||
|
||||
module.exports = noLiteralURLs;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],45:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],45:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -4212,7 +4212,7 @@ function noMissingBlankLines(ast, file, preferred, done) {
|
||||
|
||||
module.exports = noMissingBlankLines;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],46:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],46:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -4275,7 +4275,7 @@ function noMultipleToplevelHeadings(ast, file, preferred, done) {
|
||||
|
||||
module.exports = noMultipleToplevelHeadings;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],47:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],47:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -4378,7 +4378,7 @@ function noShellDollars(ast, file, preferred, done) {
|
||||
|
||||
module.exports = noShellDollars;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],48:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],48:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -4435,7 +4435,7 @@ function noShortcutReferenceImage(ast, file, preferred, done) {
|
||||
|
||||
module.exports = noShortcutReferenceImage;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],49:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],49:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -4492,7 +4492,7 @@ function noShortcutReferenceLink(ast, file, preferred, done) {
|
||||
|
||||
module.exports = noShortcutReferenceLink;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],50:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],50:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -4555,7 +4555,7 @@ function noTableIndentation(ast, file, preferred, done) {
|
||||
|
||||
module.exports = noTableIndentation;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],51:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],51:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -4725,7 +4725,7 @@ function orderedListMarkerStyle(ast, file, preferred, done) {
|
||||
|
||||
module.exports = orderedListMarkerStyle;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],53:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],53:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -4884,7 +4884,7 @@ function orderedListMarkerValue(ast, file, preferred, done) {
|
||||
|
||||
module.exports = orderedListMarkerValue;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],54:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],54:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -4984,7 +4984,7 @@ function ruleStyle(ast, file, preferred, done) {
|
||||
|
||||
module.exports = ruleStyle;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],55:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],55:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -5069,7 +5069,7 @@ function strongMarker(ast, file, preferred, done) {
|
||||
|
||||
module.exports = strongMarker;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],56:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],56:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -5248,7 +5248,7 @@ function tableCellPadding(ast, file, preferred, done) {
|
||||
|
||||
module.exports = tableCellPadding;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],57:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],57:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -5351,7 +5351,7 @@ function tablePipeAlignment(ast, file, preferred, done) {
|
||||
|
||||
module.exports = tablePipeAlignment;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],58:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],58:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -5429,7 +5429,7 @@ function tablePipes(ast, file, preferred, done) {
|
||||
|
||||
module.exports = tablePipes;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],59:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],59:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -5553,17 +5553,145 @@ function unorderedListMarkerStyle(ast, file, preferred, done) {
|
||||
|
||||
module.exports = unorderedListMarkerStyle;
|
||||
|
||||
},{"mdast-util-position":63,"unist-util-visit":67}],60:[function(require,module,exports){
|
||||
},{"mdast-util-position":64,"unist-util-visit":68}],60:[function(require,module,exports){
|
||||
'use strict';
|
||||
module.exports = function (str, sep) {
|
||||
if (typeof str !== 'string') {
|
||||
throw new TypeError('Expected a string');
|
||||
}
|
||||
|
||||
return str.replace(/([a-z\d])([A-Z])/g, '$1' + (sep || '_') + '$2').toLowerCase();
|
||||
sep = typeof sep === 'undefined' ? '_' : sep;
|
||||
return str.replace(/([a-z\d])([A-Z])/g, '$1' + sep + '$2')
|
||||
.replace(new RegExp('(' + sep + '[A-Z])([A-Z])', 'g'), '$1' + sep + '$2')
|
||||
.toLowerCase();
|
||||
};
|
||||
|
||||
},{}],61:[function(require,module,exports){
|
||||
module.exports={
|
||||
"addendum": "addenda",
|
||||
"aircraft": "aircraft",
|
||||
"alga": "algae",
|
||||
"alumna": "alumnae",
|
||||
"alumnus": "alumni",
|
||||
"amoeba": "amoebae",
|
||||
"analysis": "analyses",
|
||||
"antenna": "antennae",
|
||||
"antithesis": "antitheses",
|
||||
"apex": "apices",
|
||||
"appendix": "appendices",
|
||||
"axis": "axes",
|
||||
"bacillus": "bacilli",
|
||||
"bacterium": "bacteria",
|
||||
"barracks": "barracks",
|
||||
"basis": "bases",
|
||||
"beau": "beaux",
|
||||
"bison": "bison",
|
||||
"bureau": "bureaus",
|
||||
"cactus": "cacti",
|
||||
"calf": "calves",
|
||||
"child": "children",
|
||||
"château": "châteaus",
|
||||
"codex": "codices",
|
||||
"concerto": "concerti",
|
||||
"corpus": "corpora",
|
||||
"crisis": "crises",
|
||||
"criterion": "criteria",
|
||||
"curriculum": "curricula",
|
||||
"datum": "data",
|
||||
"deer": "deer",
|
||||
"diagnosis": "diagnoses",
|
||||
"die": "dice",
|
||||
"dwarf": "dwarfs",
|
||||
"echo": "echoes",
|
||||
"elf": "elves",
|
||||
"ellipsis": "ellipses",
|
||||
"embargo": "embargoes",
|
||||
"emphasis": "emphases",
|
||||
"erratum": "errata",
|
||||
"faux pas": "faux pas",
|
||||
"fez": "fezes",
|
||||
"fish": "fish",
|
||||
"focus": "foci",
|
||||
"foot": "feet",
|
||||
"formula": "formulae",
|
||||
"fungus": "fungi",
|
||||
"gallows": "gallows",
|
||||
"genus": "genera",
|
||||
"goose": "geese",
|
||||
"graffito": "graffiti",
|
||||
"grouse": "grouse",
|
||||
"half": "halves",
|
||||
"hero": "heroes",
|
||||
"hoof": "hooves",
|
||||
"hypothesis": "hypotheses",
|
||||
"index": "indices",
|
||||
"knife": "knives",
|
||||
"larva": "larvae",
|
||||
"leaf": "leaves",
|
||||
"libretto": "libretti",
|
||||
"life": "lives",
|
||||
"loaf": "loaves",
|
||||
"locus": "loci",
|
||||
"louse": "lice",
|
||||
"man": "men",
|
||||
"matrix": "matrices",
|
||||
"means": "means",
|
||||
"medium": "media",
|
||||
"memorandum": "memoranda",
|
||||
"minutia": "minutiae",
|
||||
"mouse": "mice",
|
||||
"nebula": "nebulae",
|
||||
"neurosis": "neuroses",
|
||||
"news": "news",
|
||||
"nucleus": "nuclei",
|
||||
"oasis": "oases",
|
||||
"offspring": "offspring",
|
||||
"opus": "opera",
|
||||
"ovum": "ova",
|
||||
"ox": "oxen",
|
||||
"paralysis": "paralyses",
|
||||
"parenthesis": "parentheses",
|
||||
"phenomenon": "phenomena",
|
||||
"phylum": "phyla",
|
||||
"potato": "potatoes",
|
||||
"prognosis": "prognoses",
|
||||
"quiz": "quizzes",
|
||||
"radius": "radii",
|
||||
"referendum": "referenda",
|
||||
"salmon": "salmon",
|
||||
"scarf": "scarves",
|
||||
"self": "selves",
|
||||
"series": "series",
|
||||
"sheep": "sheep",
|
||||
"shelf": "shelves",
|
||||
"shrimp": "shrimp",
|
||||
"species": "species",
|
||||
"stimulus": "stimuli",
|
||||
"stratum": "strata",
|
||||
"swine": "swine",
|
||||
"syllabus": "syllabi",
|
||||
"symposium": "symposia",
|
||||
"synopsis": "synopses",
|
||||
"synthesis": "syntheses",
|
||||
"tableau": "tableaus",
|
||||
"thesis": "theses",
|
||||
"thief": "thieves",
|
||||
"tomato": "tomatoes",
|
||||
"tooth": "teeth",
|
||||
"torpedo": "torpedoes",
|
||||
"trout": "trout",
|
||||
"tuna": "tuna",
|
||||
"vertebra": "vertebrae",
|
||||
"vertex": "vertices",
|
||||
"veto": "vetoes",
|
||||
"vita": "vitae",
|
||||
"vortex": "vortices",
|
||||
"wharf": "wharves",
|
||||
"wife": "wives",
|
||||
"wolf": "wolves",
|
||||
"woman": "women"
|
||||
}
|
||||
|
||||
},{}],62:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -5743,7 +5871,7 @@ function attacher() {
|
||||
|
||||
module.exports = attacher;
|
||||
|
||||
},{"unist-util-visit":67}],62:[function(require,module,exports){
|
||||
},{"unist-util-visit":68}],63:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer. All rights reserved.
|
||||
@ -5833,7 +5961,7 @@ function style(node, relative) {
|
||||
|
||||
module.exports = style;
|
||||
|
||||
},{}],63:[function(require,module,exports){
|
||||
},{}],64:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer. All rights reserved.
|
||||
@ -5937,7 +6065,7 @@ position.generated = generated;
|
||||
|
||||
module.exports = position;
|
||||
|
||||
},{}],64:[function(require,module,exports){
|
||||
},{}],65:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer. All rights reserved.
|
||||
@ -5980,7 +6108,7 @@ function toString(node) {
|
||||
|
||||
module.exports = toString;
|
||||
|
||||
},{}],65:[function(require,module,exports){
|
||||
},{}],66:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
@ -6130,14 +6258,15 @@ function testFactory(settings, callback) {
|
||||
* @return {Object?}
|
||||
*/
|
||||
function test(node, context) {
|
||||
var value = node.value;
|
||||
var value;
|
||||
var match;
|
||||
var result;
|
||||
|
||||
if (node.type !== 'html') {
|
||||
if (!node || node.type !== 'html') {
|
||||
return null;
|
||||
}
|
||||
|
||||
value = node.value;
|
||||
match = value.match(expression);
|
||||
|
||||
if (
|
||||
@ -6184,13 +6313,17 @@ function parse(tokenize, settings) {
|
||||
*
|
||||
* @return {Node}
|
||||
*/
|
||||
return function () {
|
||||
function replacement() {
|
||||
var node = tokenize.apply(this, arguments);
|
||||
|
||||
test(node, this);
|
||||
|
||||
return node;
|
||||
};
|
||||
}
|
||||
|
||||
replacement.locator = tokenize.locator;
|
||||
|
||||
return replacement;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -6306,8 +6439,9 @@ function run(settings) {
|
||||
* @return {Function?}
|
||||
*/
|
||||
function attacher(mdast, options) {
|
||||
var blockTokenizers = mdast.Parser.prototype.blockTokenizers;
|
||||
var inlineTokenizers = mdast.Parser.prototype.inlineTokenizers;
|
||||
var parser = mdast.Parser.prototype;
|
||||
var blockTokenizers = parser.blockTokenizers;
|
||||
var inlineTokenizers = parser.inlineTokenizers;
|
||||
var stringifiers = mdast.Compiler.prototype;
|
||||
|
||||
if (options.onparse) {
|
||||
@ -6351,13 +6485,17 @@ function wrapper(options) {
|
||||
|
||||
module.exports = wrapper;
|
||||
|
||||
},{"unist-util-visit":67}],66:[function(require,module,exports){
|
||||
},{"unist-util-visit":68}],67:[function(require,module,exports){
|
||||
'use strict';
|
||||
var irregularPlurals = require('irregular-plurals');
|
||||
|
||||
module.exports = function (str, plural, count) {
|
||||
if (typeof plural === 'number') {
|
||||
if (str in irregularPlurals) {
|
||||
plural = irregularPlurals[str];
|
||||
} else if (typeof plural === 'number') {
|
||||
count = plural;
|
||||
|
||||
plural = (str.replace(/(?:s|x|z|ch|sh)$/i, '$&e').replace(/y$/i, 'ie') + 's')
|
||||
plural = (str.replace(/(?:s|x|z|ch|sh)$/i, '$&e').replace(/([^aeiou])y$/i, '$1ie') + 's')
|
||||
.replace(/i?e?s$/i, function (m) {
|
||||
var isTailLowerCase = str.slice(-1) === str.slice(-1).toLowerCase();
|
||||
return isTailLowerCase ? m.toLowerCase() : m.toUpperCase();
|
||||
@ -6367,7 +6505,7 @@ module.exports = function (str, plural, count) {
|
||||
return count === 1 ? str : plural;
|
||||
};
|
||||
|
||||
},{}],67:[function(require,module,exports){
|
||||
},{"irregular-plurals":61}],68:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer. All rights reserved.
|
||||
@ -6482,7 +6620,7 @@ function visit(tree, type, callback, reverse) {
|
||||
|
||||
module.exports = visit;
|
||||
|
||||
},{}],68:[function(require,module,exports){
|
||||
},{}],69:[function(require,module,exports){
|
||||
/**
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
1
remark-lint.min.js
vendored
Normal file
1
remark-lint.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -3,7 +3,7 @@
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
* @license MIT
|
||||
* @module mdast:lint:script:build-rule-documentation
|
||||
* @module remark:lint:script:build-rule-documentation
|
||||
* @fileoverview Creates documentation for all exposed
|
||||
* rules.
|
||||
*/
|
||||
|
@ -2,9 +2,9 @@
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
* @license MIT
|
||||
* @module mdast:lint:test:clean
|
||||
* @fileoverview mdast plug-in used to remove positional
|
||||
* information from mdast’s syntax tree.
|
||||
* @module remark:lint:test:clean
|
||||
* @fileoverview remark plug-in used to remove positional
|
||||
* information from remark’s syntax tree.
|
||||
* @todo Externalise into its own repository.
|
||||
*/
|
||||
|
||||
|
2
test/external/index.js
vendored
2
test/external/index.js
vendored
@ -2,7 +2,7 @@
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
* @license MIT
|
||||
* @module mdast:lint:test:external
|
||||
* @module remark:lint:test:external
|
||||
* @fileoverview Map of example external rules.
|
||||
*/
|
||||
|
||||
|
2
test/external/no-lorem.js
vendored
2
test/external/no-lorem.js
vendored
@ -2,7 +2,7 @@
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
* @license MIT
|
||||
* @module mdast:lint:test:no-lorem
|
||||
* @module remark:lint:test:no-lorem
|
||||
* @fileoverview
|
||||
* Warn when `lorem` is used in a document.
|
||||
* @example
|
||||
|
2
test/fixtures/gaps-toc-final.md
vendored
2
test/fixtures/gaps-toc-final.md
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
This paragraph is removed by mdast-toc. However, a rule such as
|
||||
`no-consecutive-blank-lines` cannot see this node as it has no
|
||||
position. **mdast-lint** knows that this node has no positional
|
||||
position. **remark-lint** knows that this node has no positional
|
||||
information and can ignore the space between the ToC heading
|
||||
and end of the document, thus ignoring any messages between
|
||||
nodes.
|
||||
|
2
test/fixtures/gaps-toc-internal.md
vendored
2
test/fixtures/gaps-toc-internal.md
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
This paragraph is removed by mdast-toc. However, a rule such as
|
||||
`no-consecutive-blank-lines` cannot see this node as it has no
|
||||
position. **mdast-lint** knows that this node has no positional
|
||||
position. **remark-lint** knows that this node has no positional
|
||||
information and can ignore the space between the ToC heading
|
||||
and next node, thus ignoring any messages between nodes.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
No tool, including **mdast**, supports the below examples, except for the
|
||||
No tool, including **remark**, supports the below examples, except for the
|
||||
e-mail.
|
||||
|
||||
<file.html>
|
||||
|
2
test/fixtures/no-inline-padding-invalid.md
vendored
2
test/fixtures/no-inline-padding-invalid.md
vendored
@ -2,7 +2,7 @@ Emphasis: * foo*, and _bar _.
|
||||
|
||||
Strong: **baz ** and __ qux__.
|
||||
|
||||
Delete: ~~ quux~~ (this one isn’t parsed by mdast when padded).
|
||||
Delete: ~~ quux~~ (this one isn’t parsed by remark when padded).
|
||||
|
||||
An image: ![ alpha](bravo.png).
|
||||
|
||||
|
2
test/fixtures/no-inline-padding-valid.md
vendored
2
test/fixtures/no-inline-padding-valid.md
vendored
@ -2,7 +2,7 @@ Emphasis: *foo*, and _bar_.
|
||||
|
||||
Strong: **baz** and __qux__.
|
||||
|
||||
Delete: ~~quux~~ (this one isn’t parsed by mdast when padded).
|
||||
Delete: ~~quux~~ (this one isn’t parsed by remark when padded).
|
||||
|
||||
An image: ![alpha](bravo.png).
|
||||
|
||||
|
4
test/fixtures/no-literal-urls-invalid.md
vendored
4
test/fixtures/no-literal-urls-invalid.md
vendored
@ -1,5 +1,5 @@
|
||||
http://example.com
|
||||
|
||||
foo@example.com which isn’t detected by mdast yet.
|
||||
foo@example.com which isn’t detected by remark yet.
|
||||
|
||||
mailto:foo@example.com which isn’t detected by mdast yet.
|
||||
mailto:foo@example.com which isn’t detected by remark yet.
|
||||
|
4
test/fixtures/no-literal-urls-valid.md
vendored
4
test/fixtures/no-literal-urls-valid.md
vendored
@ -1,5 +1,5 @@
|
||||
<http://example.com>
|
||||
|
||||
<foo@example.com> which isn’t detected by mdast yet.
|
||||
<foo@example.com> which isn’t detected by remark yet.
|
||||
|
||||
<mailto:foo@example.com> which isn’t detected by mdast yet.
|
||||
<mailto:foo@example.com> which isn’t detected by remark yet.
|
||||
|
@ -2,8 +2,8 @@
|
||||
* @author Titus Wormer
|
||||
* @copyright 2015 Titus Wormer
|
||||
* @license MIT
|
||||
* @module mdast:lint:test
|
||||
* @fileoverview Tests for mdast-lint.
|
||||
* @module remark:lint:test
|
||||
* @fileoverview Tests for remark-lint.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
@ -54,7 +54,7 @@ function toFile(filePath) {
|
||||
* Shortcut.
|
||||
*
|
||||
* @param {string} filePath - Path to `file`.
|
||||
* @param {Object?} options - Passed to `mdast-lint`
|
||||
* @param {Object?} options - Passed to `remark-lint`
|
||||
* @param {Object?} settings - Passed to `mdast`
|
||||
* @param {boolean?} shouldClean - Uses `clean` plugin,
|
||||
* when truthy.
|
||||
@ -93,7 +93,7 @@ var currentRule = null;
|
||||
var currentSetting = null;
|
||||
|
||||
/**
|
||||
* Describe a single mdast-lint rule.
|
||||
* Describe a single remark-lint rule.
|
||||
*
|
||||
* @param {string} ruleId - Rule to turn on when testing.
|
||||
* @param {Function} description - Passed to `describe()`.
|
||||
@ -107,7 +107,7 @@ function describeRule(ruleId, description) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Describe how a single mdast-lint rule should behave
|
||||
* Describe how a single remark-lint rule should behave
|
||||
* when given a certain `setting`.
|
||||
*
|
||||
* @param {*} setting - Passed to the rule.
|
||||
@ -131,7 +131,7 @@ function describeSetting(setting, description) {
|
||||
* `test/fixtures/`.
|
||||
* @param {Array.<string>} messages - Assertions.
|
||||
* @param {Object?} settings - Passed to `mdast`.
|
||||
* @param {Object?} overwrite - Passed to `mdast-lint`
|
||||
* @param {Object?} overwrite - Passed to `remark-lint`
|
||||
* instead of constructing based on BDD-like tests.
|
||||
*/
|
||||
function assertFile(filePath, messages, settings, overwrite) {
|
||||
@ -145,7 +145,7 @@ function assertFile(filePath, messages, settings, overwrite) {
|
||||
options = overwrite;
|
||||
} else {
|
||||
/*
|
||||
* Construct mdast-lint options.
|
||||
* Construct remark-lint options.
|
||||
*/
|
||||
|
||||
options = {};
|
||||
@ -184,7 +184,7 @@ function assertFile(filePath, messages, settings, overwrite) {
|
||||
* Basic tests.
|
||||
*/
|
||||
|
||||
describe('mdast-lint', function () {
|
||||
describe('remark-lint', function () {
|
||||
it('should work without `options`', function () {
|
||||
assert(process('file-extension-markdown.markdown').length === 1);
|
||||
});
|
||||
@ -253,7 +253,7 @@ describe('External', function () {
|
||||
it('should fail on invalid external rules', function () {
|
||||
assert.throws(function () {
|
||||
process('lorem-valid.md', {
|
||||
'external': ['mdast']
|
||||
'external': ['remark']
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -1885,7 +1885,7 @@ var nonnode = [
|
||||
'no-file-name-irregular-characters'
|
||||
];
|
||||
|
||||
describe('mdast-lint with generated nodes', function () {
|
||||
describe('remark-lint with generated nodes', function () {
|
||||
fs.readdirSync(join(__dirname, 'fixtures'))
|
||||
.filter(function (filePath) {
|
||||
return filePath.charAt(0) !== '.';
|
||||
|
Loading…
Reference in New Issue
Block a user