From 94f177c6e8061954037e09e410046b372184787c Mon Sep 17 00:00:00 2001 From: Alexander Tkachenko Date: Sun, 3 Sep 2023 17:08:21 +0300 Subject: [PATCH 1/2] feat: add 'import/no-extraneous-dependencies' rule --- base.js | 1 + 1 file changed, 1 insertion(+) diff --git a/base.js b/base.js index e9df7f1..ca21246 100644 --- a/base.js +++ b/base.js @@ -107,6 +107,7 @@ module.exports = { 'require-yield': WARNING, // eslint:recommended 'import/no-duplicates': [ERROR, {considerQueryString: true}], + 'import/no-extraneous-dependencies': [ERROR, {includeTypes: true}], }, overrides: [ { From ab3db27fb403c94b7753ad8564e3b0aabf368534 Mon Sep 17 00:00:00 2001 From: Valeriy Sidorenko Date: Fri, 15 Sep 2023 16:56:32 +0200 Subject: [PATCH 2/2] chore: add test for rule --- test/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/index.ts b/test/index.ts index f064529..f983dd9 100644 --- a/test/index.ts +++ b/test/index.ts @@ -1,4 +1,5 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ +/* eslint-disable import/order */ // eslint-disable-next-line import/no-duplicates import {test} from './file'; @@ -7,5 +8,11 @@ import {test2} from './file'; import type {test4 as Test4} from './file'; // eslint-disable-next-line import/no-duplicates import {test3} from './file.js'; + import {test4} from './file.js?mod2'; import {test5} from './file?mod'; + +// eslint-disable-next-line import/no-extraneous-dependencies +import {parse} from 'json5'; +// eslint-disable-next-line import/no-extraneous-dependencies +import type {stringify} from 'json5';