retext-repeated-words
Advanced tools
Comparing version 1.2.0 to 1.2.1
{ | ||
"name": "retext-repeated-words", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Check for for repeated words", | ||
@@ -12,2 +12,9 @@ "license": "MIT", | ||
], | ||
"repository": "wooorm/retext-repeated-words", | ||
"bugs": "https://github.com/wooorm/retext-repeated-words/issues", | ||
"author": "Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)", | ||
"contributors": [ | ||
"Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)", | ||
"Sylvan Swierkosz <sswierkosz@gmail.com>" | ||
], | ||
"files": [ | ||
@@ -21,9 +28,2 @@ "index.js" | ||
}, | ||
"repository": "https://github.com/wooorm/retext-repeated-words", | ||
"bugs": "https://github.com/wooorm/retext-repeated-words/issues", | ||
"author": "Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)", | ||
"contributors": [ | ||
"Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)", | ||
"Sylvan Swierkosz <sswierkosz@gmail.com>" | ||
], | ||
"devDependencies": { | ||
@@ -34,6 +34,6 @@ "browserify": "^14.1.0", | ||
"remark-cli": "^3.0.0", | ||
"remark-preset-wooorm": "^2.0.0", | ||
"remark-preset-wooorm": "^3.0.0", | ||
"retext": "^5.0.0", | ||
"tape": "^4.0.0", | ||
"xo": "^0.17.1" | ||
"xo": "^0.18.0" | ||
}, | ||
@@ -58,2 +58,6 @@ "scripts": { | ||
"space": true, | ||
"esnext": false, | ||
"rules": { | ||
"no-multi-assign": "off" | ||
}, | ||
"ignores": [ | ||
@@ -64,4 +68,6 @@ "retext-repeated-words.js" | ||
"remarkConfig": { | ||
"plugins": ["preset-wooorm"] | ||
"plugins": [ | ||
"preset-wooorm" | ||
] | ||
} | ||
} |
@@ -15,22 +15,35 @@ # retext-repeated-words [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] | ||
Say we have the following file, `example.txt`: | ||
```text | ||
Well, it it doesn’t have to to be. Like a fish in the | ||
the sea. | ||
``` | ||
And our script, `example.js`, looks like this: | ||
```javascript | ||
var retext = require('retext'); | ||
var vfile = require('to-vfile'); | ||
var report = require('vfile-reporter'); | ||
var unified = require('unified'); | ||
var english = require('retext-english'); | ||
var stringify = require('retext-stringify'); | ||
var repeated = require('retext-repeated-words'); | ||
var report = require('vfile-reporter'); | ||
retext().use(english).use(repeated).process([ | ||
'Well, it it doesn’t have to to be. Like a fish in the', | ||
'the sea.' | ||
].join('\n'), function (err, file) { | ||
console.log(report(err || file)); | ||
}); | ||
unified() | ||
.use(english) | ||
.use(repeated) | ||
.use(stringify) | ||
.process(vfile.readSync('example.txt'), function (err, file) { | ||
console.error(report(err || file)); | ||
}); | ||
``` | ||
Yields: | ||
Now, running `node example` yields: | ||
```text | ||
1:7-1:12 warning Expected `it` once, not twice retext-repeated-words | ||
1:26-1:31 warning Expected `to` once, not twice retext-repeated-words | ||
1:51-2:4 warning Expected `the` once, not twice retext-repeated-words | ||
example.txt | ||
1:7-1:12 warning Expected `it` once, not twice retext-repeated-words retext-repeated-words | ||
1:26-1:31 warning Expected `to` once, not twice retext-repeated-words retext-repeated-words | ||
1:51-2:4 warning Expected `the` once, not twice retext-repeated-words retext-repeated-words | ||
@@ -47,6 +60,13 @@ ⚠ 3 warnings | ||
* Doesn’t warn for some words which _do_ occur twice (`the best | ||
exhibition they had had since`); | ||
* Doesn’t warn for initialisms (`D. D. will pop up with...`); | ||
* Doesn’t warn for capitalised words (`Duran Duran...`). | ||
exhibition they had had since`) | ||
* Doesn’t warn for initialisms (`D. D. will pop up with...`) | ||
* Doesn’t warn for capitalised words (`Duran Duran...`) | ||
## Related | ||
* [`retext-indefinite-article`](https://github.com/wooorm/retext-indefinite-article) | ||
— Check if indefinite articles are used correctly | ||
* [`retext-redundant-acronyms`](https://github.com/wooorm/retext-redundant-acronyms) | ||
— Check for redundant acronyms | ||
## License | ||
@@ -53,0 +73,0 @@ |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
7424
91