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.

Cannot finish file scan in `eslint --init` when file contains invalid ESLint config comment

See original GitHub issue

What version of ESLint are you using? 2.8.0 What parser (default, Babel-ESLint, etc.) are you using? default I hope Please show your full configuration: There is no configuration yet What did you do? Please include the actual source code causing the issue. eslint --init and I choose to scan my files to determine the best configuration one of files contains invalid comment /*eslint max-statements[2,60], max-depth:[2,4] */ What did you expect to happen? successful finish What actually happened? Please include the actual, raw output from ESLint.

(mention.js:31:13) Failed to parse JSON from ' max-statements[2,60], "max-depth":[2,4]': Unexpected token m
Error: (mention.js:31:13) Failed to parse JSON from ' max-statements[2,60], "max-depth":[2,4]': Unexpected token m
    at getSourceCodeOfFile (C:\Users\khomyackov\AppData\Roaming\npm\node_modules\eslint\lib\util\source-code-util.js:43:15)    at C:\Users\khomyackov\AppData\Roaming\npm\node_modules\eslint\lib\util\source-code-util.js:99:26
    at Array.forEach (native)
    at getSourceCodeOfFiles (C:\Users\khomyackov\AppData\Roaming\npm\node_modules\eslint\lib\util\source-code-util.js:98:15)    at configureRules (C:\Users\khomyackov\AppData\Roaming\npm\node_modules\eslint\lib\config\config-initializer.js:128:23)
    at processAnswers (C:\Users\khomyackov\AppData\Roaming\npm\node_modules\eslint\lib\config\config-initializer.js:250:18)
    at null.completed (C:\Users\khomyackov\AppData\Roaming\npm\node_modules\eslint\lib\config\config-initializer.js:404:30)
    at PromptUI.onCompletion (C:\Users\khomyackov\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\lib\ui\prompt.js:57:10)
    at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.completed (C:\Users\khomyackov\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\node_modules\rx-lite\rx.lite.js:1550:12)
    at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted (C:\Users\khomyackov\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\node_modules\rx-lite\rx.lite.js:1489:14)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
nzakascommented, Apr 28, 2016

Fair enough. Then perhaps we can make config comment parsing failure a reported error instead of a thrown error as @victor-homyakov suggested? That would be a change to the core rather than an autoconfig change.

0reactions
kaicataldocommented, Aug 25, 2016

Closing this because we haven’t made any progress in months. Thanks for contributing!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot finish file scan in `eslint --init` · Issue #5992 - GitHub
eslint --init scripts on existing project · I choose to scan my files to determine the best configuration. What did you expect to...
Read more >
Configuration Files - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
ESLINT An error occurred while generating your JavaScript ...
A config file was still generated, but the config file itself may not follow your linting rules. Error: BaseConfig » eslint-config-airbnb-base » ...
Read more >
Linting in TypeScript using ESLint and Prettier - LogRocket Blog
Integrate Prettier with ESLint to automate type-checking in your TypeScript code and ensure that the code has no bugs.
Read more >
Working with JavaScript in Visual Studio Code
js files same as in .ts files. When types cannot be inferred, they can be specified using JSDoc comments. You can read 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