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

npm run lint causes a warning for every file: [warn] Ignored unknown option { pluginSearchDirs: ["."] }. due to Prettier #10751

Closed
jasongitmail opened this issue Sep 19, 2023 · 3 comments · Fixed by #10410

Comments

@jasongitmail
Copy link

jasongitmail commented Sep 19, 2023

Describe the bug

Running npm run lint causes this warning for every file: [warn] Ignored unknown option { pluginSearchDirs: ["."] }.

Creating noisy output.

Reproduction

  1. Using SvelteKit's default .prettierrc:
{
	"useTabs": true,
	"singleQuote": true,
	"trailingComma": "none",
	"printWidth": 100,
	"plugins": ["prettier-plugin-svelte"],
	"pluginSearchDirs": ["."],
	"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
  1. And "lint": "prettier --plugin-search-dir . --check . && eslint .",
  2. Run npm run format (You can remove eslint, it's not related to that.)

Gives output of:

[warn] Ignored unknown option { pluginSearchDirs: ["."] }.
[warn] Ignored unknown option { pluginSearchDirs: ["."] }.
[warn] Ignored unknown option { pluginSearchDirs: ["."] }.
[warn] Ignored unknown option { pluginSearchDirs: ["."] }.
[warn] Ignored unknown option { pluginSearchDirs: ["."] }.
[warn] Ignored unknown option { pluginSearchDirs: ["."] }.
[warn] Ignored unknown option { pluginSearchDirs: ["."] }.
[warn] Ignored unknown option { pluginSearchDirs: ["."] }.
[warn] Ignored unknown option { pluginSearchDirs: ["."] }.
[warn] Ignored unknown option { pluginSearchDirs: ["."] }.
[warn] Ignored unknown option { pluginSearchDirs: ["."] }.
[warn] Ignored unknown option { pluginSearchDirs: ["."] }.
[warn] Ignored unknown option { pluginSearchDirs: ["."] }.
[warn] Ignored unknown option { pluginSearchDirs: ["."] }.
[warn] Ignored unknown option { pluginSearchDirs: ["."] }.
[warn] Ignored unknown option { pluginSearchDirs: ["."] }.
[warn] Ignored unknown option { pluginSearchDirs: ["."] }.
[warn] Ignored unknown option { pluginSearchDirs: ["."] }.

Logs

No response

System Info

Binaries:
    Node: 20.4.0 - /opt/homebrew/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 9.7.2 - /opt/homebrew/bin/npm
    pnpm: 8.6.1 - /opt/homebrew/bin/pnpm
  npmPackages:
    @sveltejs/adapter-cloudflare: ^2.3.3 => 2.3.3 
    @sveltejs/kit: ^1.25.0 => 1.25.0 
    svelte: ^4.2.0 => 4.2.0 
    vite: ^4.4.9 => 4.4.9 

// package.json related
    "prettier": "^3.0.3",
    "prettier-plugin-svelte": "^3.0.3",
    "prettier-plugin-tailwindcss": "^0.5.4",
    "eslint-config-prettier": "^9.0.0",

Severity

annoyance

Additional Information

Removing "plugins": ["prettier-plugin-svelte"], fixes it.

@jasongitmail
Copy link
Author

Update: After removing the issue, it gives a single warning line of [warn] Ignored unknown option --plugin-search-dir=.. now.

This is fixed by removing --plugin-search-dir= . from the package.json commands. I'll add to my PR.

@yslpn
Copy link

yslpn commented Sep 30, 2023

same issue

up

@souvikmishra
Copy link

souvikmishra commented Oct 3, 2023

for anyone still stuck, what worked for me was that I updated prettier and all the plugins to the latest ones, removed "pluginSearchDirs": false from the prettier config and then did what this comment suggested. Link

dummdidumm pushed a commit that referenced this issue Nov 13, 2023
This will give users the new versions via create-svelte. The rest of the change is internal

closes #10751
closes #10716

---------

Co-authored-by: Tee Ming <chewteeming01@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants