From 5e3b1fe945386150bcea7bf988753fa762a93d74 Mon Sep 17 00:00:00 2001 From: nityam Date: Sat, 28 Feb 2026 02:38:34 +0530 Subject: [PATCH] Enforce import/no-duplicates as error (#19797) --- eslint.config.js | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 3bc350d027..5cb8b7fcfa 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -55,26 +55,8 @@ export default tseslint.config( }, }, { - // Import specific config - files: ['packages/*/src/**/*.{ts,tsx}'], // Target all TS/TSX in the packages - plugins: { - import: importPlugin, - }, - settings: { - 'import/resolver': { - node: true, - }, - }, - rules: { - ...importPlugin.configs.recommended.rules, - ...importPlugin.configs.typescript.rules, - 'import/no-default-export': 'warn', - 'import/no-unresolved': 'off', // Disable for now, can be noisy with monorepos/paths - }, - }, - { - // General overrides and rules for the project (TS/TSX files) - files: ['packages/*/src/**/*.{ts,tsx}'], // Target only TS/TSX in the cli package + // Rules for packages/*/src (TS/TSX) + files: ['packages/*/src/**/*.{ts,tsx}'], plugins: { import: importPlugin, }, @@ -95,6 +77,11 @@ export default tseslint.config( }, }, rules: { + ...importPlugin.configs.recommended.rules, + ...importPlugin.configs.typescript.rules, + 'import/no-default-export': 'warn', + 'import/no-unresolved': 'off', + 'import/no-duplicates': 'error', // General Best Practice Rules (subset adapted for flat config) '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], 'arrow-body-style': ['error', 'as-needed'],