i had the same issue.

In your root workspace you have a .vscode folder with a settings.json.

Add the following:

{
  "eslint.workingDirectories": [
    "./{PATH_TO_CLIENT}" // replace {PATH_TO_CLIENT} with your own path
  ]
}

related issue: create-react-app subfolder projects do not lint

Answer from Julez on Stack Overflow
🌐
GitHub
github.com › prettier › eslint-plugin-prettier › issues › 396
Failed to load plugin 'prettier' declared in '.eslintrc.js': Cannot find module 'eslint-plugin-prettier' · Issue #396 · prettier/eslint-plugin-prettier
March 3, 2021 - The plugin name is spelled incorrectly in an ESLint configuration file (e.g. .eslintrc). 2. If ESLint is installed globally, then make sure 'eslint-plugin-prettier' is installed globally as well.
Published   Mar 03, 2021
🌐
npm
npmjs.com › package › eslint-plugin-prettier
eslint-plugin-prettier - npm
For this reason, it’s recommended to turn off these rules. The plugin:prettier/recommended config does that for you. You can still use these rules together with this plugin if you want, because the bug does not occur all the time.
      » npm install eslint-plugin-prettier
    
Published   Jan 14, 2026
Version   5.5.5
Author   Teddy Katz
🌐
GitHub
github.com › prettier › prettier-atom › issues › 505
Failed to load plugin 'prettier' declared in 'CLIOptions': Cannot find module 'eslint-plugin-prettier' · Issue #505 · prettier/prettier-atom
May 15, 2019 - Failed to load plugin 'prettier' declared in 'CLIOptions': Cannot find module 'eslint-plugin-prettier'#505
Published   Jul 03, 2019
🌐
Stack Overflow
stackoverflow.com › questions › 78708497 › prettier-plugins-not-found-with-pre-commit
Prettier Plugins Not Found with Pre-Commit - Stack Overflow
You'll need to configure Prettier plugins using a dynamic resolve in a .prettierrc.js file. This file can live in your project root or a subdirectory. ... // Allow Prettier in .pre-commit-config.yaml to find plugins.
🌐
GitHub
github.com › prettier › prettier › issues › 15141
Global plugins cannot be found · Issue #15141 · prettier/prettier
July 22, 2023 - Actual behavior: [error] Cannot find package 'prettier-plugin-organize-imports' imported from /builds/{path}/noop.js Error: Job failed: exit code 1
Published   Jul 22, 2023
Find elsewhere
🌐
GitHub
github.com › xojs › xo › issues › 642
Error: Failed to load plugin 'prettier' declared in 'BaseConfig' · Issue #642 · xojs/xo
When I run yarn xo command, encounter following error message. TypeError [ERR_INVALID_ARG_VALUE]: Failed to load plugin 'prettier' declared in 'BaseConfig': The argument 'filename' must be a file URL object, file URL string, or absolute ...
Published   Dec 07, 2021
Author   younho9
🌐
GitHub
github.com › prettier › eslint-config-prettier › issues › 203
Cannot find module 'eslint-plugin-prettier' · Issue #203 · prettier/eslint-config-prettier
September 11, 2021 - It appears that eslint thinks the "prettier" plugin is related to eslint-plugin-prettier rather than eslint-config-prettier. Cannot find module 'eslint-plugin-prettier' // .eslintrc.json { "root": true, "plugins": ["@nrwl/nx", "prettier"...
Published   Sep 11, 2021
🌐
GitHub
github.com › prettier › eslint-plugin-prettier › issues › 20
Definition for rule 'prettier/prettier' was not found prettier/prettier · Issue #20 · prettier/eslint-plugin-prettier
February 15, 2017 - Everytime we start linting, it says that Definition for rule 'prettier/prettier' was not found prettier/prettier. Do we miss some dependencies for it?
Published   May 12, 2017
🌐
Drupal
drupal.org › project › gitlab_templates › issues › 3357971
ESLINT needs the eslint-plugin-prettier plugin [#3357971] | Drupal.org
October 9, 2023 - (The package "eslint-plugin-prettier" was not found when loaded as a Node module from the directory "/builds/project/scheduler/web".) It's likely that the plugin isn't installed correctly.
🌐
GitHub
github.com › prettier › prettier-vscode › issues › 3104
prettier 3.0 and prettier-vscode v10.1.0 won't load plugins · Issue #3104 · prettier/prettier-vscode
August 1, 2023 - In my project, VS Code successfully loads my Prettier config, but when I try and format a tsx file it logs an error. Visual Studio Code is on version 1.80.2. My config is as follows, and is exported as a package in a monorepo and used in the root of the monorepo (it seems to be loading successfully). export default { plugins: ["prettier-plugin-organize-imports", "prettier-plugin-tailwindcss"], tailwindFunctions: ["cva"], singleQuote: false, };
Published   Aug 01, 2023
🌐
Stack Exchange
salesforce.stackexchange.com › questions › 379000 › prettier-not-working-in-vs-code
salesforcedx - Prettier not working in VS code - Salesforce Stack Exchange
Added the path '\AppData\Roaming\npm\node_modules\prettier' to the prettier path as is mentioned in the following solution in "https://stackoverflow.com/questions/58866847/in-vs-code-im-getting-this-error-failed-to-load-module-attempted-to-load-pr".
🌐
GitHub
github.com › pnpm › pnpm › issues › 3641
Prettier can't find plugins · Issue #3641 · pnpm/pnpm
March 23, 2021 - pnpm version: 6.11.5 I had the issue with prettier-plugin-solidity, but I suspect that there is the same issue with any other plugin. I just upgraded to latest version of pnpm and the issue is still there. Code to reproduce the issue: Si...
Published   Aug 02, 2021
🌐
Reddit
reddit.com › r/neovim › how to use plugins with prettierd, null-ls and lazy.nvim?
r/neovim on Reddit: how to use plugins with prettierd, null-ls and lazy.nvim?
March 17, 2024 -

Hi,

I tried to post this in the weekly thread, but I get errors. (I assume it is due to comment length, but there is literally just an empty error)

EDIT: I have solved the issue and every time I try to post the solution (either by editing or adding a comment) I get that same empty error from reddit. for solution, see 2 comments below.

I have null-ls setup to run prettierd for html files. (that works like a charm)
Now I would like it to format html files with go templates and it does not seem pick up my prettierd config in the root of my project:

// <project_root>/.prettierrc
{
	"plugins": ["prettier-plugin-go-template"],
	"overrides": [
		{
			"files": ["*.html"],
			"options": {
				"parser": "go-template",
			},
		},
	],
}  

NullLsInfo shows prettierd is active, but not the supported list is empty.
How do I make sure that the .prettierrc is used?
I used lazy.nvim to setup null-ls see setup below.

Any help would be appreciated

return {
	"jose-elias-alvarez/null-ls.nvim", -- configure formatters & linters
	event = { "BufReadPre", "BufNewFile" },
	config = function()
		-- import null-ls plugin
		local null_ls = require("null-ls")

		local null_ls_utils = require("null-ls.utils")

		-- for conciseness
		local formatting = null_ls.builtins.formatting -- to setup formatters
		local diagnostics = null_ls.builtins.diagnostics -- to setup linters

		-- to setup format on save
		local augroup = vim.api.nvim_create_augroup("LspFormatting", {})

		-- configure null_ls
		null_ls.setup({
			-- add package.json as identifier for root (for typescript monorepos)
			root_dir = null_ls_utils.root_pattern(".null-ls-root", "Makefile", ".git", "package.json"),
			-- setup formatters & linters
			sources = {
				--  to disable file types use
				--  "formatting.prettier.with({disabled_filetypes: {}})" (see null-ls docs)
				--formatting.prettier.with({
				--	extra_filetypes = { "svelte" },
				--}), -- js/ts formatter
				formatting.prettierd.with({
					filetypes = {
						"javascript",
						"javascriptreact",
						"typescript",
						"typescriptreact",
						"vue",
						"css",
						"scss",
						"less",
						"html",
						"json",
						"jsonc",
						"yaml",
						"markdown",
						"markdown.mdx",
						"graphql",
						"handlebars",
						"gotmpl",
					},
				}),
				formatting.stylua, -- lua formatter
				formatting.gofumpt, -- golang formatter
				-- formatting.goimports, -- golang imports
				diagnostics.eslint_d.with({ -- js/ts linter
					condition = function(utils)
						return utils.root_has_file({ ".eslintrc.js", ".eslintrc.cjs" }) -- only enable if root has .eslintrc.js or .eslintrc.cjs
					end,
				}),
			},
			-- configure format on save
			on_attach = function(current_client, bufnr)
				if current_client.supports_method("textDocument/formatting") then
					vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
					vim.api.nvim_create_autocmd("BufWritePre", {
						group = augroup,
						buffer = bufnr,
						callback = function()
							vim.lsp.buf.format({
								filter = function(client)
									--  only use null-ls for formatting instead of lsp server
									return client.name == "null-ls"
								end,
								bufnr = bufnr,
							})
						end,
					})
				end
			end,
		})
	end,
}
🌐
Reddit
reddit.com › r/learnjavascript › how would i fix this eslint 9.x config?
r/learnjavascript on Reddit: How would I fix this ESLint 9.x config?
March 10, 2025 -

Hello everyone! I came back to the JS and TS ecosystem after 5 years, attracted by Tailwind and Astro, which fit my current use cases perfectly. I've been struggling with this for the past week, trying to set up tooling (in particular, linting) for my team. When I do npx eslint . --debug, I get the following error:

TypeError: Error while loading rule 'astro/missing-client-only-directive-value': Cannot read properties of undefined (reading 'isAstro')
Occurred while linting /path/to/website/.vscode/extensions.json

and if it isn't this, it's an error like this:

TypeError: Error while loading rule 'perfectionist/sort-modules': sourceCode.getAllComments is not a function or its return value is not iterable
Occurred while linting /path/to/website/README.md

I get a variation of the above two errors, sometimes on JSON files, other times on Markdown or CSS files.

Here are the steps to repro the errors I have:

  1. Run npm create astro@latest -- --install --no-git -y --template basics --add mdx,tailwind

  2. Change directory to the directory it created for the project

  3. Replace package.json with this (I know, not quite a MVP; the usage of Typescript isn't strictly necessary here for our purposes):

{
  "name": "tender-trappist",
  "type": "module",
  "version": "0.0.1",
  "scripts": {
    "dev": "astro dev",
    "build": "astro build",
    "preview": "astro preview",
    "astro": "astro",
    "prepare": "husky install",
    "lint": "eslint ."
  },
  "dependencies": {
    "@astrojs/check": "^0.9.4",
    "@astrojs/mdx": "^4.1.0",
    "@tailwindcss/vite": "^4.0.9",
    "astro": "^5.4.1",
    "tailwindcss": "^4.0.9"
  },
  "devDependencies": {
    "@eslint/css": "^0.4.0",
    "@eslint/js": "^9.21.0",
    "@eslint/json": "^0.10.0",
    "@eslint/markdown": "^6.3.0",
    "@html-eslint/eslint-plugin": "^0.35.2",
    "@html-eslint/parser": "^0.35.2",
    "@stylistic/eslint-plugin": "^4.2.0",
    "@types/eslint-plugin-jsx-a11y": "^6.10.0",
    "@typescript-eslint/parser": "^8.26.0",
    "eslint": "^9.22.0",
    "eslint-config-prettier": "^10.1.1",
    "eslint-mdx": "^3.1.5",
    "eslint-plugin-astro": "^1.3.1",
    "eslint-plugin-depend": "^0.12.0",
    "eslint-plugin-html": "^8.1.2",
    "eslint-plugin-jsx-a11y": "^6.10.2",
    "eslint-plugin-mdx": "^3.1.5",
    "eslint-plugin-no-loops": "^0.4.0",
    "eslint-plugin-perfectionist": "^4.10.1",
    "eslint-plugin-prettier": "^5.2.3",
    "eslint-plugin-unicorn": "^57.0.0",
    "globals": "^16.0.0",
    "prettier": "^3.5.3",
    "prettier-plugin-astro": "^0.14.1",
    "prettier-plugin-tailwindcss": "^0.6.11",
    "typescript": "^5.8.2",
    "typescript-eslint": "^8.26.0"
  },
  "lint-staged": {
    "*.js": "eslint --cache --fix",
    "*.ts": "eslint --cache --fix"
  }
}

then run npm install. Afterwards, add this following ESLint config:

// @ts-check

import css from "@eslint/css";
import { tailwindSyntax } from "@eslint/css/syntax";
import eslint from "@eslint/js";
import json from "@eslint/json";
import markdown from "@eslint/markdown";
import html from "@html-eslint/eslint-plugin";
import typescriptPlugin from "@typescript-eslint/eslint-plugin";
import typescriptParser from "@typescript-eslint/parser";
import eslintPluginAstro from "eslint-plugin-astro";
import * as depend from "eslint-plugin-depend";
import perfectionist from "eslint-plugin-perfectionist";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import eslintPluginUnicorn from "eslint-plugin-unicorn";
import globals from "globals";
import tseslint from "typescript-eslint";

export default tseslint.config(
  {
    ignores: ["package-lock.json", "dist/", ".astro/", "node_modules/"],
  },
  eslint.configs.recommended,
  ...[
    tseslint.configs.recommendedTypeChecked,
    tseslint.configs.stylisticTypeChecked,
  ].map((config) => ({
    ...config,
    files: ["**/*.ts"],
  })),
  depend.configs["flat/recommended"],
  eslintPluginUnicorn.configs.recommended,
  {
    rules: { "unicorn/expiring-todo-comments": "off" },
  },
  {
    files: ["**/*.md"],
    language: "markdown/gfm",
    plugins: { markdown },
    rules: {
      "markdown/fenced-code-language": "off",
      "markdown/heading-increment": "off",
      "markdown/no-missing-label-refs": "off",
    },
  },
  css.configs.recommended,
  {
    files: ["**/*.css"],
    language: "css/css",
    languageOptions: {
      customSyntax: tailwindSyntax,
      tolerant: true,
    },
  },
  {
    ...perfectionist.configs["recommended-alphabetical"],
    rules: {
      "perfectionist/sort-modules": "off",
    },
  },
  ...eslintPluginAstro.configs["flat/recommended"],
  {
    files: ["**/*.ts"],
    languageOptions: {
      parser: typescriptParser,
      parserOptions: {
        extraFileExtensions: [".astro", ".astro.ts"],
        projectService: true,
        tsconfigRootDir: import.meta.dirname,
      },
    },
    plugins: {
      "@typescript-eslint": typescriptPlugin,
    },
    rules: {
      ...typescriptPlugin.configs["recommended-type-checked"].rules,
      ...typescriptPlugin.configs["stylistic-type-checked"].rules,
    },
  },
  {
    files: ["**/*.html"],
    ...html.configs["flat/recommended"],
  },
  {
    files: ["**/*.json"],
    ignores: ["**/package-lock.json"],
    language: "json/json",
    ...json.configs.recommended,
  },
  {
    files: ["tsconfig.json", ".vscode/*.json"],
    language: "json/jsonc",
    ...json.configs.recommended,
  },
  {
    languageOptions: {
      ecmaVersion: 2022,
      globals: {
        ...globals.browser,
        ...globals.node,
      },
      sourceType: "module",
    },
  },
  {
    rules: {
      "no-irregular-whitespace": "off",
      "no-undef": "off",
    },
  },

  eslintPluginPrettierRecommended,
);

And now, when you do npx eslint ., you should see a message similar to this one:

Oops! Something went wrong! :(

ESLint: 9.22.0

TypeError: Error while loading rule 'astro/missing-client-only-directive-value': Cannot read properties of undefined (reading 'isAstro')
Occurred while linting /path/to/website/.vscode/extensions.json
    at Object.create (file:///path/to/website/node_modules/eslint-plugin-astro/lib/index.mjs:363:40)
    at createRuleListeners (/path/to/website/node_modules/eslint/lib/linter/linter.js:1006:21)
    at /path/to/website/node_modules/eslint/lib/linter/linter.js:1144:84
    at Array.forEach (<anonymous>)
    at runRules (/path/to/website/node_modules/eslint/lib/linter/linter.js:1075:34)
    at #flatVerifyWithoutProcessors (/path/to/website/node_modules/eslint/lib/linter/linter.js:2001:31)
    at Linter._verifyWithFlatConfigArrayAndWithoutProcessors (/path/to/website/node_modules/eslint/lib/linter/linter.js:2083:49)
    at Linter._verifyWithFlatConfigArray (/path/to/website/node_modules/eslint/lib/linter/linter.js:2172:21)
    at Linter.verify (/path/to/website/node_modules/eslint/lib/linter/linter.js:1626:61)
    at Linter.verifyAndFix (/path/to/website/node_modules/eslint/lib/linter/linter.js:2410:29)

It very rarely works if I reorder things in the config, but most of the time reordering results in ESLint either complaining about Markdown files or about CSS files, from a similar cause. I know there has to be a better way of doing this, so what is exactly conflicting to the point that ESLint can't see the specific JSON config (or CSS, or Markdown for that matter)? Is making ESLint flat configs just praying that the particular order of nested objects works as intended? I don't know of a more appropriate place to post this other than here (I could do it on r/javascript, but perhaps people over there might think it's tech support). Tips on how I could effectively debug ESLint configs would also be extremely appreciated, as --debug and printing the config haven't been best buddies with me (although they have helped me at times).

Thanks for your attention.