Disable inspection "wrong attribute value"

Hello,

I'm working with svelte files and I would like to disable this inspection (at least for .svelte file)

I didn't find this inspection in the list! Is it possible to disable it somehow?

Thank you very much

2
7 comments

I'm not sure where this error comes from... If it's HTML parser error, then it's not possible to suppress it (https://youtrack.jetbrains.com/issue/WEB-23469). I'd also suggest asking the Svelte plugin authors for advice (https://github.com/tomblachut/svelte-intellij/issues), as .svelte files processing is handled by this plugin

1

Thank you

It's strange because unlike other inspections, I didn't find this one in the list of inspections to disable it altogether

Why do you think?

Thank you

0

You didn't find it because it's not an inspection but a low-level check. Unlike inspections, such checks can't be disabled/configured

1

Now I get it, I thought it was an inspection

0
Avatar
Permanently deleted user

Tunisoft Solutions have you found a solution for this one?

0

No sorry, I didn't find any solution for it!

0

Here's a workaround for OP's original issue.  It gets rid of the "Wrong attribute value" warning.

  1. Instead of "aria-hidden", use "@aria-hidden" (or "!!aria-hidden", etc)
  2. Add "@aria-hidden" as a custom HTML tag attribute.  (Settings -> Editor -> Inspections -> HTML -> Unknown attribute -> Custom HTML tag attributes)
  3. Use Svelte Preprocess to search-replace your code from "@aria-hidden" to "aria-hidden".  Config as follows:
// svelte.config.js

import preprocess from "svelte-preprocess";
const config = {
// ...
preprocess: preprocess({
replace: [[/@aria-hidden=/g, "aria-hidden="]],
}),
// ...
};
export default config;

 

1

Please sign in to leave a comment.