From 5e2c409c8541c3ce4ddae006c5a77f44a04d19f5 Mon Sep 17 00:00:00 2001 From: Jamie Rolfs Date: Tue, 28 Feb 2023 12:45:06 -0800 Subject: [PATCH 1/2] feat(config/eslint): allow default exports in declaration, mocks, configuration --- src/config/__tests__/__snapshots__/eslintrc.js.snap | 12 ++++++++++++ src/config/eslintrc-strict.js | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/src/config/__tests__/__snapshots__/eslintrc.js.snap b/src/config/__tests__/__snapshots__/eslintrc.js.snap index ba7cff82..dedea51c 100644 --- a/src/config/__tests__/__snapshots__/eslintrc.js.snap +++ b/src/config/__tests__/__snapshots__/eslintrc.js.snap @@ -288,6 +288,18 @@ Object { exports[`Strict ESLint configuration 1`] = ` Object { + "overrides": Array [ + Object { + "files": Array [ + "**/*.d.ts", + "**/__mocks__/**/*", + "**/*.config.{js,cjs,ts,mjs}", + ], + "rules": Object { + "import/no-default-export": "off", + }, + }, + ], "rules": Object { "import/no-default-export": "error", "import/order": Array [ diff --git a/src/config/eslintrc-strict.js b/src/config/eslintrc-strict.js index 326388f7..a8a2c36c 100644 --- a/src/config/eslintrc-strict.js +++ b/src/config/eslintrc-strict.js @@ -16,4 +16,12 @@ module.exports = { ], 'sort-imports': ['error', {ignoreDeclarationSort: true}], }, + overrides: [ + { + files: ['**/*.d.ts', '**/__mocks__/**/*', '**/*.config.{js,cjs,ts,mjs}'], + rules: { + 'import/no-default-export': 'off', + }, + }, + ], } From ffaf7e89f738fe55c41add7655103d0726d46a6c Mon Sep 17 00:00:00 2001 From: Jamie Rolfs Date: Tue, 28 Feb 2023 12:45:46 -0800 Subject: [PATCH 2/2] fix(config/eslint): update `devDependencies` exclusion to include `.mjs` --- src/config/__tests__/__snapshots__/eslintrc.js.snap | 4 ++-- src/config/helpers/build-eslint.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config/__tests__/__snapshots__/eslintrc.js.snap b/src/config/__tests__/__snapshots__/eslintrc.js.snap index dedea51c..7a363ba8 100644 --- a/src/config/__tests__/__snapshots__/eslintrc.js.snap +++ b/src/config/__tests__/__snapshots__/eslintrc.js.snap @@ -113,7 +113,7 @@ Object { "jest/**", "test/**", "e2e/**", - "**/*.config.{js,cjs,ts}", + "**/*.config.{js,cjs,ts,mjs}", ], "optionalDependencies": false, }, @@ -246,7 +246,7 @@ Object { "jest/**", "test/**", "e2e/**", - "**/*.config.{js,cjs,ts}", + "**/*.config.{js,cjs,ts,mjs}", ], "optionalDependencies": false, }, diff --git a/src/config/helpers/build-eslint.js b/src/config/helpers/build-eslint.js index 28118d20..cd245bb3 100644 --- a/src/config/helpers/build-eslint.js +++ b/src/config/helpers/build-eslint.js @@ -62,7 +62,7 @@ const buildConfig = ({withReact = false} = {}) => { 'jest/**', 'test/**', 'e2e/**', - '**/*.config.{js,cjs,ts}', + '**/*.config.{js,cjs,ts,mjs}', ]), optionalDependencies: false, },