retextjs / retext-spell

plugin to check spelling
https://unifiedjs.com
MIT License
73 stars 16 forks source link

Integrate with CLI or Atom #12

Closed RichardLitt closed 6 years ago

RichardLitt commented 6 years ago

Hey @wooorm! ๐Ÿ‘‹

Is it possible to use this on the CLI, or within an editor that shows all of the issues at once in a block? I'm tired of manually looking for red underlines in Atom, and want a cleaner solution.

wooorm commented 6 years ago

Interesting! Not yet, I think.

You could create an integration with Atom though. Take a look at the code for atom-linter-alex for examples! Alex is a bit weirder than using just remark/retext directly, so youโ€™d need less weird things for this, I think?

Did you think of how the UI of this should look? How would one pick a language/dictionary?

RichardLitt commented 6 years ago

Cool, I didn't know that alex had a plugin.

I was more interested in just seeing all spelling errors, really. The dictionary and language should be the system defaults, but it should ignore code blocks.

The UI could be almost identical to atom-linter-alex, actually. I was thinking more about just outputting all errors to STDOUT, and not bothering with atom at all.

wooorm commented 6 years ago

With a .remarkrc.js like this:

/* `.remarkrc.js` */
var unified = require('unified')
var remark2retext = require('remark-retext')
var english = require('retext-english')
var spell = require('retext-spell')
var dictionary = require('dictionary-en-us');

exports.plugins = [
  [remark2retext, unified().use(english).use(spell, dictionary)]
]

...you should be able to run remark . on the CLI or with linter-remark in atom, and that should highlight spelling mistakes!

The dictionary and language should be the system defaults

Hmm, not sure about how that should work ๐Ÿค”

I also saw spellchecker-cli, maybe thatโ€™s interesting?

RichardLitt commented 6 years ago

spellchecker-cli does what I need! Good catch!

I think I will use that for now. Shall I close this?

wooorm commented 6 years ago

Great to hear Richard, and that's good! ๐Ÿ‘