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

Update Prettier Conventions #3

Open
Tracked by #1
nathanclevenger opened this issue Oct 26, 2022 · 0 comments
Open
Tracked by #1

Update Prettier Conventions #3

nathanclevenger opened this issue Oct 26, 2022 · 0 comments
Assignees

Comments

@nathanclevenger
Copy link
Member

We need to document this better, but the standard prettier conventions we use are:

{
  "scripts": {
    "prettier": "prettier --write '**/*.{ts,js,jsx,tsx,json,md}'"
  },
  "prettier": {
    "semi": false,
    "singleQuote": true,
    "tabWidth": 2,
    "trailingComma": "es5"
  }

So, we use spaces not tabs, single quotes, and no semicolons. Additionally, if we're using a package.json file in a specific project, we'd prefer to use the prettier section in the package.json instead of the .prettierrc (and other .rc files) because we'd prefer to minimize the number of files in a project.

Additionally - we probably won't get to it for a couple more months, but for many of these services, we'd like to move away entirely from dependency on package.json and use URL-based imports (like Deno) through our own ESBuild plugin for URL imports. There will be times we still need to do continue using the package.json, specifically if we need to use node NPM libraries that also need node_compat mode in wrangler ... but then the idea will be to use a Prettier GitHub action with embedded rules instead of using NPM or Yarn

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

No branches or pull requests

2 participants