sapegin / textlint-rule-stop-words

Textlint rule to find filler words, buzzwords and clichés
MIT License
20 stars 6 forks source link

[proposal] Ignore match when the alternative is the same #16

Closed ggrossetie closed 3 years ago

ggrossetie commented 3 years ago

I'm using this rule as a replacement of Vale's substitution rule.

I'm using the following definition to make sure that "Asciidoctor" and "AsciiDoc" have the correct casing:

{
  "rules": {
    "stop-words": {
      "defaultWords": false,
      "skip": ["Blockquote"],
      "words": [
        ["asciidoctor", "Asciidoctor"],
        ["asciidoc", "AsciiDoc"]
      ]
    }
  }
}

Since this rule allows to define replacement/alternative. I think it would be useful to check that the replacement/alternative is not strictly equals to the match.

Under this proposal, the following sentence will report an error:

AsciiDoctor is great!
     ^

But the following will not:

Asciidoctor is great!
sapegin commented 3 years ago

I think I'm missing something here. Isn't Asciidoctor is what you've defined as the replacement? So the last example is already correct, and not reported because of that?

ggrossetie commented 3 years ago

Sorry I wasn't clear, the last part is the expected result (not the actual/current result). Currently, both Asciidoctor and AsciiDoctor will be reported as error. With my proposal only AsciiDoctor will be reported as an error. Does it make sense?

sapegin commented 3 years ago

Ah, yeah, that makes sense!

sapegin commented 3 years ago

:tada: This issue has been resolved in version 2.0.9 :tada:

The release is available on:

Your semantic-release bot :package::rocket: