Skip to content

feat: whitelist option for no-extraneous-dependencies - #142

Merged
SukkaW merged 7 commits into
un-ts:masterfrom
Zamiell:whitelist
Sep 4, 2024
Merged

SukkaW merged 7 commits into
un-ts:masterfrom
Zamiell:whitelist

Conversation

@Zamiell

@Zamiell Zamiell commented Aug 31, 2024 •

Copy link
Copy Markdown
Contributor

Closes #141.

This PR also includes some typo fixes in "no-extraneous-dependencies.md".

Also note that I had some difficulties in setting up this repo. After a clone, I typed "yarn" to install the project dependencies. Then, "npm run build" succeeded, but "npm run test" and "npm run lint" both failed from a completely fresh repo. Is that expected?

@changeset-bot

changeset-bot Bot commented Aug 31, 2024 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 40fcc99

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
eslint-plugin-import-x Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codesandbox-ci

codesandbox-ci Bot commented Aug 31, 2024 •

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@SukkaW SukkaW left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind adding a test case against your changes? Blocking for now.

@Zamiell

Zamiell commented Sep 1, 2024

Copy link
Copy Markdown
Contributor Author

Sure, but note that the existing tests don't even work:

$ yarn run test test/rules/no-extraneous-dependencies.spec.ts
yarn run v1.22.19
$ jest test/rules/no-extraneous-dependencies.spec.ts
 FAIL  test/rules/no-extraneous-dependencies.spec.ts
  no-extraneous-dependencies
    valid
      √ import "@org/package" (48 ms)
      √ import foo, { bar } from "@org/package" (4 ms)
      √ require("@org/package") (5 ms)
      √ var foo = require("@org/package") (4 ms)
      √ export { foo } from "@org/package" (3 ms)
      √ export * from "@org/package" (3 ms)
      √ import "esm-package" (6 ms)
      √ import foo, { bar } from "esm-package" (3 ms)
      √ require("esm-package") (3 ms)
      √ var foo = require("esm-package") (3 ms)
      √ export { foo } from "esm-package" (2 ms)
      √ export * from "esm-package" (2 ms)
      √ import "find-up" (3 ms)
      √ import foo, { bar } from "find-up" (2 ms)
      √ require("find-up") (2 ms)
      √ var foo = require("find-up") (2 ms)
      √ export { foo } from "find-up" (2 ms)
      √ export * from "find-up" (2 ms)
      √ import "jquery" (4 ms)
      √ import foo, { bar } from "jquery" (3 ms)
      √ require("jquery") (4 ms)
      √ var foo = require("jquery") (3 ms)
      √ export { foo } from "jquery" (4 ms)
      √ export * from "jquery" (3 ms)
      √ import "lodash.cond" (3 ms)
      √ import foo, { bar } from "lodash.cond" (3 ms)
      √ require("lodash.cond") (3 ms)
      √ var foo = require("lodash.cond") (3 ms)
      √ export { foo } from "lodash.cond" (3 ms)
      √ export * from "lodash.cond" (3 ms)
      √ import "rxjs" (2 ms)
      √ import foo, { bar } from "rxjs" (4 ms)
      √ require("rxjs") (2 ms)
      √ var foo = require("rxjs") (2 ms)
      √ export { foo } from "rxjs" (2 ms)
      √ export * from "rxjs" (1 ms)
      √ import "eslint" (3 ms)
      √ import foo, { bar } from "eslint" (2 ms)
      √ require("eslint") (2 ms)
      √ var foo = require("eslint") (2 ms)
      √ export { foo } from "eslint" (1 ms)
      √ export * from "eslint" (1 ms)
      √ import "glob" (3 ms)
      √ import foo, { bar } from "glob" (2 ms)
      √ require("glob") (1 ms)
      √ var foo = require("glob") (1 ms)
      √ export { foo } from "glob" (2 ms)
      √ export * from "glob" (1 ms)
      √ import "eslint/lib/api" (2 ms)
      √ import "fs" (2 ms)
      √ import "./foo" (2 ms)
      √ import "electron" (1 ms)
      √ import "eslint" (2 ms)
      √ import "importType" (2 ms)
      √ import jest from "jest" (4 ms)
      × import jest from "jest" (10 ms)
      × import jest from "jest" (2 ms)
      √ require(6) (2 ms)
      √ import "doctrine" (2 ms)
      √ import type MyType from "myflowtyped"; (346 ms)
      √
        // @flow
        import typeof TypeScriptModule from 'typescript';
       (6 ms)
      √ import react from "react"; (2 ms)
      √ import leftpad from "left-pad"; (2 ms)
      √ import leftpad from "left-pad"; (1 ms)
      √ import leftpad from "left-pad"; (2 ms)
      √ import leftpad from "left-pad"; (2 ms)
      √ import react from "react"; (1 ms)
      √ import leftpad from "left-pad"; (1 ms)
      √ import rightpad from "right-pad"; (4 ms)
      √ import foo from "@generated/foo" (2 ms)
      √ import foo from "@generated/foo" (2 ms)
      √ import foo from "@generated/foo" (1 ms)
      √ import foo from "@generated/foo" (2 ms)
      √ export function getToken() {} (3 ms)
      √ export class Component extends React.Component {} (2 ms)
      √ export function Component() {} (1 ms)
      √ export const Component = () => {} (2 ms)
      √ import "not-a-dependency" (2 ms)
      √ import "@generated/bar/module" (2 ms)
      √ import "@generated/bar/and/sub/path" (1 ms)
      √ import "rxjs/operators" (1 ms)
      √ import "esm-package/esm-module"; (3 ms)
      √
        import "alias/esm-package/esm-module";
        import 'expose-loader?exposes[]=$&exposes[]=jQuery!jquery';
       (111 ms)
      √ import "@custom-internal-alias/api/service"; (4 ms)
    invalid
      √ import "not-a-dependency" (4 ms)
      √ import "not-a-dependency" (3 ms)
      √ import "not-a-dependency" (2 ms)
      √ import "not-a-dependency" (2 ms)
      √ var donthaveit = require("@org/not-a-dependency") (2 ms)
      √ var donthaveit = require("@org/not-a-dependency/foo") (3 ms)
      √ import "eslint" (1 ms)
      √ import "lodash" (3 ms)
      √ var foo = require("not-a-dependency") (1 ms)
      √ var glob = require("glob") (2 ms)
      √ import jest from "jest" (2 ms)
      √ import jest from "jest" (2 ms)
      √ import jest from "jest" (2 ms)
      √ import jest from "jest" (5 ms)
      √ var eslint = require("lodash") (1 ms)
      √ import "not-a-dependency" (1 ms)
      √ import "bar" (3 ms)
      √ import foo from "foo" (3 ms)
      √ import leftpad from "left-pad"; (2 ms)
      √ import react from "react"; (2 ms)
      √ import react from "react"; (2 ms)
      √ import "react"; (2 ms)
      √ import bar from "@generated/bar" (2 ms)
      √ import foo from "@generated/foo" (2 ms)
      √ import bar from "@generated/bar" (1 ms)
      √ export { foo } from "not-a-dependency"; (2 ms)
      √ export * from "not-a-dependency"; (1 ms)
      √ import jest from "alias/jest"; (5 ms)
      √ import "esm-package-not-in-pkg-json/esm-module"; (2 ms)
      √ import "not-a-dependency" (2 ms)
  TypeScript
    no-extraneous-dependencies
      valid
        √ import type T from "a"; (1 ms)
        √ import type { T } from "a"; export type { T }; (1 ms)
        √ export type { T } from "a"; (1 ms)
      invalid
        √ import T from "a"; (2 ms)
        √ import type T from "a"; (2 ms)
  no-extraneous-dependencies typescript type imports
    valid
      √ import type MyType from "not-a-dependency"; (23 ms)
      √ import type { MyType } from "not-a-dependency"; (4 ms)
      √ import { type MyType } from "not-a-dependency"; (3 ms)
      √ import { type MyType, type OtherType } from "not-a-dependency"; (3 ms)
    invalid
      √ import type { MyType } from "not-a-dependency"; (4 ms)
      √ import type { Foo } from 'not-a-dependency'; (3 ms)
      √ import Foo, { type MyType } from "not-a-dependency"; (4 ms)
      √ import { type MyType, Foo } from "not-a-dependency"; (3 ms)

  ● no-extraneous-dependencies › valid › import jest from "jest"

    assert.strictEqual(received, expected)

    Expected value to strictly be equal to:
      0
    Received:
      1

    Message:
      Should have no errors but had 1: [
      {
        ruleId: '@rule-tester/no-extraneous-dependencies',
        severity: 2,
        message: "'jest' should be listed in the project's dependencies, not devDependencies.",
        line: 1,
        column: 1,
        nodeType: 'ImportDeclaration',
        messageId: 'devDep',
        endLine: 1,
        endColumn: 24
      }
    ]

      at RuleTester.#testValidTemplate (node_modules/@typescript-eslint/rule-tester/src/RuleTester.ts:805:12)
      at Object.<anonymous> (node_modules/@typescript-eslint/rule-tester/src/RuleTester.ts:499:38)

  ● no-extraneous-dependencies › valid › import jest from "jest"

    assert.strictEqual(received, expected)

    Expected value to strictly be equal to:
      0
    Received:
      1

    Message:
      Should have no errors but had 1: [
      {
        ruleId: '@rule-tester/no-extraneous-dependencies',
        severity: 2,
        message: "'jest' should be listed in the project's dependencies, not devDependencies.",
        line: 1,
        column: 1,
        nodeType: 'ImportDeclaration',
        messageId: 'devDep',
        endLine: 1,
        endColumn: 24
      }
    ]

      at RuleTester.#testValidTemplate (node_modules/@typescript-eslint/rule-tester/src/RuleTester.ts:805:12)
      at Object.<anonymous> (node_modules/@typescript-eslint/rule-tester/src/RuleTester.ts:499:38)

@Zamiell

Zamiell commented Sep 1, 2024 •

Copy link
Copy Markdown
Contributor Author

By the way, I think using a set instead of an array actually reduces perf because of the hashing involved. This stack overflow thread says that for sets with less than 20 elements, it is optimal to use an array instead: https://stackoverflow.com/a/75514478/1062714

@Zamiell

Zamiell commented Sep 1, 2024

Copy link
Copy Markdown
Contributor Author

Test case is added now.

@SukkaW
SukkaW self-requested a review September 4, 2024 11:29
@SukkaW
SukkaW enabled auto-merge (squash) September 4, 2024 11:34
@SukkaW
SukkaW merged commit f12447e into un-ts:master Sep 4, 2024
@Zamiell
Zamiell deleted the whitelist branch September 4, 2024 12:09
renovate Bot added a commit to mmkal/eslint-plugin-mmkal that referenced this pull request Sep 4, 2024
##### [v4.2.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#420)

##### Minor Changes

-   [#142](un-ts/eslint-plugin-import-x#142) [`f12447e`](un-ts/eslint-plugin-import-x@f12447e) Thanks [@Zamiell](https://github.com/Zamiell)! - Add new option "whitelist" for rule "no-extraneous-dependencies"

##### Patch Changes

-   [#146](un-ts/eslint-plugin-import-x#146) [`e5e4580`](un-ts/eslint-plugin-import-x@e5e4580) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix nuxt/eslint#494 by avoid importing from `@typescript-eslint/typescript-estree`.
renovate Bot added a commit to mmkal/eslint-plugin-mmkal that referenced this pull request Sep 17, 2024
##### [v4.2.1](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#421)

##### Patch Changes

-   [#148](un-ts/eslint-plugin-import-x#148) [`d228129`](un-ts/eslint-plugin-import-x@d228129) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix `newline-after-import`'s `considerComments` options when linting `require`, backports import-js/eslint-plugin-import#2952

-   [#147](un-ts/eslint-plugin-import-x#147) [`eca73ed`](un-ts/eslint-plugin-import-x@eca73ed) Thanks [@nchevsky](https://github.com/nchevsky)! - Fix regression in rule `no-unused-modules` which would incorrectly initialize option `src` to `[]` instead of `[process.cwd()]`, breaking file discovery.

-   [#148](un-ts/eslint-plugin-import-x#148) [`d228129`](un-ts/eslint-plugin-import-x@d228129) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix `no-duplicates` for TypeScript, backports import-js/eslint-plugin-import#3033
##### [v4.2.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#420)

##### Minor Changes

-   [#142](un-ts/eslint-plugin-import-x#142) [`f12447e`](un-ts/eslint-plugin-import-x@f12447e) Thanks [@Zamiell](https://github.com/Zamiell)! - Add new option "whitelist" for rule "no-extraneous-dependencies"

##### Patch Changes

-   [#146](un-ts/eslint-plugin-import-x#146) [`e5e4580`](un-ts/eslint-plugin-import-x@e5e4580) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix nuxt/eslint#494 by avoid importing from `@typescript-eslint/typescript-estree`.
##### [v4.1.1](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#411)

##### Patch Changes

-   [#133](un-ts/eslint-plugin-import-x#133) [`757ffa9`](un-ts/eslint-plugin-import-x@757ffa9) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix [#123](un-ts/eslint-plugin-import-x#123) where the rule `no-named-as-default` will confuse TypeScript namespace exports with actual exports.
##### [v4.1.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#410)

##### Minor Changes

-   [#122](un-ts/eslint-plugin-import-x#122) [`cd52e86`](un-ts/eslint-plugin-import-x@cd52e86) Thanks [@michaelfaith](https://github.com/michaelfaith)! - Add ESLint flat configuration presets. You can access them with:

    ```ts
    import eslintPluginImportX from "eslint-plugin-import-x";

    eslintPluginImportX.flatConfigs.recommended;
    eslintPluginImportX.flatConfigs.react;
    eslintPluginImportX.flatConfigs.typescript;
    eslintPluginImportX.flatConfigs.electron;
    ```

-   [#132](un-ts/eslint-plugin-import-x#132) [`9948c78`](un-ts/eslint-plugin-import-x@9948c78) Thanks [@SukkaW](https://github.com/SukkaW)! - Added `no-rename-default` that forbid importing a default export by a different name. Originally created by [@whitneyit](https://github.com/whitneyit), ported by [@SukkaW](https://github.com/SukkaW)
##### [v4.0.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#400)

##### Major Changes

-   [#112](un-ts/eslint-plugin-import-x#112) [`4ba14da`](un-ts/eslint-plugin-import-x@4ba14da) Thanks [@SukkaW](https://github.com/SukkaW)! - Use typescript-eslint v8. The minimum supported ESLint version is now >= 8.57.0 and the minimum required Node.js version is now 18.18.0.
renovate Bot added a commit to mmkal/eslint-plugin-mmkal that referenced this pull request Sep 17, 2024
##### [v4.2.1](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#421)

##### Patch Changes

-   [#148](un-ts/eslint-plugin-import-x#148) [`d228129`](un-ts/eslint-plugin-import-x@d228129) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix `newline-after-import`'s `considerComments` options when linting `require`, backports import-js/eslint-plugin-import#2952

-   [#147](un-ts/eslint-plugin-import-x#147) [`eca73ed`](un-ts/eslint-plugin-import-x@eca73ed) Thanks [@nchevsky](https://github.com/nchevsky)! - Fix regression in rule `no-unused-modules` which would incorrectly initialize option `src` to `[]` instead of `[process.cwd()]`, breaking file discovery.

-   [#148](un-ts/eslint-plugin-import-x#148) [`d228129`](un-ts/eslint-plugin-import-x@d228129) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix `no-duplicates` for TypeScript, backports import-js/eslint-plugin-import#3033
##### [v4.2.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#420)

##### Minor Changes

-   [#142](un-ts/eslint-plugin-import-x#142) [`f12447e`](un-ts/eslint-plugin-import-x@f12447e) Thanks [@Zamiell](https://github.com/Zamiell)! - Add new option "whitelist" for rule "no-extraneous-dependencies"

##### Patch Changes

-   [#146](un-ts/eslint-plugin-import-x#146) [`e5e4580`](un-ts/eslint-plugin-import-x@e5e4580) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix nuxt/eslint#494 by avoid importing from `@typescript-eslint/typescript-estree`.
##### [v4.1.1](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#411)

##### Patch Changes

-   [#133](un-ts/eslint-plugin-import-x#133) [`757ffa9`](un-ts/eslint-plugin-import-x@757ffa9) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix [#123](un-ts/eslint-plugin-import-x#123) where the rule `no-named-as-default` will confuse TypeScript namespace exports with actual exports.
##### [v4.1.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#410)

##### Minor Changes

-   [#122](un-ts/eslint-plugin-import-x#122) [`cd52e86`](un-ts/eslint-plugin-import-x@cd52e86) Thanks [@michaelfaith](https://github.com/michaelfaith)! - Add ESLint flat configuration presets. You can access them with:

    ```ts
    import eslintPluginImportX from "eslint-plugin-import-x";

    eslintPluginImportX.flatConfigs.recommended;
    eslintPluginImportX.flatConfigs.react;
    eslintPluginImportX.flatConfigs.typescript;
    eslintPluginImportX.flatConfigs.electron;
    ```

-   [#132](un-ts/eslint-plugin-import-x#132) [`9948c78`](un-ts/eslint-plugin-import-x@9948c78) Thanks [@SukkaW](https://github.com/SukkaW)! - Added `no-rename-default` that forbid importing a default export by a different name. Originally created by [@whitneyit](https://github.com/whitneyit), ported by [@SukkaW](https://github.com/SukkaW)
##### [v4.0.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#400)

##### Major Changes

-   [#112](un-ts/eslint-plugin-import-x#112) [`4ba14da`](un-ts/eslint-plugin-import-x@4ba14da) Thanks [@SukkaW](https://github.com/SukkaW)! - Use typescript-eslint v8. The minimum supported ESLint version is now >= 8.57.0 and the minimum required Node.js version is now 18.18.0.
renovate Bot added a commit to mmkal/eslint-plugin-mmkal that referenced this pull request Sep 17, 2024
##### [v4.2.1](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#421)

##### Patch Changes

-   [#148](un-ts/eslint-plugin-import-x#148) [`d228129`](un-ts/eslint-plugin-import-x@d228129) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix `newline-after-import`'s `considerComments` options when linting `require`, backports import-js/eslint-plugin-import#2952

-   [#147](un-ts/eslint-plugin-import-x#147) [`eca73ed`](un-ts/eslint-plugin-import-x@eca73ed) Thanks [@nchevsky](https://github.com/nchevsky)! - Fix regression in rule `no-unused-modules` which would incorrectly initialize option `src` to `[]` instead of `[process.cwd()]`, breaking file discovery.

-   [#148](un-ts/eslint-plugin-import-x#148) [`d228129`](un-ts/eslint-plugin-import-x@d228129) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix `no-duplicates` for TypeScript, backports import-js/eslint-plugin-import#3033
##### [v4.2.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#420)

##### Minor Changes

-   [#142](un-ts/eslint-plugin-import-x#142) [`f12447e`](un-ts/eslint-plugin-import-x@f12447e) Thanks [@Zamiell](https://github.com/Zamiell)! - Add new option "whitelist" for rule "no-extraneous-dependencies"

##### Patch Changes

-   [#146](un-ts/eslint-plugin-import-x#146) [`e5e4580`](un-ts/eslint-plugin-import-x@e5e4580) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix nuxt/eslint#494 by avoid importing from `@typescript-eslint/typescript-estree`.
##### [v4.1.1](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#411)

##### Patch Changes

-   [#133](un-ts/eslint-plugin-import-x#133) [`757ffa9`](un-ts/eslint-plugin-import-x@757ffa9) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix [#123](un-ts/eslint-plugin-import-x#123) where the rule `no-named-as-default` will confuse TypeScript namespace exports with actual exports.
##### [v4.1.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#410)

##### Minor Changes

-   [#122](un-ts/eslint-plugin-import-x#122) [`cd52e86`](un-ts/eslint-plugin-import-x@cd52e86) Thanks [@michaelfaith](https://github.com/michaelfaith)! - Add ESLint flat configuration presets. You can access them with:

    ```ts
    import eslintPluginImportX from "eslint-plugin-import-x";

    eslintPluginImportX.flatConfigs.recommended;
    eslintPluginImportX.flatConfigs.react;
    eslintPluginImportX.flatConfigs.typescript;
    eslintPluginImportX.flatConfigs.electron;
    ```

-   [#132](un-ts/eslint-plugin-import-x#132) [`9948c78`](un-ts/eslint-plugin-import-x@9948c78) Thanks [@SukkaW](https://github.com/SukkaW)! - Added `no-rename-default` that forbid importing a default export by a different name. Originally created by [@whitneyit](https://github.com/whitneyit), ported by [@SukkaW](https://github.com/SukkaW)
##### [v4.0.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#400)

##### Major Changes

-   [#112](un-ts/eslint-plugin-import-x#112) [`4ba14da`](un-ts/eslint-plugin-import-x@4ba14da) Thanks [@SukkaW](https://github.com/SukkaW)! - Use typescript-eslint v8. The minimum supported ESLint version is now >= 8.57.0 and the minimum required Node.js version is now 18.18.0.
renovate Bot added a commit to mmkal/eslint-plugin-mmkal that referenced this pull request Sep 17, 2024
##### [v4.2.1](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#421)

##### Patch Changes

-   [#148](un-ts/eslint-plugin-import-x#148) [`d228129`](un-ts/eslint-plugin-import-x@d228129) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix `newline-after-import`'s `considerComments` options when linting `require`, backports import-js/eslint-plugin-import#2952

-   [#147](un-ts/eslint-plugin-import-x#147) [`eca73ed`](un-ts/eslint-plugin-import-x@eca73ed) Thanks [@nchevsky](https://github.com/nchevsky)! - Fix regression in rule `no-unused-modules` which would incorrectly initialize option `src` to `[]` instead of `[process.cwd()]`, breaking file discovery.

-   [#148](un-ts/eslint-plugin-import-x#148) [`d228129`](un-ts/eslint-plugin-import-x@d228129) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix `no-duplicates` for TypeScript, backports import-js/eslint-plugin-import#3033
##### [v4.2.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#420)

##### Minor Changes

-   [#142](un-ts/eslint-plugin-import-x#142) [`f12447e`](un-ts/eslint-plugin-import-x@f12447e) Thanks [@Zamiell](https://github.com/Zamiell)! - Add new option "whitelist" for rule "no-extraneous-dependencies"

##### Patch Changes

-   [#146](un-ts/eslint-plugin-import-x#146) [`e5e4580`](un-ts/eslint-plugin-import-x@e5e4580) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix nuxt/eslint#494 by avoid importing from `@typescript-eslint/typescript-estree`.
##### [v4.1.1](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#411)

##### Patch Changes

-   [#133](un-ts/eslint-plugin-import-x#133) [`757ffa9`](un-ts/eslint-plugin-import-x@757ffa9) Thanks [@SukkaW](https://github.com/SukkaW)! - Fix [#123](un-ts/eslint-plugin-import-x#123) where the rule `no-named-as-default` will confuse TypeScript namespace exports with actual exports.
##### [v4.1.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#410)

##### Minor Changes

-   [#122](un-ts/eslint-plugin-import-x#122) [`cd52e86`](un-ts/eslint-plugin-import-x@cd52e86) Thanks [@michaelfaith](https://github.com/michaelfaith)! - Add ESLint flat configuration presets. You can access them with:

    ```ts
    import eslintPluginImportX from "eslint-plugin-import-x";

    eslintPluginImportX.flatConfigs.recommended;
    eslintPluginImportX.flatConfigs.react;
    eslintPluginImportX.flatConfigs.typescript;
    eslintPluginImportX.flatConfigs.electron;
    ```

-   [#132](un-ts/eslint-plugin-import-x#132) [`9948c78`](un-ts/eslint-plugin-import-x@9948c78) Thanks [@SukkaW](https://github.com/SukkaW)! - Added `no-rename-default` that forbid importing a default export by a different name. Originally created by [@whitneyit](https://github.com/whitneyit), ported by [@SukkaW](https://github.com/SukkaW)
##### [v4.0.0](https://github.com/un-ts/eslint-plugin-import-x/blob/HEAD/CHANGELOG.md#400)

##### Major Changes

-   [#112](un-ts/eslint-plugin-import-x#112) [`4ba14da`](un-ts/eslint-plugin-import-x@4ba14da) Thanks [@SukkaW](https://github.com/SukkaW)! - Use typescript-eslint v8. The minimum supported ESLint version is now >= 8.57.0 and the minimum required Node.js version is now 18.18.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

no-extraneous-dependencies should allow specific whitelist

2 participants