Skip to content

Commit

Permalink
Update Prettier (#8420)
Browse files Browse the repository at this point in the history
* chore: fix prettier config

* chore: format

* chore(prettier): format `.astro` files
  • Loading branch information
natemoo-re authored Sep 6, 2023
1 parent 14273d8 commit c06b41a
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 50 deletions.
7 changes: 0 additions & 7 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# Ignoring these files for now due to https://github.com/withastro/compiler/issues/585
examples/basics/src/layouts
examples/with-nanostores/src/layouts

# Ignoring this file for now due to https://github.com/withastro/compiler/issues/485
packages/markdown/component/Markdown.astro

# Benchmark artifacts
benchmark/projects/
benchmark/results/
Expand Down
24 changes: 0 additions & 24 deletions .prettierrc.cjs

This file was deleted.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "root",
"type": "module",
"version": "0.0.0",
"private": true,
"repository": {
Expand All @@ -14,7 +15,7 @@
"dev": "turbo run dev --concurrency=40 --parallel --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
"format": "pnpm run format:code",
"format:ci": "pnpm run format:imports && pnpm run format:code",
"format:code": "prettier -w . --cache",
"format:code": "prettier -w \"**/*\" --ignore-unknown --cache",
"format:imports": "organize-imports-cli ./packages/*/tsconfig.json ./packages/*/*/tsconfig.json",
"test": "turbo run test --concurrency=1 --filter=astro --filter=create-astro --filter=\"@astrojs/*\"",
"test:match": "cd packages/astro && pnpm run test:match",
Expand Down Expand Up @@ -89,7 +90,7 @@
"eslint-plugin-prettier": "^5.0.0",
"only-allow": "^1.1.1",
"organize-imports-cli": "^0.10.0",
"prettier": "^3.0.2",
"prettier": "^3.0.3",
"prettier-plugin-astro": "^0.12.0",
"tiny-glob": "^0.2.9",
"turbo": "^1.10.12",
Expand Down
34 changes: 17 additions & 17 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/** @type {import("prettier").Config} */
export default {
printWidth: 100,
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5',
useTabs: true,
plugins: ['prettier-plugin-astro'],
overrides: [
{
files: ['.*', '*.json', '*.md', '*.toml', '*.yml'],
options: {
useTabs: false,
},
},
{
files: ['**/*.astro'],
options: {
parser: 'astro',
},
},
],
};

0 comments on commit c06b41a

Please sign in to comment.