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

chore: remove comments in tsconfig.json #1811

Merged
merged 2 commits into from
Feb 14, 2023
Merged

Conversation

bdb2381
Copy link
Contributor

@bdb2381 bdb2381 commented Feb 2, 2023

JSON doesn't support comments. This PR removes the comments.

One downstream impact of these comments is Snyk fails to parse the JSON file. https://jsoneditoronline.org/indepth/parse/json-comments/ for some details

JSON doesn't support comments. One downstream impact of these comments is Snyk fails to parse the JSON file. 
https://jsoneditoronline.org/indepth/parse/json-comments/ for some details
@bdb2381 bdb2381 requested a review from a team as a code owner February 2, 2023 22:15
@Shinigami92
Copy link
Member

Please note that tsconfig.json is officially written in jsonc

So comments are officially allowed, based on what TypeScript allows


Theoretically we could remove these values anyway, but it might be that we would write other comments into this file anyway in a later phase for any reason

So IMO the problem is not on our side but on Snyk as they should use a jsonc / json5 parser to correctly read these kind of files

@ST-DDT ST-DDT added s: needs decision Needs team/maintainer decision p: 1-normal Nothing urgent c: infra Changes to our infrastructure or project setup labels Feb 2, 2023
@codecov
Copy link

codecov bot commented Feb 2, 2023

Codecov Report

Merging #1811 (eddff87) into next (c46c539) will increase coverage by 0.00%.
The diff coverage is n/a.

❗ Current head eddff87 differs from pull request most recent head 54462fa. Consider uploading reports for the commit 54462fa to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #1811   +/-   ##
=======================================
  Coverage   99.63%   99.64%           
=======================================
  Files        2346     2347    +1     
  Lines      235735   235755   +20     
  Branches     1141     1230   +89     
=======================================
+ Hits       234875   234908   +33     
+ Misses        838      825   -13     
  Partials       22       22           
Impacted Files Coverage Δ
src/modules/location/index.ts 98.70% <0.00%> (-0.22%) ⬇️
src/modules/string/index.ts 100.00% <0.00%> (ø)
src/locales/nl/person/index.ts 100.00% <0.00%> (ø)
src/locales/vi/person/male_first_name.ts 100.00% <0.00%> (ø)
src/locales/vi/person/female_first_name.ts 100.00% <0.00%> (ø)
src/locales/nl/person/tussenvoegsel.ts 100.00% <0.00%> (ø)
src/modules/internet/user-agent.ts 96.74% <0.00%> (+4.43%) ⬆️

@bdb2381
Copy link
Contributor Author

bdb2381 commented Feb 2, 2023

That is new learning, jsonc. Thank you for the docs. I'll review so I have a better understanding.

Agreed it is handy to have comments. And agree it is something Snyk should handle as Faker isn't the only thing Snyk fails to parse. I'll work with an AE at Snyk for it.

@xDivisionByZerox
Copy link
Member

Theoretically we could remove these values anyway, but it might be that we would write other comments into this file anyway in a later phase for any reason

I suggest explicitly setting or removing them. Even if comments are technically allowed, the one in question do not serve any purpose currently.

@ST-DDT
Copy link
Member

ST-DDT commented Feb 13, 2023

I agree with @xDivisionByZerox 's reasoning here.
These should either be activated or removed (or should have a comment why they are there).

Since @Shinigami92 added them in #651 I would like to hear his original intention with those lines and suggestions whether to enable or remove them.

@Shinigami92
Copy link
Member

Since @Shinigami92 added them in #651 I would like to hear his original intention with those lines and suggestions whether to enable or remove them.

It's exactly what the PR title is intended to say: partially activate strict mode
At the end it would be very nice to have our project fully strict (this is a ts flag that can be set to true)
But there were some issues and they can partially get solved one by one, one after another...
And at the end, erase all the partial flags and just set strict: true

@xDivisionByZerox xDivisionByZerox changed the title chore: remove comments in tsconfig.json - incorrect JSON format chore: remove comments in tsconfig.json Feb 13, 2023
@ST-DDT
Copy link
Member

ST-DDT commented Feb 13, 2023

At the end it would be very nice to have our project fully strict (this is a ts flag that can be set to true)
But there were some issues and they can partially get solved one by one, one after another...
And at the end, erase all the partial flags and just set strict: true

I created an issue for each of them:

IMO this PR is now obsolete, since we want to actually turn on those lines.
What do you think?

Copy link
Member

@xDivisionByZerox xDivisionByZerox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we can still merge this as an appreciation towards @bdb2381 for pointing out those settings.

@ST-DDT
Copy link
Member

ST-DDT commented Feb 14, 2023

Since @Shinigami92 already started working on them I think this will only cause merge conflicts.

I will close this, but thanks for bringing this to our attention.

@ST-DDT ST-DDT closed this Feb 14, 2023
@Shinigami92
Copy link
Member

On the one side, we could merge it, on the other side, it is more or less irrelevant as we wont release something just for this right now and therefore it would take month(s) anyway to land in "prod"

@ST-DDT ST-DDT reopened this Feb 14, 2023
@ST-DDT ST-DDT enabled auto-merge (squash) February 14, 2023 10:11
@ST-DDT ST-DDT merged commit f9e5ba7 into faker-js:next Feb 14, 2023
matthewmayer pushed a commit to matthewmayer/faker that referenced this pull request Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: infra Changes to our infrastructure or project setup p: 1-normal Nothing urgent s: needs decision Needs team/maintainer decision
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants