retextjs / retext-simplify

plugin to check phrases for simpler alternatives
https://unifiedjs.com
MIT License
94 stars 13 forks source link

`has no effect` triggers a warning with no suitable alternative. #13

Closed aduh95 closed 3 years ago

aduh95 commented 3 years ago

Initial checklist

Problem

The following sentence:

If the [`formData`](#formData-true) option is set to false, `metaFields` has no effect.

Produces the following result:

warning   Replace `effect` with `choose`, `pick`

None of the suggested alternative works here.

Solution

Either provide a different alternative, or accept has no effect as a valid expression.

Alternatives

Add 'effect' to the ignore list.

wooorm commented 3 years ago

It’s a pretty simple module, there is no awareness of context, so accepting one word in certain combinations is not possible.

Some alternatives:

aduh95 commented 3 years ago

Maybe we could do something similar to benefit to provide more granular suggestion based on a combination of words: https://github.com/retextjs/retext-simplify/blob/60e019306e3813af87bdee28ee4b632fce5ee46a/patterns.js#L194-L199

I haven't tried it, but maybe something like that would work:

  'has no effect': { replace: ['does nothing', 'does not apply'] },

+1 for adding result to the list of suggestions, do you want me to open a PR?

In any case, thanks for your helpful suggestions – and for this plugin, it's quite helpful for someone like me who is not English native speaker.

wooorm commented 3 years ago

oh that’s interesting, I don’t remember that benefit from technique.

Yes, PR would be great! With either or both of the 'has no effect' and result in effect cases?

In any case, thanks for your helpful suggestions – and for this plugin, it's quite helpful for someone like me who is not English native speaker.

Good to hear, thanks! :+1:

github-actions[bot] commented 3 years ago

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.