ts-standard icon indicating copy to clipboard operation
ts-standard copied to clipboard

Making ts-standard easier to use

Open theoludwig opened this issue 4 years ago • 4 comments

I was going through the issues of standard in the original repo, and I saw that issue : https://github.com/standard/standard/issues/1356

What problem do you want to solve?

I feel like ts-standard should follow the principles/rules as close as possible of standard.

What do you think is the correct solution to this problem?

  • Build in snazzy so users can do ts-standard --report=snazzy and get pretty output maybe we can add package.json options as well. Also, in the standard issue, they're talking about standard-json and standard-tap.

  • Build-in prettier would be awesome, maybe if we do ts-standard --format, it automatically runs prettier + ts-standard --fix. prettier also runs in .md, .json, .yaml, .css files etc. not only in .js or .ts

    I see that this project is using this script in package.json : "lint": "prettier --write '**/*.{ts*,js*,yml}' && bin/cmd.js --fix && tsc --noEmit"

    and this prettier configuration :

    "prettier": {
      "singleQuote": true,
      "semi": false
    }
    

    What if we would not need to do all these configurations ourselves and ts-standard will do it for us ?

Are you willing to submit a pull request to implement this change?

Yes of couse!

theoludwig avatar Nov 11 '20 13:11 theoludwig

Any thoughts ? @toddbluhm

theoludwig avatar Nov 19 '20 20:11 theoludwig

@Divlo Thanks for the feedback. Initially, my goal for this package was to mimick standard as close as possible and keep feature parity with standard. However, your right, it looks like @feross is trying to improve the ease of use of standard

I'd say go for it! It might be cool to have this package be a test-bed for new standard features.

Make sure all new features are behind some sort of flag and opt-in only. All existing standard flags should continue to perform exactly like the regular standard that way we maintain full parity/backward compatibility with it.

toddbluhm avatar Nov 19 '20 23:11 toddbluhm

Alright, I will try to open a pull request to add the --format flag to the CLI. :+1:

I just cloned the repo but when I run npm run lint, I've got errors thrown by tsc --noEmit command, so I will first open a PR (see #104) to update dependencies and try to fix this issue, maybe once this is fixed, we could release the v10 release (also there is no standard organization on npm) before adding --format flag.

theoludwig avatar Nov 20 '20 11:11 theoludwig

also there is no standard organization on npm

Our organization on npm is called standardjs because standard is being used by someone with private packages.

If you're keen to work on these issues, I'd love to solve it in standard-engine (where that makes sense) so that all downstream packages like standard, semistandard, ts-standard, etc. benefit and maybe we can close https://github.com/standard/standard/issues/1356 at the same time!

feross avatar Nov 23 '20 02:11 feross