-
Notifications
You must be signed in to change notification settings - Fork 888
Consider JSON5 for config (e.g. trailing commas) #1721
Comments
some also suggested yaml #1598 |
I'm not a part of TSLint team, but as for me - only positive side of such feature - simplify files merge. I think YAML is better alternative to json5. |
+1 for JSON5. Great benefit for us, for example, we can split tslint.json into 'Sections' like VSCode settings file IMHO, YAML is not a goot alternative: it is not a widely used in web. |
@roman-petrov TSLint already supports comments in YAML is used in any project that uses Travis CI, Circle CI etc. |
I think this is bad practice: use json extension for format which actually isn't json. Any editor will show error for json with comments. Why just not use nodejs module for that (like eslint): module.export = {
// configuraiton here
}; Pros:
|
I would say TypeScript or JSDoc annotated JavaScript so we keep the autocomplete feature alive. |
@ikokostya JS config files are supported too. I agree that comments may be bad in JSON config only files (totally bad in other cases) but until it is optional it is OK and users want them. I think README may be updated here with more info about available configuration formats. @mohsen1 is I understand correctly - TSLint config autocomplete relies on JSON Schema. Does JSDoc provides such level of "validation"? |
TypeScript interface can be generated from JSON Schema. Something like this: import * as tslint from 'tslint';
const config: tslint.Config = {
};
export default config; |
We already How would this interact with cosmiconfig (#1071)? |
💀 It's time! 💀TSLint is being deprecated and no longer accepting pull requests for major new changes or features. See #4534. 😱 If you'd like to see this change implemented, you have two choices:
👋 It was a pleasure open sourcing with you! If you believe this message was posted here in error, please comment so we can re-open the issue! |
🤖 Beep boop! 👉 TSLint is deprecated 👈 (#4534) and you should switch to typescript-eslint! 🤖 🔒 This issue is being locked to prevent further unnecessary discussions. Thank you! 👋 |
(TSLint 3.15.1 and TypeScript 2.0.9, run via CLI & Atom, but prob not relevant.)
Hi there,
Great work on TSLint! I've been using it for a couple of months now, and it's really valuable.
A particularly nice feature is that you all allow comments in
tslint.json
. This is really useful.I just wanted to toss out: instead of stripping out those comments manually, would you all be open to considering JSON5 for achieving both that as well as other niceties?
Trailing commas would be the big one to me; that keeps tripping me up whenever I'm modifying the config. More flexible quoting would also be nice, but less of a big deal.
Big disclaimer: I'm the original author of JSON5, though others maintain it these days, and it's reasonably popular on its own. (E.g. used by Babel and React Native for their config files.)
Thanks for the consideration. Cheers.
(Edit: FYI I just made a similar request for
tsconfig.json
: microsoft/TypeScript#12242)The text was updated successfully, but these errors were encountered: