I would describe a significant number of ESLint rules as primarily passive-aggressive.
I never want to see no-explicit-any enabled. If I use `any` it’s because I have a good reason. It’s obvious that something unsafe is happening! I used the keyword that makes unsafe things happen! Putting an eslint-ignore above it is redundant. The best explanation I have for why someone might enable this rule is that they want to annoy other devs who they feel are over-using unsafe patterns, but don’t want to engage in a productive conversation about this.
Want to know a great rule? no-unsafe-type-assertion. Sometimes `as` is safe and sometimes it is not. This is exactly when it should be required to add a comment, drawing attention to unsafety when it might slip by unnoticed.
ESLint configurations should assume good intent. I want rules that make invisible problems visible, not rules which nag other devs for not writing code in my exact style. Approximating a neutral third party via a blessed tool configuration is not a substitute for healthy communication.
#eslint #TypeScript