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

[New] no-unused-modules: support dynamic imports [2] #2212

Merged
merged 2 commits into from Sep 15, 2021

Conversation

@Hypnosphi
Copy link
Contributor

@Hypnosphi Hypnosphi commented Aug 30, 2021

Replaces #1660

maxkomarychev and others added 2 commits Jun 20, 2020
See import-js#1660, import-js#2212.

Co-authored-by: Max Komarychev <maxkomarychev@gmail.com>
Co-authored-by: Filipp Riabchun <filipp.riabchun@jetbrains.com>
Co-authored-by: 薛定谔的猫 <weiran.zsd@outlook.com>
All occurences of `import('...')` are treated as namespace imports
(`import * as X from '...'`)

See import-js#1660, import-js#2212.

Co-authored-by: Max Komarychev <maxkomarychev@gmail.com>
Co-authored-by: Filipp Riabchun <filipp.riabchun@jetbrains.com>
Co-authored-by: 薛定谔的猫 <weiran.zsd@outlook.com>
@Hypnosphi Hypnosphi force-pushed the no-unused-modules-dynamic-imports branch from e69c056 to 86a87d3 Aug 30, 2021
@ljharb
Copy link
Collaborator

@ljharb ljharb commented Aug 30, 2021

oof, please don't make new PRs (but please leave this one open, since now I have to keep it in sync with #1660 until both are merged)

Loading

@ljharb ljharb marked this pull request as draft Aug 30, 2021
@Hypnosphi
Copy link
Contributor Author

@Hypnosphi Hypnosphi commented Aug 30, 2021

Sorry, the scheme with two branches for one PR apparently didn't work well, at least for me. Tests are passing in my branch, I have no idea what broke them in the original branch

Loading

@ljharb
Copy link
Collaborator

@ljharb ljharb commented Aug 30, 2021

Probably something that landed in master in the interim, since the branches shouldn't be any different.

Loading

@Hypnosphi
Copy link
Contributor Author

@Hypnosphi Hypnosphi commented Aug 30, 2021

My branch is up-to date with master

Loading

@Hypnosphi Hypnosphi force-pushed the no-unused-modules-dynamic-imports branch 2 times, most recently from 63c3c5a to b724db8 Aug 30, 2021
@Hypnosphi
Copy link
Contributor Author

@Hypnosphi Hypnosphi commented Aug 30, 2021

All green now

Loading

.github/workflows/node-4+.yml Outdated Show resolved Hide resolved
Loading
ljharb added a commit to ljharb/eslint-plugin-import that referenced this issue Aug 30, 2021
@Hypnosphi Hypnosphi changed the title [New] no-unused-modules: support dynamic imports [New] no-unused-modules: support dynamic imports [2] Aug 30, 2021
@ljharb ljharb force-pushed the no-unused-modules-dynamic-imports branch 2 times, most recently from 329454c to 3d8cc76 Sep 1, 2021
@ljharb
Copy link
Collaborator

@ljharb ljharb commented Sep 1, 2021

post rebase, travis-ci is failing, with Error: Cannot find module 'eslint-module-utils/visit' - despite 968dda1 (which wasn't required for travis tests to be passing before)

Loading

@codecov
Copy link

@codecov codecov bot commented Sep 1, 2021

Codecov Report

Merging #2212 (968dda1) into main (35bd977) will decrease coverage by 1.12%.
The diff coverage is n/a.

Current head 968dda1 differs from pull request most recent head 7c382f0. Consider uploading reports for the commit 7c382f0 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2212      +/-   ##
==========================================
- Coverage   84.28%   83.16%   -1.13%     
==========================================
  Files          93       93              
  Lines        2971     2987      +16     
  Branches      881      879       -2     
==========================================
- Hits         2504     2484      -20     
- Misses        467      503      +36     
Impacted Files Coverage Δ
utils/declaredScope.js 83.33% <0.00%> (-16.67%) ⬇️
utils/parse.js 71.79% <0.00%> (-15.71%) ⬇️
utils/hash.js 85.29% <0.00%> (-14.71%) ⬇️
utils/module-require.js 87.50% <0.00%> (-12.50%) ⬇️
utils/ModuleCache.js 90.00% <0.00%> (-10.00%) ⬇️
utils/ignore.js 87.50% <0.00%> (-9.06%) ⬇️
utils/moduleVisitor.js 91.80% <0.00%> (-8.20%) ⬇️
utils/resolve.js 92.91% <0.00%> (-7.09%) ⬇️
resolvers/node/index.js 91.42% <0.00%> (-5.55%) ⬇️
src/rules/no-unresolved.js 100.00% <0.00%> (ø)
... and 1 more

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 35bd977...7c382f0. Read the comment docs.

Loading

@Hypnosphi
Copy link
Contributor Author

@Hypnosphi Hypnosphi commented Sep 1, 2021

For some reason, I don't see npm run pretest in the job log: https://app.travis-ci.com/github/import-js/eslint-plugin-import/jobs/534928091

Loading

@ljharb
Copy link
Collaborator

@ljharb ljharb commented Sep 1, 2021

hm, you're right, i don't see that either. Maybe after_install isn't a thing, i'll fix that.

Loading

@ljharb ljharb force-pushed the no-unused-modules-dynamic-imports branch from 3d8cc76 to b0acc6e Sep 1, 2021
@ljharb ljharb force-pushed the no-unused-modules-dynamic-imports branch from b0acc6e to b7bf750 Sep 14, 2021
ljharb
ljharb approved these changes Sep 14, 2021
@ljharb ljharb marked this pull request as ready for review Sep 14, 2021
@ljharb ljharb force-pushed the no-unused-modules-dynamic-imports branch from b7bf750 to 7c382f0 Sep 14, 2021
@ljharb ljharb merged commit 7c382f0 into import-js:main Sep 15, 2021
184 of 186 checks passed
Loading
@aladdin-add
Copy link
Contributor

@aladdin-add aladdin-add commented Sep 15, 2021

👍 awesome! thx for fixing this!

Loading

@Meemaw
Copy link

@Meemaw Meemaw commented Sep 22, 2021

Hey, is it possible to release this? 🙏

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants