Git Product home page Git Product logo

retext-repeated-words's People

Contributors

greenkeeperio-bot avatar nodatall avatar remcohaszing avatar wooorm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

nodatall a2937

retext-repeated-words's Issues

Duplicates around `\r\n` are not detected

Initial checklist

Affected packages and versions

[email protected]

Link to runnable example

No response

Steps to reproduce

Background: I was testing to see how well this plugin worked in the spellchecker-cli package when I ran into an unexpected assertion error. The expression Well, it it doesn’t have to to be. Like a fish in the\r\nthe sea. didn't catch the repeated the. Being highly interested in what was causing it; I eventually traced it back to this package and reproduced my example in the local test folder.

I made my local test.js look like the following: https://pastebin.com/ibNziPtb

It had failed. Here is a screenshot.

Unexpected Problem

It hadn't even been caught as an error. I expect it didn't read the \r\n as a whitespace character and maybe need to be take it up with people behind the nlcst package if my suspicions are correct.

Expected behavior

There should have been three strings in the messages array in the example like there is with the \n example.

Affected runtime and version

[email protected]

Affected package manager and version

[email protected]

Affected OS and version

Windows 10

Build and bundle tools

Other (please specify in steps to reproduce)

Better Documentation

Hello,

Thanks for the linter. I successfully got "retext-repeated-words" working with my entire repository, but it took me wayyy longer than it should have due to lacking documentation.

Can you add this example to the main README.md file? I would guess that the main use case for this linter would be to lint more than one file at a time, so this example would help a lot.

// A script to use retext-repeated-words to lint an entire directory / repository

const path = require('path');
const vfileGlob = require('vfile-glob');
const unified = require('unified');
const english = require('retext-english');
const repeated = require('retext-repeated-words');
const stringify = require('retext-stringify');
const report = require('vfile-reporter');

const rootDir = path.join(__dirname, '..'); // The root directory of the project
vfileGlob(`${rootDir}/**`, { // Match every file matching this glob
  ignore: [ // Add specific ignore globs here relating to your particular directory structure
    `${rootDir}/.git/**`,
    `${rootDir}/img/**`,
    `${rootDir}/misc/*.pdf`,
    `${rootDir}/linters/node_modules/**`,
    `${rootDir}/linters/package-lock.json`,
    `${rootDir}/LICENSE`,
  ],
}).subscribe({
  next(file) {
    unified()
    .use(english)
    .use(repeated)
    .use(stringify)
    .process(file, function(err, file) {
      const output = report(err || file, {
        quiet: true, // Only output on a warning or an error
      }).trim();
      if (output) {
        console.error(output);
      }
    })
  },
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.