Skip to content

💡 scaffold .vscode/settings.json with checkJS enabled when creating repository #15

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

Closed
oscard0m opened this issue Mar 7, 2021 · 8 comments
Assignees
Labels
feature New feature or request

Comments

@oscard0m
Copy link
Member

oscard0m commented Mar 7, 2021

.vscode/settings.json

{
  "js/ts.implicitProjectConfig.checkJs": true
}

Do you think it could be intereting for users? Maybe making it optional under a prompt({type: "confirm"})?

@oscard0m oscard0m added the feature New feature or request label Mar 7, 2021
@gr2m
Copy link
Member

gr2m commented Mar 7, 2021

How about we add

// @ts-check

to the first line of the script.js file (docs)? That will make it work for all editors that support it?

I also wonder if we should run the tsc --checkJs check with npx on CI, as part of the "test" step in test.yml? What do you think?

@oscard0m
Copy link
Member Author

oscard0m commented Mar 7, 2021

How about we add

// @ts-check

to the first line of the script.js file (docs)? That will make it work for all editors that support it?

I can give it a try but... this would leave responsibility to developers adding on each js file they create this comment and, with settings.json would be for every .js file by default right?

@gr2m
Copy link
Member

gr2m commented Mar 7, 2021

I can give it a try but... this would leave responsibility to developers adding on each js file they create this comment and, with settings.json would be for every .js file by default right?

yes, but that way we don't force yet another file on people, and they can enable / disable it as they like. Also not everyone is using VS Code, I don't want to add editor-specific settings. The alternative would be to add jsconfig.json, but I think I would prefer to just adding the // @ts-check for now. I think most scripts will be a single file anyway

@oscard0m
Copy link
Member Author

oscard0m commented Mar 7, 2021

Yes, you are right:
settings.json would be Specific to VS Code and we don't want to be close to it so in case we need to scaffold a configuration, would be better to be .editorconfig (if they support the js check part) or jsconfig.json


Tried in script-renovate-setup and it works fine to me so... I would say to go for this solution for the moment.

@oscard0m
Copy link
Member Author

oscard0m commented Mar 7, 2021

If you like the solution, I would create an Octoherd script to add //ts-check to script.js for already existing files in the org

image

@gr2m
Copy link
Member

gr2m commented Mar 7, 2021

Yes, let's add it to the npm init octoherd-script and create an @octoherd script that will add it to existing scripts that do not have it yet

@oscard0m
Copy link
Member Author

oscard0m commented May 11, 2021

Yes, let's add it to the npm init octoherd-script and create an @octoherd script that will add it to existing scripts that do not have it yet

Already scaffolded in #17
I would wait for a need to scaffold it for existing ones. When it really becomes a problem.

Should we close this issue? @gr2m

@gr2m
Copy link
Member

gr2m commented May 11, 2021

yeah let's close 👍🏼

@gr2m gr2m closed this as completed May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants