question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PR: Mispelling inferences

See original GitHub issue

Would a PR for something like this be welcome:

// Simple example of making inferences through spelling
const some = Promis // <- misspelled Promise

When linting this code, eslint would output something like so:

Unexpected token 'Promis'. Did you mean 'Promise'?

instead of:

Parsing Error: Unexpected token.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
ilyavolodincommented, Jul 31, 2016

In that case, no-undef already notifies you about usage of undefined variables. What’s the advantage of us guessing what you might’ve meant if the rule already points you to the location of the wrong variable? Chances are, we can’t really guess correctly what was supposed to be there in the first place. User would know much better what he was planning to type there. I don’t see this is useful enough to justify complexity that this would add to one of the most widely used rules out there. Overall I’m 👎 on this, sorry.

1reaction
platinumazurecommented, Jul 29, 2016

I’m not sure I understand why the example would give a parse error. Are you using ecmaVersion: 6 or later?

The no-undef rule should already flag this sort of thing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Misspelling Correction with Pre-trained Contextual Language ...
As humans, we are able to understand most of the misspelled words based on their location in the sentence, perceived pronunciation, and context....
Read more >
10 Words Often Misspelled in Business Correspondence
For me, double letters are the most vexing: omission vs ommission, occurrence vs occurence, and pairs like refer/reference/referring, infer/inference/inferring, ...
Read more >
Spelling Correction and the Noisy Channel
Luckily, we can get a pretty reasonable estimate of P(x|w) just by looking at local context: the identity of the correct letter itself,...
Read more >
SPELLING ERRORS ACROSS LANGUAGES - OSF
In each language, we select a set of correctly spelled words and their non-standard spelling variants. The words are selected to have a...
Read more >
IV. College Students' Misspelling of Common Words - jstor
we shall never develop adequate reading pro- ... List of words, each misspelled by more than 300 college students (1931-1955) ... inferences more...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found