From 5716786d1bd8a918d6e5bd543d8469691693bb7e Mon Sep 17 00:00:00 2001 From: donotlb Date: Tue, 22 Oct 2024 11:42:06 +0800 Subject: [PATCH] chore: enable import/no-unresolved rule for commonjs --- packages/eslint-config-base/index.js | 2 +- packages/eslint-config/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/eslint-config-base/index.js b/packages/eslint-config-base/index.js index 6000bf7..243abb2 100644 --- a/packages/eslint-config-base/index.js +++ b/packages/eslint-config-base/index.js @@ -46,7 +46,7 @@ module.exports = { rules: { 'class-methods-use-this': 'off', 'import/no-extraneous-dependencies': ['error', { devDependencies: true }], - 'import/no-unresolved': ['error', { caseSensitive: true }], + 'import/no-unresolved': ['error', { commonjs: true, caseSensitive: true }], 'require-await': 'error', 'no-console': ['error', { allow: ['warn', 'error'] }], 'no-param-reassign': ['error', { props: false }], diff --git a/packages/eslint-config/index.js b/packages/eslint-config/index.js index 7817e66..758a7b3 100644 --- a/packages/eslint-config/index.js +++ b/packages/eslint-config/index.js @@ -55,7 +55,7 @@ module.exports = { 'require-await': 'error', 'class-methods-use-this': 'off', 'import/no-extraneous-dependencies': ['error', { devDependencies: true }], - 'import/no-unresolved': ['error', { caseSensitive: true }], + 'import/no-unresolved': ['error', { commonjs: true, caseSensitive: true }], 'import/extensions': 'off', 'jsx-a11y/click-events-have-key-events': 'off', 'jsx-a11y/no-static-element-interactions': 'off',