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

Define workspace settings for consistent formatting for eol and tab sizes and migrate to eslint #366

Closed
ItaloBorrelli opened this issue Feb 28, 2024 · 3 comments

Comments

@ItaloBorrelli
Copy link
Contributor

If it's ok, I'd like to suggest the addition of whatever the maintainers have for their settings for formatting. I'm not sure if these are all correct or accurate to what other maintainers and developers have been using on this project, so please feel free to offer suggestions. I work on a few different projects on my machine with vscode and it'd be helpful if there were project specific settings for this project. Alternatively, we could .gitignore settings.json and offer suggested settings for our contribution guide. I might suggest the following:

{
  "files.eol": "\n",
  "[java]": {
    "editor.tabSize": 4,
    "editor.defaultFormatter": "redhat.java",
  },
  "[json]": {
    "editor.tabSize": 2,
    "editor.defaultFormatter": "esbenp.prettier-vscode",
  },
  "[ts]": {
    "editor.tabSize": 2,
    "editor.defaultFormatter": "esbenp.prettier-vscode",
  },
  "[xml]": {
    "editor.tabSize": 2,
  }
}

Ok, so, regarding the tab size, I can see that all the tabs in this project are 4 spaces, but 2 space tabs is consistent with most front end development I've seen.

Also, perhaps we could include the tab size, whether 2 or 4, in linting. Lastly in this, it might be a good opportunity to migrate to eslint.

Let me know if you have any other suggestions for this.

@ItaloBorrelli
Copy link
Contributor Author

ItaloBorrelli commented Feb 28, 2024

Also, it seems most files have \n for eol, but there's some that have \r:

❯ git ls-files | xargs grep -l $'\r'
.gitignore
.vscode/extensions.json
.vscode/tasks.json
CONTRIBUTING.md
README.md
docs/gifs/demo.gif
docs/gifs/liveLinting.gif
docs/gifs/setConfiguration.gif
docs/gifs/setVersion(lower).gif
docs/imgs/btn_bulb.png
docs/imgs/quick_fix.png
docs/imgs/set_config.png
docs/imgs/set_version.png
jdtls.ext/.mvn/wrapper/maven-wrapper.jar
jdtls.ext/com.shengchen.checkstyle.checker/pom.xml
jdtls.ext/com.shengchen.checkstyle.runner/.classpath
jdtls.ext/com.shengchen.checkstyle.runner/.project
jdtls.ext/com.shengchen.checkstyle.runner/.settings/org.eclipse.core.resources.prefs
jdtls.ext/com.shengchen.checkstyle.runner/.settings/org.eclipse.m2e.core.prefs
jdtls.ext/com.shengchen.checkstyle.runner/META-INF/MANIFEST.MF
jdtls.ext/com.shengchen.checkstyle.target/target.target
resources/icon_checkstyle.png

Edit: Obviously those png and gifs don't have crlf eols and the jar should probably be ignored too

@jdneo
Copy link
Owner

jdneo commented Feb 29, 2024

I have no strong opinion on the code styles. As long as it makes the project setup easier, it's worth to do it. Thank you for the contribution and please go ahead.

@jdneo
Copy link
Owner

jdneo commented May 7, 2024

Addressed by #367

@jdneo jdneo closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants