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
012022-02-09
相似问题