Syntax Error: TypeError: eslint.CLIEngine is not a constructor

来源:2-6 ESLint 与 Prettier 配合解决代码格式问题

慕粉0250428608

2022-02-09

Syntax Error: TypeError: eslint.CLIEngine is not a constructor
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.

[{
“resource”: “/Users/luyikun/Desktop/vue项目/imooc-admin/src/views/Home.vue”,
“owner”: “eslint”,
“severity”: 8,
“message”: “Parsing error: Must use import to load ES Module: /Users/luyikun/Desktop/vue项目/imooc-admin/node_modules/eslint/node_modules/eslint-scope/lib/definition.js\nrequire() of ES modules is not supported.\nrequire() of /Users/luyikun/Desktop/vue项目/imooc-admin/node_modules/eslint/node_modules/eslint-scope/lib/definition.js from /Users/luyikun/Desktop/vue项目/imooc-admin/node_modules/babel-eslint/lib/require-from-eslint.js is an ES module file as it is a .js file whose nearest parent package.json contains “type”: “module” which defines all .js files in that package scope as ES modules.\nInstead rename definition.js to end in .cjs, change the requiring code to use import(), or remove “type”: “module” from /Users/luyikun/Desktop/vue项目/imooc-admin/node_modules/eslint/node_modules/eslint-scope/package.json.”,
“source”: “eslint”,
“startLineNumber”: 1,
“startColumn”: 1,
“endLineNumber”: 1,
“endColumn”: 1
}]

写回答

1回答

Sunday

2022-02-09

0
1
慕粉0250428608
这是可以,那这种岂不是关闭了语法检测
2022-02-09
共1条回复

基于Vue3新标准,打造后台综合解决方案

基于Vue3重写Vue-element-admin,打造后台前端综合解决方案

1941 学习 · 1687 问题

查看课程