- Notifications
You must be signed in to change notification settings - Fork355
Supports ESLint v8.#1317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Supports ESLint v8.#1317
Uh oh!
There was an error while loading.Please reload this page.
Conversation
@ota-meshi thanks a lot for the PR. Will have a look this week. Saw that the first eslint 8.0.0 beta got released lately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Great work. I would suggest we do the minor word tweak.
Then I will publish an new internal version of the plugin so that users can do some insider testing before we release a new version. Is this OK for you?
server/src/eslintServer.ts Outdated
@@ -899,7 +935,7 @@ function resolveSettings(document: TextDocument): Promise<TextDocumentSettings> | |||
if (!settings.silent) { | |||
connection.console.error(`Failed to load eslint library from ${libraryPath}. See output panel for more information.`); | |||
} | |||
} else if (library.CLIEngine === undefined) { | |||
} else if (library.CLIEngine === undefined && library.ESLint === undefined) { | |||
settings.validate = Validate.off; | |||
connection.console.error(`The eslint library loaded from ${libraryPath} doesn\'t export a CLIEngine. You need at least eslint@1.0.0`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Should we also mention ESLint class. Something likeneither exports a CLIEngine nor an ESLint class
Thank you for the review! I changed the message.
It's OK with me! |
Uh oh!
There was an error while loading.Please reload this page.
This PR supports ESLint v8.
Specifically, change it to use the
ESLint
class instead of the removedCLIEngine
.However, for backward compatibility, if
CLIEngine
is present, useCLIEngine
. SeeESLintClassEmulator
class.I checked that this change works by making sure that the marker appears in each of the environments where
eslint@8.0.0-beta.0
,eslint@7.32.0
, andeslint@6.8.0
are installed.