remark-lint-linebreak-style
Advanced tools
Comparing version 1.0.0 to 1.0.1
15
index.js
@@ -9,6 +9,5 @@ /** | ||
* | ||
* Options: `string`, either `'unix'` (for `\n`, denoted as ␊), `'windows'` | ||
* (for `\r\n`, denoted as ␍␊), or `consistent` (to detect the first used | ||
* linebreak in a file). | ||
* Default: `'consistent'`. | ||
* Options: either `'unix'` (for `\n`, denoted as `␊`), `'windows'` (for `\r\n`, | ||
* denoted as `␍␊`), or `'consistent'` (to detect the first used linebreak in | ||
* a file). Default: `'consistent'`. | ||
* | ||
@@ -40,10 +39,2 @@ * @example {"name": "valid-consistent-as-windows.md"} | ||
* 1:6: Expected linebreaks to be windows (`\r\n`), not unix (`\n`) | ||
* | ||
* @example {"name": "valid-unix.md", "setting": "unix"} | ||
* | ||
* Alpha␊ | ||
* | ||
* @example {"name": "valid-windows.md", "setting": "windows"} | ||
* | ||
* Alpha␍␊ | ||
*/ | ||
@@ -50,0 +41,0 @@ |
{ | ||
"name": "remark-lint-linebreak-style", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "remark-lint rule to warn when linebreaks violate a given or detected style", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
104
readme.md
@@ -7,18 +7,18 @@ <!--This file is generated--> | ||
Options: `string`, either `'unix'` (for `\n`, denoted as ␊), `'windows'` | ||
(for `\r\n`, denoted as ␍␊), or `consistent` (to detect the first used | ||
linebreak in a file). | ||
Default: `'consistent'`. | ||
Options: either `'unix'` (for `\n`, denoted as `␊`), `'windows'` (for `\r\n`, | ||
denoted as `␍␊`), or `'consistent'` (to detect the first used linebreak in | ||
a file). Default: `'consistent'`. | ||
## Install | ||
## Presets | ||
```sh | ||
npm install --save remark-lint-linebreak-style | ||
``` | ||
This rule is not included in any default preset | ||
## Example | ||
When this rule is turned on, the following file | ||
`valid-consistent-as-windows.md` is ok: | ||
##### `valid-consistent-as-windows.md` | ||
###### In | ||
Note: `␍␊` represents a carriage return and a line feed. | ||
```markdown | ||
@@ -29,5 +29,12 @@ Alpha␍␊ | ||
When this rule is turned on, the following file | ||
`valid-consistent-as-unix.md` is ok: | ||
###### Out | ||
No messages. | ||
##### `valid-consistent-as-unix.md` | ||
###### In | ||
Note: `␊` represents a line feed. | ||
```markdown | ||
@@ -38,5 +45,14 @@ Alpha␊ | ||
When this rule is `'unix'`, the following file | ||
`invalid-unix.md` is **not** ok: | ||
###### Out | ||
No messages. | ||
##### `invalid-unix.md` | ||
When configured with `'unix'`. | ||
###### In | ||
Note: `␍␊` represents a carriage return and a line feed. | ||
```markdown | ||
@@ -46,2 +62,4 @@ Alpha␍␊ | ||
###### Out | ||
```text | ||
@@ -51,12 +69,10 @@ 1:7: Expected linebreaks to be unix (`\n`), not windows (`\r\n`) | ||
When this rule is `'unix'`, the following file | ||
`valid-unix.md` is ok: | ||
##### `invalid-windows.md` | ||
```markdown | ||
Alpha␊ | ||
``` | ||
When configured with `'windows'`. | ||
When this rule is `'windows'`, the following file | ||
`invalid-windows.md` is **not** ok: | ||
###### In | ||
Note: `␊` represents a line feed. | ||
```markdown | ||
@@ -66,2 +82,4 @@ Alpha␊ | ||
###### Out | ||
```text | ||
@@ -71,11 +89,47 @@ 1:6: Expected linebreaks to be windows (`\r\n`), not unix (`\n`) | ||
When this rule is `'windows'`, the following file | ||
`valid-windows.md` is ok: | ||
## Install | ||
```markdown | ||
Alpha␍␊ | ||
```sh | ||
npm install remark-lint-linebreak-style | ||
``` | ||
## Usage | ||
You probably want to use it on the CLI through a config file: | ||
```diff | ||
... | ||
"remarkConfig": { | ||
"plugins": [ | ||
... | ||
"lint", | ||
+ "lint-linebreak-style", | ||
... | ||
] | ||
} | ||
... | ||
``` | ||
Or use it on the CLI directly | ||
```sh | ||
remark -u lint -u lint-linebreak-style readme.md | ||
``` | ||
Or use this on the API: | ||
```diff | ||
var remark = require('remark'); | ||
var report = require('vfile-reporter'); | ||
remark() | ||
.use(require('remark-lint')) | ||
+ .use(require('remark-lint-linebreak-style')) | ||
.process('_Emphasis_ and **importance**', function (err, file) { | ||
console.error(report(err || file)); | ||
}); | ||
``` | ||
## License | ||
[MIT](https://github.com/wooorm/remark-lint/blob/master/LICENSE) © [Titus Wormer](http://wooorm.com) |
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
4865
129
71