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-extraneous-dependencies/TypeScript: do not error when importing inline type from dev dependencies #2735

Conversation

AndyOGo
Copy link
Contributor

@AndyOGo AndyOGo commented Mar 14, 2023

fixes #1618

This PR is to avoid error should be listed in the project's dependencies, not devDependencies. when only importing inline typescript types

@AndyOGo AndyOGo force-pushed the bugfix/no-extraneous-dependencies-inline-type-import branch 4 times, most recently from 38b9ef8 to 3fe9459 Compare March 14, 2023 22:41
@AndyOGo AndyOGo force-pushed the bugfix/no-extraneous-dependencies-inline-type-import branch from 3fe9459 to d0460df Compare March 15, 2023 07:41
Copy link
Contributor

@fernandopasik fernandopasik left a comment

Choose a reason for hiding this comment

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

I think CI is broken on master. Overall great work!

@AndyOGo
Copy link
Contributor Author

AndyOGo commented Mar 16, 2023

@fernandopasik
You are right.
Looks like WSL has another problem.

https://ci.appveyor.com/project/ljharb/eslint-plugin-import/builds/46338908/job/hqyre5h5sbfqqn44

Error: Cannot find module 'semver'
Require stack:
- /mnt/c/projects/eslint-plugin-import/tests/src/cli.js
- /mnt/c/projects/eslint-plugin-import/node_modules/mocha/lib/mocha.js
- /mnt/c/projects/eslint-plugin-import/node_modules/mocha/index.js
- /mnt/c/projects/eslint-plugin-import/node_modules/mocha/bin/_mocha
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1021:15)
    at Function.Module._load (node:internal/modules/cjs/loader:866:27)
    at Module.require (node:internal/modules/cjs/loader:1093:19)
    at require (node:internal/modules/cjs/helpers:108:18)
    at Object.<anonymous> (/mnt/c/projects/eslint-plugin-import/tests/src/cli.js:9:1)
    at Module._compile (node:internal/modules/cjs/loader:1191:14)
    at Module.replacementCompile (/mnt/c/projects/eslint-plugin-import/node_modules/nyc/node_modules/append-transform/index.js:58:13)
    at loader (/mnt/c/projects/eslint-plugin-import/node_modules/babel-register/lib/node.js:144:5)
    at require.extensions.<computed> (/mnt/c/projects/eslint-plugin-import/node_modules/babel-register/lib/node.js:154:7)
    at Object.<anonymous> (/mnt/c/projects/eslint-plugin-import/node_modules/nyc/node_modules/append-transform/index.js:62:4)
    at Module.load (node:internal/modules/cjs/loader:1069:32)
    at Function.Module._load (node:internal/modules/cjs/loader:904:12)
    at Module.require (node:internal/modules/cjs/loader:1093:19)
    at require (node:internal/modules/cjs/helpers:108:18)
    at /mnt/c/projects/eslint-plugin-import/node_modules/mocha/lib/mocha.js:231:27
    at Array.forEach (<anonymous>)
    at Mocha.loadFiles (/mnt/c/projects/eslint-plugin-import/node_modules/mocha/lib/mocha.js:228:14)
    at Mocha.run (/mnt/c/projects/eslint-plugin-import/node_modules/mocha/lib/mocha.js:514:10)
    at Object.<anonymous> (/mnt/c/projects/eslint-plugin-import/node_modules/mocha/bin/_mocha:480:18)
    at Module._compile (node:internal/modules/cjs/loader:1191:14)
    at Module.replacementCompile (/mnt/c/projects/eslint-plugin-import/node_modules/nyc/node_modules/append-transform/index.js:58:13)
    at module.exports (/mnt/c/projects/eslint-plugin-import/node_modules/nyc/node_modules/default-require-extensions/js.js:8:9)
    at /mnt/c/projects/eslint-plugin-import/node_modules/nyc/node_modules/append-transform/index.js:62:4
    at require.extensions.<computed> (/mnt/c/projects/eslint-plugin-import/node_modules/babel-register/lib/node.js:152:7)
    at Object.<anonymous> (/mnt/c/projects/eslint-plugin-import/node_modules/nyc/node_modules/append-transform/index.js:62:4)
    at Module.load (node:internal/modules/cjs/loader:1069:32)
    at Function.Module._load (node:internal/modules/cjs/loader:904:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at runMain (/home/appveyor/.node-spawn-wrap-41-9e09463faa5b/node:68:10)
    at Function.<anonymous> (/home/appveyor/.node-spawn-wrap-41-9e09463faa5b/node:171:5)
    at Object.<anonymous> (/mnt/c/projects/eslint-plugin-import/node_modules/nyc/bin/wrap.js:23:4)
    at Module._compile (node:internal/modules/cjs/loader:1191:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1245:10)
    at Module.load (node:internal/modules/cjs/loader:1069:32)
    at Function.Module._load (node:internal/modules/cjs/loader:904:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at /home/appveyor/.node-spawn-wrap-41-9e09463faa5b/node:178:8
    at Object.<anonymous> (/home/appveyor/.node-spawn-wrap-41-9e09463faa5b/node:181:3)
    at Module._compile (node:internal/modules/cjs/loader:1191:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1245:10)
    at Module.load (node:internal/modules/cjs/loader:1069:32)
    at Function.Module._load (node:internal/modules/cjs/loader:904:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:22:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/mnt/c/projects/eslint-plugin-import/tests/src/cli.js',
    '/mnt/c/projects/eslint-plugin-import/node_modules/mocha/lib/mocha.js',
    '/mnt/c/projects/eslint-plugin-import/node_modules/mocha/index.js',
    '/mnt/c/projects/eslint-plugin-import/node_modules/mocha/bin/_mocha'
  ]
}

@AndyOGo
Copy link
Contributor Author

AndyOGo commented Mar 16, 2023

I created #2737

@ljharb ljharb force-pushed the bugfix/no-extraneous-dependencies-inline-type-import branch from d0460df to 9799567 Compare April 13, 2023 18:35
@ljharb ljharb changed the title Bugfix/no extraneous dependencies inline type import [Fix] no-extraneous-dependencies/TypeScript: do not error when importing inline type from dev dependencies Apr 13, 2023
@ljharb ljharb merged commit 9799567 into import-js:main Apr 13, 2023
@AndyOGo AndyOGo deleted the bugfix/no-extraneous-dependencies-inline-type-import branch April 13, 2023 21:54
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-extraneous-dependencies] Problems when only using types
3 participants