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 June 20, 2020 15:10
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 Compare August 30, 2021 17:03
@ljharb
Copy link
Member

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)

@ljharb ljharb marked this pull request as draft August 30, 2021 17:09
@Hypnosphi
Copy link
Contributor Author

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

@ljharb
Copy link
Member

ljharb commented Aug 30, 2021

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

@Hypnosphi
Copy link
Contributor Author

My branch is up-to date with master

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

All green now

ljharb pushed a commit to ljharb/eslint-plugin-import that referenced this pull request 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 Compare September 1, 2021 02:14
@ljharb
Copy link
Member

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)

@codecov
Copy link

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.

@Hypnosphi
Copy link
Contributor Author

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

@ljharb
Copy link
Member

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.

@ljharb ljharb marked this pull request as ready for review September 14, 2021 23:30
@ljharb ljharb force-pushed the no-unused-modules-dynamic-imports branch from b7bf750 to 7c382f0 Compare September 14, 2021 23:34
@ljharb ljharb merged commit 7c382f0 into import-js:main Sep 15, 2021
@aladdin-add
Copy link
Contributor

👍 awesome! thx for fixing this!

@Meemaw
Copy link

Meemaw commented Sep 22, 2021

Hey, is it possible to release this? 🙏

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.

5 participants