yarn lint
yarn run v1.22.22
$ eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0
There was a problem loading formatter: /Users/**/node_modules/eslint/lib/cli-engine/formatters/stylish
Error: require() of ES Module /Users/**/node_modules/strip-ansi/index.js from /Users/**/node_modules/eslint/lib/cli-engine/formatters/stylish.js not supported.
Instead change the require of index.js in /Users/**/node_modules/eslint/lib/cli-engine/formatters/stylish.js to a dynamic import() which is available in all CommonJS modules.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
解决:
一、package.json中添加下面代码,强制使用安装的依赖版本
"resolutions": {
"strip-ansi": "6.0.0"
}
二、
yarn