retext-repeated-words
Advanced tools
Comparing version 1.2.2 to 1.2.3
11
index.js
'use strict' | ||
var visit = require('unist-util-visit') | ||
var is = require('unist-util-is') | ||
var convert = require('unist-util-is/convert') | ||
var toString = require('nlcst-to-string') | ||
@@ -9,2 +9,5 @@ | ||
var word = convert('WordNode') | ||
var whiteSpace = convert('WhiteSpaceNode') | ||
// List of words which can legally occur twice. | ||
@@ -47,7 +50,7 @@ var list = [ | ||
if (is('WordNode', child)) { | ||
if (word(child)) { | ||
value = toString(child) | ||
node = child | ||
position = index | ||
} else if (is('WhiteSpaceNode', child)) { | ||
} else if (whiteSpace(child)) { | ||
start = position | ||
@@ -72,2 +75,4 @@ before = value | ||
} | ||
return visit.SKIP | ||
} | ||
@@ -74,0 +79,0 @@ } |
{ | ||
"name": "retext-repeated-words", | ||
"version": "1.2.2", | ||
"description": "Check for for repeated words", | ||
"version": "1.2.3", | ||
"description": "retext plugin to check for for repeated words", | ||
"license": "MIT", | ||
"keywords": [ | ||
"unified", | ||
"retext", | ||
"plugin", | ||
"repeated", | ||
"repetition", | ||
"words", | ||
"retext" | ||
"words" | ||
], | ||
@@ -24,3 +26,3 @@ "repository": "retextjs/retext-repeated-words", | ||
"nlcst-to-string": "^2.0.0", | ||
"unist-util-is": "^2.0.0", | ||
"unist-util-is": "^3.0.0", | ||
"unist-util-visit": "^1.1.0" | ||
@@ -30,15 +32,15 @@ }, | ||
"browserify": "^16.0.0", | ||
"esmangle": "^1.0.1", | ||
"nyc": "^13.0.0", | ||
"prettier": "^1.14.3", | ||
"nyc": "^14.0.0", | ||
"prettier": "^1.0.0", | ||
"remark-cli": "^6.0.0", | ||
"remark-preset-wooorm": "^4.0.0", | ||
"retext": "^5.0.0", | ||
"remark-preset-wooorm": "^5.0.0", | ||
"retext": "^6.0.0", | ||
"tape": "^4.0.0", | ||
"xo": "^0.23.0" | ||
"tinyify": "^2.5.1", | ||
"xo": "^0.24.0" | ||
}, | ||
"scripts": { | ||
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix", | ||
"build-bundle": "browserify index.js --bare -s retextRepeatedWords > retext-repeated-words.js", | ||
"build-mangle": "esmangle retext-repeated-words.js > retext-repeated-words.min.js", | ||
"build-bundle": "browserify . -s retextRepeatedWords -o retext-repeated-words.js", | ||
"build-mangle": "browserify . -s retextRepeatedWords -p tinyify -o retext-repeated-words.min.js", | ||
"build": "npm run build-bundle && npm run build-mangle", | ||
@@ -45,0 +47,0 @@ "test-api": "node test", |
@@ -1,18 +0,26 @@ | ||
# retext-repeated-words [![Build][build-badge]][build] [![Coverage][coverage-badge]][coverage] [![Downloads][downloads-badge]][downloads] [![Chat][chat-badge]][chat] | ||
# retext-repeated-words | ||
Check for ~~`for`~~ repeated words with [**retext**][retext]. | ||
[![Build][build-badge]][build] | ||
[![Coverage][coverage-badge]][coverage] | ||
[![Downloads][downloads-badge]][downloads] | ||
[![Size][size-badge]][size] | ||
[![Sponsors][sponsors-badge]][collective] | ||
[![Backers][backers-badge]][collective] | ||
[![Chat][chat-badge]][chat] | ||
## Installation | ||
[**retext**][retext] plugin to check for ~~`for`~~ repeated words. | ||
[npm][npm-install]: | ||
## Install | ||
```bash | ||
[npm][]: | ||
```sh | ||
npm install retext-repeated-words | ||
``` | ||
## Usage | ||
## Use | ||
Say we have the following file, `example.txt`: | ||
```text | ||
```txt | ||
Well, it it doesn’t have to to be. Like a fish in the | ||
@@ -22,5 +30,5 @@ the sea. | ||
And our script, `example.js`, looks like this: | ||
…and our script, `example.js`, looks like this: | ||
```javascript | ||
```js | ||
var vfile = require('to-vfile') | ||
@@ -44,3 +52,3 @@ var report = require('vfile-reporter') | ||
```text | ||
```txt | ||
example.txt | ||
@@ -60,6 +68,6 @@ 1:7-1:12 warning Expected `it` once, not twice retext-repeated-words retext-repeated-words | ||
* 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...`) | ||
* 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…`) | ||
@@ -75,7 +83,9 @@ ## Related | ||
See [`contributing.md` in `retextjs/retext`][contribute] for ways to get | ||
started. | ||
See [`contributing.md`][contributing] in [`retextjs/.github`][health] for ways | ||
to get started. | ||
See [`support.md`][support] for ways to get help. | ||
This organisation has a [Code of Conduct][coc]. By interacting with this | ||
repository, organisation, or community you agree to abide by its terms. | ||
This project has a [Code of Conduct][coc]. | ||
By interacting with this repository, organisation, or community you agree to | ||
abide by its terms. | ||
@@ -100,2 +110,12 @@ ## License | ||
[size-badge]: https://img.shields.io/bundlephobia/minzip/retext-repeated-words.svg | ||
[size]: https://bundlephobia.com/result?p=retext-repeated-words | ||
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg | ||
[backers-badge]: https://opencollective.com/unified/backers/badge.svg | ||
[collective]: https://opencollective.com/unified | ||
[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg | ||
@@ -105,4 +125,12 @@ | ||
[npm-install]: https://docs.npmjs.com/cli/install | ||
[npm]: https://docs.npmjs.com/cli/install | ||
[health]: https://github.com/retextjs/.github | ||
[contributing]: https://github.com/retextjs/.github/blob/master/contributing.md | ||
[support]: https://github.com/retextjs/.github/blob/master/support.md | ||
[coc]: https://github.com/retextjs/.github/blob/master/code-of-conduct.md | ||
[license]: license | ||
@@ -113,5 +141,1 @@ | ||
[retext]: https://github.com/retextjs/retext | ||
[contribute]: https://github.com/retextjs/retext/blob/master/contributing.md | ||
[coc]: https://github.com/retextjs/retext/blob/master/code-of-conduct.md |
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
9036
89
135
- Removedunist-util-is@2.1.3(transitive)
Updatedunist-util-is@^3.0.0