You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today, I wasted a bunch of time due to a misconfiguration in a "tsconfig.json" - I accidently put paths inside of the root object instead of inside compilerOptions. This was frustrating because I should have immediately gotten a red squiggly line in VSCode to tell me that I messed up. But no red squiggly lines appeared because by default, the schema allows any arbitrary additional properties that you put in there. Frankly, I find this behavior terrible, so I made my own custom schema that is stricter.
Now, when using this schema, I properly get red squiggly lines. However, this partially solves the problem: what if I forget to put the "$schema" in a new "tsconfig.json" file? So, I realized that I need a lint rule in my standard TypeScript linting config that automatically validates that every "tsconfig.json" file has a "$schema" field.
Scope of eslint-plugin-package-json
Does it make sense to expand the scope of this plugin to also include "tsconfig.json" files? Or should this rule belong in a separate project?
The text was updated successfully, but these errors were encountered:
Great question. I think TSConfig linting should belong in its own project for now. This one is pretty single-purpose and doesn't yet have all the rules needed for that purpose (#42).
Preamble
Today, I wasted a bunch of time due to a misconfiguration in a "tsconfig.json" - I accidently put
paths
inside of the root object instead of insidecompilerOptions
. This was frustrating because I should have immediately gotten a red squiggly line in VSCode to tell me that I messed up. But no red squiggly lines appeared because by default, the schema allows any arbitrary additional properties that you put in there. Frankly, I find this behavior terrible, so I made my own custom schema that is stricter.Now, when using this schema, I properly get red squiggly lines. However, this partially solves the problem: what if I forget to put the "$schema" in a new "tsconfig.json" file? So, I realized that I need a lint rule in my standard TypeScript linting config that automatically validates that every "tsconfig.json" file has a "$schema" field.
Scope of
eslint-plugin-package-json
Does it make sense to expand the scope of this plugin to also include "tsconfig.json" files? Or should this rule belong in a separate project?
The text was updated successfully, but these errors were encountered: