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

Add prettier formatter with basic configuration options #140

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

devenini
Copy link
Member

This pull request introduces an opinionated coding formatter configuration using Prettier. The biggest reason for adopting Prettier is to stop all the ongoing debates over styles and provide consistency across styles and scripts. The implementation is straightforward, requiring only periodic running of the npm run precommit command to enforce the coding style. Including Prettier in the dev dependencies also ensures that all contributors can use it regardless of their chosen IDE.

Here's the current configuration:

{
    "trailingComma": "es5",
    "tabWidth": 4,
    "useTabs": false,
    "singleQuote": true,
    "semi": false
}

Please note that we will also need to keep the .editorconfig file up-to-date and ensure that both configurations are aligned.

This pull request focuses solely on the introduction of a formatter, and does not include a linter. The naming of the branch may suggest otherwise, but adding a linter is a separate matter that will be addressed in a future pull request.

.prettierrc.json Outdated Show resolved Hide resolved
assets/scripts/utils/visibility.js Show resolved Hide resolved
Co-authored-by: Chauncey McAskill <[email protected]>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 1, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8f3034d
Status: ✅  Deploy successful!
Preview URL: https://754ba5d9.locomotive-boilerplate.pages.dev
Branch Preview URL: https://feature-add-linter-prettier.locomotive-boilerplate.pages.dev

View logs

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.

2 participants