eslint-config icon indicating copy to clipboard operation
eslint-config copied to clipboard

docs: add clarification on stylistic overrides and Svelte overrides

Open jacob-8 opened this issue 10 months ago • 2 comments

Description

Adds a little instruction on how to apply overrides. These are things I had to figure out the hard way and hopefully can save the next guy some time by these tips.

Feel free to ignore these tips if they bloat the readme, but it's just what would have helped me out. :)

On the note of the stylistic overrides, I first used the stylistic function to provide overrides, but that bit me when style/spaced-comment was now also applied to yaml files instead of being overwritten by the yaml specific version. Thank goodness for the config inspector 😁.

image

On the note of Svelte, I personally don't think a simple svelte: true is usable at all. I have about 18 overrides. Some of them are preferences and nice things, but others are required just to make things work for Svelte, because there are some general rules that conflict. For example no-self-assign clashes with the way you must reassign an array to itself to get reactivity updates (this is going away in Svelte 5, but exists until then).

Note that I use two extensions for Svelte files because of Kitbook compositions. I obviously didn't put the extra extension in my example here but I believe for Typescript to apply to the Svelte script block it needs done as shown here. Please correct if I'm too verbose but this is what works for me.

jacob-8 avatar Apr 12 '24 01:04 jacob-8