Bug: 'this.libOptions.parse is not a function' error after upgrading to ESLint 8.23.0
See original GitHub issueEnvironment
Node version: 16.17.0 npm version: 8.18.0 Local ESLint version: 8.23.0 Global ESLint version: none Operating System: Windows 10 x64 21H2
What parser are you using?
Default (Espree)
What did you do?
Configuration
{
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2020
},
"env": {
"browser": true,
"node": true,
"es6": true
},
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"rules": {
"linebreak-style": ["error", "windows"]
}
}
console.log('Hello!');
What did you expect to happen?
The ESLint error should not be displayed in Jetbrain IDE(IntelliJ Webstorm), and the grammar check should proceed properly.
What actually happened?
Reproduce GitHub repo: https://github.com/jooy2/eslint-liboptions-parse-is-not-a-function
I don’t know if this is only happening in the IntelliJ Webstorm IDE, but it worked fine in the old environment and I haven’t modified any other settings in the recent IDE.
After upgrading ESLint to 8.23.0
, the check fails with the following error in the IDE:
TypeError: this.libOptions.parse is not a function
at ESLint8Plugin.<anonymous> (C:\Program Files\JetBrains\WebStorm 2020.2.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint8-plugin.js:139:64)
at step (C:\Program Files\JetBrains\WebStorm 2020.2.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint8-plugin.js:44:23)
at Object.next (C:\Program Files\JetBrains\WebStorm 2020.2.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint8-plugin.js:25:53)
at C:\Program Files\JetBrains\WebStorm 2020.2.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint8-plugin.js:19:71
at new Promise (<anonymous>)
at __awaiter (C:\Program Files\JetBrains\WebStorm 2020.2.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint8-plugin.js:15:12)
at ESLint8Plugin.invokeESLint (C:\Program Files\JetBrains\WebStorm 2020.2.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint8-plugin.js:133:16)
at ESLint8Plugin.<anonymous> (C:\Program Files\JetBrains\WebStorm 2020.2.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint8-plugin.js:120:44)
at step (C:\Program Files\JetBrains\WebStorm 2020.2.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint8-plugin.js:44:23)
at Object.next (C:\Program Files\JetBrains\WebStorm 2020.2.2\plugins\JavaScriptLanguage\languageService\eslint\bin\eslint8-plugin.js:25:53)
Process finished with exit code -1
Even with only the eslint
package installed, the problem occurs whether the .eslintrc
file exists or not.
Participation
- I am willing to submit a pull request for this issue.
Additional comments
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:28
- Comments:10 (3 by maintainers)
Top Results From Across the Web
ESLint@8.23: TypeError: this.libOptions.parse is not a function
1. Updated ESLint to 8.23.0 2. Upon lint a file, ESLint failed with the following error: this.libOptions.parse is not a function
Read more >ESLint: TypeError: this.libOptions.parse is not a function
I created a new Next.js project with TypeScript enabled, and that's all. The error is shown below: TypeError: this.libOptions.parse is not a ......
Read more >ESLint: TypeError: this.libOptions.parse is not a function | by ...
After that update your project to get back to 8.22 instead of 8.23, i.e.. remove node_modules folder; clean package-lock.json (by removing it too);...
Read more >typeerror: this.liboptions.parse is not a function - You.com
Solution 1: Downgrade eslint to eslint@8.22.0 When I was Researching about this error I found that eslint 's latest version 8.23 is the...
Read more >@typescript-eslint/parser - npm
See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for all the details!
Per this line of code, it seems that the plugin is reaching into the
eslint
package to load an internal module. ESLint’s public API is defined inpackage.exports
. Since thelib/options.js
module isn’t public, its API can change in non-major versions, as it did in the latest version v8.23.0.I think this problem should be fixed on the plugin’s side, and there’s already a raised issue in the JetBrains’ issue tracker:
https://youtrack.jetbrains.com/issue/WEB-57089/ESLint823-TypeError-thislibOptionsparse-is-not-a-function
Also just received this after upgrading:
Error Message
Error Root
WebStorm Plugin Source
https://gist.github.com/prescience-data/fa82f9b26e00cd74be8ea262b3048f08#file-eslint8-plugin-ts-L21
Recent Commit
https://github.com/eslint/eslint/commit/3e5839ecae96aecfbc1ac9526e88e0105e671032#diff-358c9491edc00f0db6f2f3c317df9aa932135803481b86c9289bd56bf8af0622L66
Context
16.17.0
Windows 11
^8.23.0
2022.2.1
ESLint Plugins
Config