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 1 year ago • 2 comments
trafficstars

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

Deploy Preview for melodious-froyo-4871f8 ready!

Name Link
Latest commit 6538dc563b4870f073ab4bcd3eb99407c9d536ff
Latest deploy log https://app.netlify.com/sites/melodious-froyo-4871f8/deploys/6619347f38ba530007e804f8
Deploy Preview https://deploy-preview-446--melodious-froyo-4871f8.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Apr 12 '24 01:04 netlify[bot]

@jacob-8 You can customize your rules like this. Would that work for you? Or have I misunderstood your use case?

thenbe avatar May 22 '24 01:05 thenbe