eslint-plugin-svelte3
eslint-plugin-svelte3 copied to clipboard
Cannot set svelte3/ignore-styles to true when using eslintrc.json
In my project, we use the JSON config for ESLint and using it seems impossible to set svelte3/ignore-styles
to true.
"settings": {
"svelte3/ignore-styles": true
}
Gives me:
TypeError: processor_options.ignore_styles is not a function
From looking at the code, it seems that an assumption is made that svelte3/ignore-styles
is always going to be a function, which clearly is impossible to specify using JSON config (eslintrc.json).
This was an intentional change in version 2. I understand that ESLint themselves are encouraging people to write CommonJS-formatted .eslintrc.js
files, and requiring these to be functions is one less thing to worry about. But I can see how it would be annoying to be forced to convert to a CommonJS format just for this.
Thanks for clarifying that. Yes, it was an annoyance to convert from JSON to JS eslintrc but at least it was a one-off.