You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After creating a new dts-cli project, choosing the react-storybook template, running yarn lint will fail due to not being able to load eslint-plugin-prettier correctly.
Expected behavior
yarn lint works without any problems
Suggested solution(s)
Installing eslint-plugin-prettier helps get rid of the error message, but it does not seem to be the intended way, since for the react template it works out of the box (and there it is also missing in the package.json)
Additional context
It apparently only fails in the react-storybook template.
yarn run v1.19.1
$ dts lint
Defaulting to "dts lint src test"
You can override this in the package.json scripts, like "lint": "dts lint src otherDir"
Error: Failed to load plugin 'prettier' declared in 'BaseConfig': Cannot find module 'eslint-plugin-prettier'
Require stack:
- /Users/dummy/react-libs/dts-test-storybook/__placeholder__.js
Referenced from: BaseConfig
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.resolve (node:internal/modules/cjs/helpers:108:19)
at Object.resolve (/Users/dummy/react-libs/dts-test-storybook/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2325:46)
at ConfigArrayFactory._loadPlugin (/Users/dummy/react-libs/dts-test-storybook/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3376:33)
at ConfigArrayFactory._loadExtendedPluginConfig (/Users/dummy/react-libs/dts-test-storybook/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3196:29)
at ConfigArrayFactory._loadExtends (/Users/dummy/react-libs/dts-test-storybook/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3117:29)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/Users/dummy/react-libs/dts-test-storybook/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3058:25)
at _normalizeObjectConfigDataBody.next (<anonymous>)
at ConfigArrayFactory._normalizeObjectConfigData (/Users/dummy/react-libs/dts-test-storybook/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3003:20)
at _normalizeObjectConfigData.next (<anonymous>) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/dummy/react-libs/dts-test-storybook/__placeholder__.js'
],
messageTemplate: 'plugin-missing',
messageData: {
pluginName: 'eslint-plugin-prettier',
resolvePluginsRelativeTo: '/Users/dummy/react-libs/dts-test-storybook',
importerName: 'BaseConfig'
}
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
it's because sometime yarn did not dedupe dts-cli's deps. you'll need to run npx yarn-deduplicate to do this.
Technically the plugins should be the app's deps(not dts-cli's), but it's a quiet big overhead for dts users. I planned to take the eslint's new config system (still wip, likely to be shipped in eslint v9) to avoid this. so, as of now you may need to run npx yarn-deduplicate.
Current Behavior
After creating a new dts-cli project, choosing the react-storybook template, running
yarn lint
will fail due to not being able to load eslint-plugin-prettier correctly.Expected behavior
yarn lint
works without any problemsSuggested solution(s)
Installing
eslint-plugin-prettier
helps get rid of the error message, but it does not seem to be the intended way, since for thereact
template it works out of the box (and there it is also missing in the package.json)Additional context
It apparently only fails in the
react-storybook
template.Your environment
The text was updated successfully, but these errors were encountered: