retextjs / retext-spell

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

v1.0.0 not flagging spelling errors #9

Closed localjo closed 7 years ago

localjo commented 7 years ago

I tried plugging v1.0.0 of retext-spell into quality-docs, but it wasn't flagging any spelling errors. I thought maybe the spelling errors were being swallowed be some other filter I had in my code, so I stripped everything out, and eventually tried the usage example from the README;

var retext = require('retext');
var spell = require('retext-spell');
var dictionary = require('dictionary-en-gb');
var report = require('vfile-reporter');

retext()
  .use(spell, dictionary)
  .process('Some useles mispelt documeant.', function (err, file) {
    console.error(report(err || file));
  });

When I save that as index.js and run it with node index.js, I get;

no issues found

So I think version 1.0.0 is not flagging spelling errors at all.

wooorm commented 7 years ago

Argh, sorry about that. What version of retext are you on?

wooorm commented 7 years ago

Oh I’m just seeing that I haven't updated this plugin yet, for the latest retext, sorry about that. I’ll have a fix in an hour or so! (if that’s the reason your case doesn't work)

localjo commented 7 years ago

Was using retext@3.0.0. I didn't think about that. I'll try with retext@5.0.0.

localjo commented 7 years ago

With retext@5.0.0 I get this error;

/path/quality-docs/node_modules/retext-spell/index.js:28
    throw new Error('Expected `Object`, got `' + load + '`');
    ^

Error: Expected `Object`, got `undefined`
    at Function.spell (/path/quality-docs/node_modules/retext-spell/index.js:28:11)
wooorm commented 7 years ago

Right, that error tells me it’s cause I haven’t upgraded yet. Sorry about that!

wooorm commented 7 years ago

This should do the trick! (2.0.0 will be released in a minute)