jthegedus / svelte-adapter-firebase

SvelteKit adapter for Firebase Hosting rewrites to Cloud Functions for a Svelte SSR experience
https://github.com/jthegedus/svelte-adapter-firebase
MIT License
285 stars 33 forks source link

Consider using `eslint-plugin-jsdoc` #142

Open jthegedus opened 3 years ago

jthegedus commented 3 years ago

I am sure the quality of the JSDoc could be improved. We should investigate using this eslint plugin to help:

jthegedus commented 3 years ago

Got this error :shrug:

svelte-adapter-firebase on  main [$!] is 📦 v0.12.0 via ⬢ v14.17.5 took 3s 
➜ pnpm add -D eslint-plugin-jsdoc
 WARN  eslint-plugin-jsdoc@36.1.0 requires a peer of eslint@^6.0.0 || ^7.0.0 but none was installed.
 WARN  @sveltejs/kit > @sveltejs/vite-plugin-svelte: svelte-hmr@0.14.7 requires a peer of svelte@>=3.19.0 but none was installed.
 WARN  @sveltejs/kit: @sveltejs/vite-plugin-svelte@1.0.0-next.24 requires a peer of svelte@^3.34.0 but none was installed.
 WARN  @sveltejs/kit@1.0.0-next.168 requires a peer of svelte@^3.39.0 but none was installed.
 WARN  firebase-functions@3.15.5 requires a peer of firebase-admin@^8.0.0 || ^9.0.0 but none was installed.
 WARN  1 other warnings
Packages: +5
+++++
Progress: resolved 198, reused 193, downloaded 5, added 5, done

devDependencies:
+ eslint-plugin-jsdoc 36.1.0
svelte-adapter-firebase on  main [$!] is 📦 v0.12.0 via ⬢ v14.17.5 took 4s 
➜ pnpm run test

> svelte-adapter-firebase@0.12.0 test /home/jthegedus/projects/svelte-adapter-firebase
> xo && uvu tests/unit

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/jthegedus/projects/svelte-adapter-firebase/node_modules/.pnpm/array-union@3.0.1/node_modules/array-union/index.js
require() of ES modules is not supported.
require() of /home/jthegedus/projects/svelte-adapter-firebase/node_modules/.pnpm/array-union@3.0.1/node_modules/array-union/index.js from /home/jthegedus/projects/svelte-adapter-firebase/node_modules/.pnpm/@typescript-eslint+typescript-estree@4.31.1_typescript@4.4.3/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename /home/jthegedus/projects/svelte-adapter-firebase/node_modules/.pnpm/array-union@3.0.1/node_modules/array-union/index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/jthegedus/projects/svelte-adapter-firebase/node_modules/.pnpm/array-union@3.0.1/node_modules/array-union/package.json.

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1089:13)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/home/jthegedus/projects/svelte-adapter-firebase/node_modules/.pnpm/@typescript-eslint+typescript-estree@4.31.1_typescript@4.4.3/node_modules/@typescript-eslint/typescript-estree/node_modules/globby/index.js:3:20)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
 ERROR  Test failed. See above for more details.