-
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add example rule, and rule object file, to `test/external`; * Add fixtures for external tests; * Move `mdast.js`, `mdast.min.js` to `mdast-lint.js`, `mdast-lint.min.js`; * Add docs for external rules. Closes GH-14.
- Loading branch information
Showing
12 changed files
with
308 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* @author Titus Wormer | ||
* @copyright 2015 Titus Wormer. All rights reserved. | ||
* @module External | ||
* @fileoverview Map of example external rules. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
/* | ||
* Expose. | ||
*/ | ||
|
||
module.exports = { | ||
'no-lorem': require('./no-lorem') | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* @author Titus Wormer | ||
* @copyright 2015 Titus Wormer. All rights reserved. | ||
* @module no-tabs | ||
* @fileoverview | ||
* Warn when `lorem` is used in a document. | ||
* @example | ||
* <!-- Invalid: --> | ||
* lorem | ||
* | ||
* <!-- Valid: --> | ||
* ipsum | ||
*/ | ||
|
||
'use strict'; | ||
|
||
/** | ||
* Warn when `lorem` is used in a document. | ||
* | ||
* @param {Node} ast - Root node. | ||
* @param {File} file - Virtual file. | ||
* @param {*} preferred - Ignored. | ||
* @param {Function} done - Callback. | ||
*/ | ||
function noLorem(ast, file, preferred, done) { | ||
var content = file.toString(); | ||
var expression = /\blorem\b/gi; | ||
|
||
while (expression.exec(content)) { | ||
file.warn('Do not use lorem', file.offsetToPosition(expression.lastIndex)); | ||
} | ||
|
||
done(); | ||
} | ||
|
||
/* | ||
* Expose. | ||
*/ | ||
|
||
module.exports = noLorem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Lorem. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Ipsum. |
Oops, something went wrong.