get-alex / alex

Catch insensitive, inconsiderate writing
https://alexjs.com
MIT License
4.81k stars 208 forks source link

Alex flags "slave" but not "master" #298

Closed robdodson closed 4 years ago

robdodson commented 4 years ago

Subject of the issue

Alex will flag the word "slave" but not the word "master"

Your environment

Steps to reproduce

Create an index.md file with:

hello world

master

slave

goodbye

Run npx alex index.md

Expected behaviour

Alex warns about the use of master and slave

Actual behaviour

Alex warns about the use of slave

wooorm commented 4 years ago

Hi Rob! Thanks for the suggestion, and welcome! I think warning for master on its own is a good idea.

If you/someone is interested in working on it, solving it would mean a PR to retext-equality!

robdodson commented 4 years ago

Hey @wooorm

I tried to add master to retext-equality but it throws because it's a duplicate. I believe it's because master and slave is already defined as a -type: and pattern maybe?

Here's what I added to the top of race.yml:

- type: basic
  considerate:
    - primary
  inconsiderate:
    - master

Here's the error:

Error: Refrain from multiple entries:
  master
    at generateLanguage (/Users/robdodson/Developer/retext-equality/script/generate.js:120:11)

Also it looks like "slave" is already flagged by retext-profanities. Would it be easier to add "master" to retext-profanities as well?

wooorm commented 4 years ago

Thanks for working on this! Yes, indeed, the other pattern probably interferes. Maybe time to remove it? And replace it with patterns to warn about master and slave, separately? I think it’s the only and pattern though, so might cause problems with test coverage, if so, I can handle removing dead code.

My personal opinion is that I don’t think master really makes sense in retext-profanities: that’s more for things that are (sometimes) slurs. Master isn’t really a slur. I think it’s okay for slave to be matched in both projects though. What are your thoughts?

robdodson commented 4 years ago

Thanks for working on this! Yes, indeed, the other pattern probably interferes. Maybe time to remove it? And replace it with patterns to warn about master and slave, separately?

Yeah I think warning about 'master' and 'slave' using the basic type would work. It should cover all scenarios.

I think it’s the only and pattern though, so might cause problems with test coverage, if so, I can handle removing dead code.

I would appreciate that :)

wooorm commented 4 years ago

Released in retext-equality@5.2.0!