Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: generate .eslintignore when running init #521

Merged
merged 2 commits into from
Jun 9, 2020

Conversation

naseemkullah
Copy link
Contributor

@naseemkullah naseemkullah commented May 28, 2020

  • generate .eslintignore and include build/

  • add empty line at enf of generated .prettierrc.js

solves #483

solves #520

@bcoe
Copy link
Contributor

bcoe commented Jun 2, 2020

@naseemkullah speaking with my colleague @JustinBeckwith, historically we populated a default .eslintignore with some reasonable values such as:

build/
docs/

Rather than adding this into configuration, what if we were to again generate this file during initialization?

@naseemkullah
Copy link
Contributor Author

naseemkullah commented Jun 2, 2020

sgtm @bcoe

ooc is there any fundamental benefit to this approach over the other?

@bcoe
Copy link
Contributor

bcoe commented Jun 3, 2020

@naseemkullah from my perspective, there tends to be a bit of variation in the sorts of files folks want to ignore on a project by project basis. for instance, as Googlers, we have protos/ generated in a lot of our libraries.

The .eslintignore feels like it's less buried, making it clear where a consumer can easily change these rules.

@naseemkullah
Copy link
Contributor Author

Thanks @bcoe I tried implementing this but am unsure how to test locally, could you please advise?

@naseemkullah naseemkullah force-pushed the patch-1 branch 2 times, most recently from ad37a76 to 43ebd01 Compare June 3, 2020 01:48
@bcoe
Copy link
Contributor

bcoe commented Jun 3, 2020

@naseemkullah your test looks reasonable to me, to test you can go:

npm link .
gts init

and see whether the file generates as expected.

@naseemkullah
Copy link
Contributor Author

@naseemkullah your test looks reasonable to me, to test you can go:

npm link .
gts init

and see whether the file generates as expected.

Thanks @bcoe, it appears that gts was already an alias for git tag for some reason, but

npm link .
/usr/local/bin/gts init

did work and all is in order.

@naseemkullah
Copy link
Contributor Author

I took the liberty of including another small fix, the prettier config was not generating with an empty line at eof but now is.

@bcoe
Copy link
Contributor

bcoe commented Jun 3, 2020

@naseemkullah thank you for the contribution 👍

@bcoe bcoe changed the title fix: skip lint on build dir feat: generate .eslintignore when running init Jun 3, 2020
@naseemkullah
Copy link
Contributor Author

My pleasure @bcoe.

@JustinBeckwith JustinBeckwith merged commit 8bce036 into google:master Jun 9, 2020
@naseemkullah naseemkullah deleted the patch-1 branch June 9, 2020 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants