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
npm run lint or npx eslint src fails to run on a freshly created SvelteKit project, complaining that Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/zizheng/Projects/my-app/.eslintrc.js from /Users/zizheng/Projects/my-app/node_modules/@eslint/eslintrc/dist/eslintrc.cjs not supported. ... (see logs section for details).
Reproduction
The following steps can be reproduced
both on macOS 12.4 and Windows 11
both with the demo project and the skeleton project
both with and without TypeScript
$ npm create svelte my-app
...
✔ Which Svelte app template? › Skeleton project
✔ Add type checking with TypeScript? › No
✔ Add ESLint for code linting? … Yes
✔ Add Prettier for code formatting? … No
✔ Add Playwright for browser testing? … No
...
$ cd my-app
$ npm install
$ npm run lint
Logs
$ npm --version
8.13.1
$ npm create svelte my-app
create-svelte version 2.0.0-next.143
Welcome to SvelteKit!
This is beta software; expect bugs and missing features.
Problems? Open an issue on https://github.com/sveltejs/kit/issues if none exists already.
✔ Which Svelte app template? › Skeleton project
✔ Add type checking with TypeScript? › No
✔ Add ESLint for code linting? … Yes
✔ Add Prettier for code formatting? … No
✔ Add Playwright for browser testing? … No
Your project is ready!
✔ ESLint
https://github.com/sveltejs/eslint-plugin-svelte3
Install community-maintained integrations:
https://github.com/svelte-add/svelte-adders
Next steps:
1: cd my-app
2: npm install (or pnpm install, etc)
3: git init && git add -A && git commit -m "Initial commit" (optional)
4: npm run dev -- --open
To close the dev server, hit Ctrl-C
Stuck? Visit us at https://svelte.dev/chat
$ cd my-app
$ npm install
> my-app@0.0.1 prepare
> svelte-kit sync
added 183 packages, and audited 184 packages in 13s
21 packages are looking for funding
run `npm fund`for details
found 0 vulnerabilities
$ npm run lint
> my-app@0.0.1 lint
> eslint .
Oops! Something went wrong! :(
ESLint: 8.18.0
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/zizheng/Projects/my-app/.eslintrc.js from /Users/zizheng/Projects/my-app/node_modules/@eslint/eslintrc/dist/eslintrc.cjs not supported.
Instead change the require of .eslintrc.js in /Users/zizheng/Projects/my-app/node_modules/@eslint/eslintrc/dist/eslintrc.cjs to a dynamic import() which is available in all CommonJS modules.
at module.exports [as default] (/Users/zizheng/Projects/my-app/node_modules/import-fresh/index.js:32:59)
at loadJSConfigFile (/Users/zizheng/Projects/my-app/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2559:47)
at loadConfigFile (/Users/zizheng/Projects/my-app/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2643:20)
at ConfigArrayFactory.loadInDirectory (/Users/zizheng/Projects/my-app/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2840:34)
at CascadingConfigArrayFactory._loadConfigInAncestors (/Users/zizheng/Projects/my-app/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3833:46)
at CascadingConfigArrayFactory.getConfigArrayForFile (/Users/zizheng/Projects/my-app/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3754:18)
at FileEnumerator._iterateFilesRecursive (/Users/zizheng/Projects/my-app/node_modules/eslint/lib/cli-engine/file-enumerator.js:446:49)
at _iterateFilesRecursive.next (<anonymous>)
at FileEnumerator.iterateFiles (/Users/zizheng/Projects/my-app/node_modules/eslint/lib/cli-engine/file-enumerator.js:297:49)
at iterateFiles.next (<anonymous>)
at CLIEngine.executeOnFiles (/Users/zizheng/Projects/my-app/node_modules/eslint/lib/cli-engine/cli-engine.js:786:48)
at ESLint.lintFiles (/Users/zizheng/Projects/my-app/node_modules/eslint/lib/eslint/eslint.js:550:23)
at Object.execute (/Users/zizheng/Projects/my-app/node_modules/eslint/lib/cli.js:301:36)
at main (/Users/zizheng/Projects/my-app/node_modules/eslint/bin/eslint.js:138:52)
at Object.<anonymous> (/Users/zizheng/Projects/my-app/node_modules/eslint/bin/eslint.js:142:2)
Describe the bug
npm run lint
ornpx eslint src
fails to run on a freshly created SvelteKit project, complaining thatError [ERR_REQUIRE_ESM]: require() of ES Module /Users/zizheng/Projects/my-app/.eslintrc.js from /Users/zizheng/Projects/my-app/node_modules/@eslint/eslintrc/dist/eslintrc.cjs not supported. ...
(see logs section for details).Reproduction
The following steps can be reproduced
Logs
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: