forked from jaredpalmer/tsdx
-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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:
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/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:598:19)
at createConfig (/cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:701:9)
at ConfigArray.extractConfig (/cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:877:33)
at FileEnumerator._isIgnoredFile (/cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/cli-engine/file-enumerator.js:534:24)
at FileEnumerator._iterateFilesRecursive (/cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/[email protected]/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/[email protected]/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/[email protected]/node_modules/eslint/lib/cli-engine/cli-engine.js:797:48)
at ESLint.lintFiles (/cloudide/workspace/fe_mono/common/temp/node_modules/.pnpm/[email protected]/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:
module.exports = {
root: true,
extends: ['eslint-config-fe-mono/.eslintrc.node.js'],
};
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-configtodts lint(and possibly also a similar flag for Jest fordts testand for Babel fordts buildanddts watch). Fordts lint, this would passbaseConfig: {}to theESLintconstructor here: createBuildConfigs - Add an option to
dts.config.jsto 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
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working