Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] no-duplicates: Ignore duplicate modules in different TypeScript module declarations #2378

Conversation

remcohaszing
Copy link
Contributor

Without this the import/no-duplicates rule reports imports of the same module inside different module declarations in the same file. It even autofixed them, which break the code.

Closes #2273

…pt module declarations

Without this the `import/no-duplicates` rule reports imports of the same
module inside different module declarations in the same file. It even
autofixed them, which break the code.

Closes import-js#2273
@codecov
Copy link

codecov bot commented Jan 29, 2022

Codecov Report

Merging #2378 (a45502c) into main (3603428) will not change coverage.
The diff coverage is 100.00%.

❗ Current head a45502c differs from pull request most recent head 0595a2f. Consider uploading reports for the commit 0595a2f to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2378   +/-   ##
=======================================
  Coverage   95.03%   95.03%           
=======================================
  Files          66       66           
  Lines        2718     2718           
  Branches      913      914    +1     
=======================================
  Hits         2583     2583           
  Misses        135      135           
Impacted Files Coverage Δ
src/rules/no-duplicates.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3603428...0595a2f. Read the comment docs.

@remcohaszing remcohaszing force-pushed the no-duplicates-typescript-module-declarations branch from 1dbcd96 to a45502c Compare February 2, 2022 12:14
@ljharb ljharb force-pushed the no-duplicates-typescript-module-declarations branch from a45502c to 0595a2f Compare February 2, 2022 18:50
@ljharb ljharb merged commit 0595a2f into import-js:main Feb 2, 2022
crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this pull request Apr 9, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) | devDependencies | minor | [`2.25.4` -> `2.26.0`](https://renovatebot.com/diffs/npm/eslint-plugin-import/2.25.4/2.26.0) |

---

### Release Notes

<details>
<summary>import-js/eslint-plugin-import</summary>

### [`v2.26.0`](https://github.com/import-js/eslint-plugin-import/blob/HEAD/CHANGELOG.md#&#8203;2260---2022-04-05)

[Compare Source](import-js/eslint-plugin-import@v2.25.4...v2.26.0)

##### Added

-   \[`no-named-default`, `no-default-export`, `prefer-default-export`, `no-named-export`, `export`, `named`, `namespace`, `no-unused-modules`]: support arbitrary module namespace names (\[[#&#8203;2358](import-js/eslint-plugin-import#2358)], thanks \[[@&#8203;sosukesuzuki](https://github.com/sosukesuzuki)])
-   \[`no-dynamic-require`]: support dynamic import with espree (\[[#&#8203;2371](import-js/eslint-plugin-import#2371)], thanks \[[@&#8203;sosukesuzuki](https://github.com/sosukesuzuki)])
-   \[`no-relative-packages`]: add fixer (\[[#&#8203;2381](import-js/eslint-plugin-import#2381)], thanks \[[@&#8203;forivall](https://github.com/forivall)])

##### Fixed

-   \[`default`]: `typescript-eslint-parser`: avoid a crash on exporting as namespace (thanks \[[@&#8203;ljharb](https://github.com/ljharb)])
-   \[`export`]/TypeScript: false positive for typescript namespace merging (\[[#&#8203;1964](import-js/eslint-plugin-import#1964)], thanks \[[@&#8203;magarcia](https://github.com/magarcia)])
-   \[`no-duplicates`]: ignore duplicate modules in different TypeScript module declarations (\[[#&#8203;2378](import-js/eslint-plugin-import#2378)], thanks \[[@&#8203;remcohaszing](https://github.com/remcohaszing)])
-   \[`no-unused-modules`]: avoid a crash when processing re-exports (\[[#&#8203;2388](import-js/eslint-plugin-import#2388)], thanks \[[@&#8203;ljharb](https://github.com/ljharb)])

##### Changed

-   \[Tests] `no-nodejs-modules`: add tests for node protocol URL (\[[#&#8203;2367](import-js/eslint-plugin-import#2367)], thanks \[[@&#8203;sosukesuzuki](https://github.com/sosukesuzuki)])
-   \[Tests] `default`, `no-anonymous-default-export`, `no-mutable-exports`, `no-named-as-default-member`, `no-named-as-default`: add tests for arbitrary module namespace names (\[[#&#8203;2358](import-js/eslint-plugin-import#2358)], thanks \[[@&#8203;sosukesuzuki](https://github.com/sosukesuzuki)])
-   \[Docs] \[`no-unresolved`]: Fix RegExp escaping in readme (\[[#&#8203;2332](import-js/eslint-plugin-import#2332)], thanks \[[@&#8203;stephtr](https://github.com/stephtr)])
-   \[Refactor] `namespace`: try to improve performance (\[[#&#8203;2340](import-js/eslint-plugin-import#2340)], thanks \[[@&#8203;ljharb](https://github.com/ljharb)])
-   \[Docs] make rule doc titles consistent (\[[#&#8203;2393](import-js/eslint-plugin-import#2393)], thanks \[[@&#8203;TheJaredWilcurt](https://github.com/TheJaredWilcurt)])
-   \[Docs] `order`: TS code examples should use TS code blocks (\[[#&#8203;2411](import-js/eslint-plugin-import#2411)], thanks \[[@&#8203;MM25Zamanian](https://github.com/MM25Zamanian)])
-   \[Docs] `no-unresolved`: fix link (\[[#&#8203;2417](import-js/eslint-plugin-import#2417)], thanks \[[@&#8203;kylemh](https://github.com/kylemh)])

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).

Co-authored-by: cabr2-bot <cabr2.help@gmail.com>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1284
Reviewed-by: crapStone <crapstone@noreply.codeberg.org>
Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

import/no-duplicates false positives for TypeScript module declarations
2 participants