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: updates code formatting configs #126

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

mahesh0618
Copy link
Collaborator

Includes following updates,

  • Format files on save
  • Look for editorconfig in the root
  • Set indent size to 2
  • Trim any whitespace characters preceding newline characters
  • Print trailing commas wherever possible in multi-line comma-separated syntactic structures

@mahesh0618 mahesh0618 requested a review from zoltan-dulac June 6, 2024 16:23
@mahesh0618 mahesh0618 self-assigned this Jun 6, 2024
@mahesh0618 mahesh0618 changed the title chore: update code formatting cofigs chore: updates code formatting configs Jun 6, 2024
.prettierrc Outdated Show resolved Hide resolved
Copy link
Collaborator

@zoltan-dulac zoltan-dulac left a comment

Choose a reason for hiding this comment

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

Let's discuss this in our next call -- I want to see how this works. It's demo time! :-)

.vscode/extensions.json Show resolved Hide resolved
Comment on lines +3 to +4
"editor.formatOnSave": true
Copy link
Collaborator

Choose a reason for hiding this comment

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

What happens when a developer tries to save a file and they don't have the prettier extension installed?

"eslint.validate": ["json"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does this line do? Is it saying to only validate the json files? Because we'd want to validate more than just json.

"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"firsttris.vscode-jest-runner",
"stylelint.vscode-stylelint",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe that stylelint is a completely separate package/dependency that we aren't using in this repo. Is this still an extension that we should be recommending?
We may also want to recommend bmewburn.vscode-intelephense-client to allow formatting and code intelligence for the PHP files.

"trailingComma": "es5",
"tabWidth": 2,
"useTabs": true,
"overrides": [
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe that the package-lock.json is created using an indentation of 2 spaces by default. Do we want to add the package-lock.json file to .prettierignore file so that it doesn't override the default formatting?

@alisonhall
Copy link
Collaborator

@mahesh0618 , when you run npm run format with your changed config settings, how many files are changed/impacted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants