eslint-plugin-svelte3 icon indicating copy to clipboard operation
eslint-plugin-svelte3 copied to clipboard

Cannot set svelte3/ignore-styles to true when using eslintrc.json

Open radarsh opened this issue 5 years ago • 2 comments

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).

radarsh avatar Oct 23 '19 14:10 radarsh

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.

Conduitry avatar Oct 23 '19 14:10 Conduitry

Thanks for clarifying that. Yes, it was an annoyance to convert from JSON to JS eslintrc but at least it was a one-off.

radarsh avatar Oct 24 '19 11:10 radarsh