You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With npx @eslint/create-config command, import("eslint") doesn't work because it can't resolve "eslint" from a location within npm-cache where @eslint/create-config gets installed. It looks like we need to find a way to resolve "eslint" relative to cwd.
$ npx @eslint/create-config
npx: installed 40 in 10.142s
√ How would you like to use ESLint? · syntax
√ What type of modules does your project use? · none
√ Which framework does your project use? · none
√ Does your project use TypeScript? · No / Yes
√ Where does your code run? · No items were selected
√ What format do you want your config file to be in? · JavaScript
Local ESLint installation not found.
The config that you've selected requires the following dependencies:eslint@latest√ Would you like to install them now with npm? · No / YesInstalling eslint@latest+ [email protected]added 88 packages from 56 contributors and audited 88 packages in 11.58s13 packages are looking for funding run `npm fund` for detailsfound 0 vulnerabilities(node:4980) UnhandledPromiseRejectionWarning: Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'eslint' imported from C:\Users\MILOS\AppData\Roaming\npm-cache\_npx\4980\node_modules\@eslint\create-config\lib\init\config-file.js at packageResolve (internal/modules/esm/resolve.js:664:9) at moduleResolve (internal/modules/esm/resolve.js:705:18) at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:798:11) at Loader.resolve (internal/modules/esm/loader.js:100:40) at Loader.getModuleJob (internal/modules/esm/loader.js:246:28) at Loader.import (internal/modules/esm/loader.js:181:28) at importModuleDynamically (internal/modules/esm/translators.js:109:35) at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:32:14) at writeJSConfigFile (file:///C:/Users/MILOS/AppData/Roaming/npm-cache/_npx/4980/node_modules/@eslint/create-config/lib/init/config-file.js:88:24) at Module.write (file:///C:/Users/MILOS/AppData/Roaming/npm-cache/_npx/4980/node_modules/@eslint/create-config/lib/init/config-file.js:119:19)(node:4980) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)(node:4980) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
The text was updated successfully, but these errors were encountered:
With
npx @eslint/create-config
command,import("eslint")
doesn't work because it can't resolve"eslint"
from a location withinnpm-cache
where@eslint/create-config
gets installed. It looks like we need to find a way to resolve"eslint"
relative tocwd
.The text was updated successfully, but these errors were encountered: