Currently, dts' builtin eslint config is always merged with a user-provided eslint config in .eslintrc.js. This gives me the following error:
Defaulting to "dts lint src test"
You can override this in the package.json scripts, like "lint": "dts lint src otherDir"
PluginConflictError: Plugin "prettier" was conflicted between "src/.eslintrc.js » eslint-config-fe-mono/.eslintrc.web.js" and "BaseConfig » plugin:prettier/recommended".
at mergePlugins (/cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:598:19)
at createConfig (/cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:701:9)
at ConfigArray.extractConfig (/cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/@eslint+eslintrc@2.1.4/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:877:33)
at FileEnumerator._isIgnoredFile (/cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/eslint@8.57.0/node_modules/eslint/lib/cli-engine/file-enumerator.js:534:24)
at FileEnumerator._iterateFilesRecursive (/cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/eslint@8.57.0/node_modules/eslint/lib/cli-engine/file-enumerator.js:470:42)
at _iterateFilesRecursive.next (<anonymous>)
at FileEnumerator.iterateFiles (/cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/eslint@8.57.0/node_modules/eslint/lib/cli-engine/file-enumerator.js:299:49)
at iterateFiles.next (<anonymous>)
at CLIEngine.executeOnFiles (/cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/eslint@8.57.0/node_modules/eslint/lib/cli-engine/cli-engine.js:797:48)
at ESLint.lintFiles (/cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/eslint@8.57.0/node_modules/eslint/lib/eslint/eslint.js:551:23) {
messageTemplate: 'plugin-conflict',
messageData: { pluginId: 'prettier', plugins: [ [Object], [Object] ] }
}
Our project has a custom eslint config that we don't wish to merge with the dts config:
But there's no way to accomplish this at the moment.
Desired Behavior
Provide a way to tell dts lint to not inject its own eslint config. Similar fixes should also be considered for Babel and Jest.
Suggested Solution
Two options:
Add a flag --no-builtin-config to dts lint (and possibly also a similar flag for Jest for dts test and for Babel for dts build and dts watch). For dts lint, this would pass baseConfig: {} to the ESLint constructor here: createBuildConfigs
Add an option to dts.config.js to disable builtin configs for the project, without having to pass --no-builtin-config.
Who does this impact? Who is this for?
All users who wish to use their own Eslint config without any config injected by dts.
Describe alternatives you've considered
Nothing is possible at the moment, since there's no way to customize the merge behavior of Object.assign.
Current Behavior
Currently, dts' builtin eslint config is always merged with a user-provided eslint config in
.eslintrc.js
. This gives me the following error:Our project has a custom eslint config that we don't wish to merge with the dts config:
But there's no way to accomplish this at the moment.
Desired Behavior
Provide a way to tell
dts lint
to not inject its own eslint config. Similar fixes should also be considered for Babel and Jest.Suggested Solution
Two options:
--no-builtin-config
todts lint
(and possibly also a similar flag for Jest fordts test
and for Babel fordts build
anddts watch
). Fordts lint
, this would passbaseConfig: {}
to theESLint
constructor here: createBuildConfigsdts.config.js
to disable builtin configs for the project, without having to pass--no-builtin-config
.Who does this impact? Who is this for?
All users who wish to use their own Eslint config without any config injected by
dts
.Describe alternatives you've considered
Nothing is possible at the moment, since there's no way to customize the merge behavior of
Object.assign
.Additional context
N/A