Update Prettier (#8420)

* chore: fix prettier config

* chore: format

* chore(prettier): format `.astro` files
This commit is contained in:
Nate Moore 2023-09-06 10:23:44 -05:00 committed by GitHub
parent 14273d8f44
commit c06b41a6b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 44 additions and 50 deletions

View file

@ -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 artifacts
benchmark/projects/ benchmark/projects/
benchmark/results/ benchmark/results/

View file

@ -1,24 +0,0 @@
// Heads up: This file should be renamed to `.cjs`, however if we did that, changesets wouldn't be able to load it
module.exports = {
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',
},
},
],
};

View file

@ -1,5 +1,6 @@
{ {
"name": "root", "name": "root",
"type": "module",
"version": "0.0.0", "version": "0.0.0",
"private": true, "private": true,
"repository": { "repository": {
@ -14,7 +15,7 @@
"dev": "turbo run dev --concurrency=40 --parallel --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"", "dev": "turbo run dev --concurrency=40 --parallel --filter=astro --filter=create-astro --filter=\"@astrojs/*\" --filter=\"@benchmark/*\"",
"format": "pnpm run format:code", "format": "pnpm run format:code",
"format:ci": "pnpm run format:imports && 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", "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": "turbo run test --concurrency=1 --filter=astro --filter=create-astro --filter=\"@astrojs/*\"",
"test:match": "cd packages/astro && pnpm run test:match", "test:match": "cd packages/astro && pnpm run test:match",
@ -89,7 +90,7 @@
"eslint-plugin-prettier": "^5.0.0", "eslint-plugin-prettier": "^5.0.0",
"only-allow": "^1.1.1", "only-allow": "^1.1.1",
"organize-imports-cli": "^0.10.0", "organize-imports-cli": "^0.10.0",
"prettier": "^3.0.2", "prettier": "^3.0.3",
"prettier-plugin-astro": "^0.12.0", "prettier-plugin-astro": "^0.12.0",
"tiny-glob": "^0.2.9", "tiny-glob": "^0.2.9",
"turbo": "^1.10.12", "turbo": "^1.10.12",

View file

@ -20,7 +20,7 @@ importers:
devDependencies: devDependencies:
'@astrojs/check': '@astrojs/check':
specifier: ^0.1.0 specifier: ^0.1.0
version: 0.1.0(prettier-plugin-astro@0.12.0)(prettier@3.0.2)(typescript@5.1.6) version: 0.1.0(prettier-plugin-astro@0.12.0)(prettier@3.0.3)(typescript@5.1.6)
'@changesets/changelog-github': '@changesets/changelog-github':
specifier: ^0.4.8 specifier: ^0.4.8
version: 0.4.8 version: 0.4.8
@ -50,7 +50,7 @@ importers:
version: 3.1.0 version: 3.1.0
eslint-plugin-prettier: eslint-plugin-prettier:
specifier: ^5.0.0 specifier: ^5.0.0
version: 5.0.0(eslint-config-prettier@9.0.0)(eslint@8.47.0)(prettier@3.0.2) version: 5.0.0(eslint-config-prettier@9.0.0)(eslint@8.47.0)(prettier@3.0.3)
only-allow: only-allow:
specifier: ^1.1.1 specifier: ^1.1.1
version: 1.1.1 version: 1.1.1
@ -58,8 +58,8 @@ importers:
specifier: ^0.10.0 specifier: ^0.10.0
version: 0.10.0 version: 0.10.0
prettier: prettier:
specifier: ^3.0.2 specifier: ^3.0.3
version: 3.0.2 version: 3.0.3
prettier-plugin-astro: prettier-plugin-astro:
specifier: ^0.12.0 specifier: ^0.12.0
version: 0.12.0 version: 0.12.0
@ -654,7 +654,7 @@ importers:
devDependencies: devDependencies:
'@astrojs/check': '@astrojs/check':
specifier: ^0.1.0 specifier: ^0.1.0
version: 0.1.0(prettier-plugin-astro@0.12.0)(prettier@3.0.2)(typescript@5.1.6) version: 0.1.0(prettier-plugin-astro@0.12.0)(prettier@3.0.3)(typescript@5.1.6)
'@playwright/test': '@playwright/test':
specifier: ^1.37.1 specifier: ^1.37.1
version: 1.37.1 version: 1.37.1
@ -5156,13 +5156,13 @@ packages:
lite-youtube-embed: 0.2.0 lite-youtube-embed: 0.2.0
dev: false dev: false
/@astrojs/check@0.1.0(prettier-plugin-astro@0.12.0)(prettier@3.0.2)(typescript@5.1.6): /@astrojs/check@0.1.0(prettier-plugin-astro@0.12.0)(prettier@3.0.3)(typescript@5.1.6):
resolution: {integrity: sha512-tgjq+Vehgv0dwdsRlT4ai3QgT3etn8W5C4E4dvQ0Xe9ccwjKdMTWmpty5exfBtHLLAAOvwe5/OkYQsQ9OyKoVw==} resolution: {integrity: sha512-tgjq+Vehgv0dwdsRlT4ai3QgT3etn8W5C4E4dvQ0Xe9ccwjKdMTWmpty5exfBtHLLAAOvwe5/OkYQsQ9OyKoVw==}
hasBin: true hasBin: true
peerDependencies: peerDependencies:
typescript: ^5.0.0 typescript: ^5.0.0
dependencies: dependencies:
'@astrojs/language-server': 2.3.0(prettier-plugin-astro@0.12.0)(prettier@3.0.2)(typescript@5.1.6) '@astrojs/language-server': 2.3.0(prettier-plugin-astro@0.12.0)(prettier@3.0.3)(typescript@5.1.6)
chokidar: 3.5.3 chokidar: 3.5.3
fast-glob: 3.3.1 fast-glob: 3.3.1
kleur: 4.1.5 kleur: 4.1.5
@ -5193,7 +5193,7 @@ packages:
resolution: {integrity: sha512-DfBR7Cf+tOgQ4n7TIgTtU5x5SEA/08DNshpEPcT+91A0KbBlmUOYMBM/O6qAaHkmVo1KIoXQYhAmfdTT1zx9PQ==} resolution: {integrity: sha512-DfBR7Cf+tOgQ4n7TIgTtU5x5SEA/08DNshpEPcT+91A0KbBlmUOYMBM/O6qAaHkmVo1KIoXQYhAmfdTT1zx9PQ==}
dev: false dev: false
/@astrojs/language-server@2.3.0(prettier-plugin-astro@0.12.0)(prettier@3.0.2)(typescript@5.1.6): /@astrojs/language-server@2.3.0(prettier-plugin-astro@0.12.0)(prettier@3.0.3)(typescript@5.1.6):
resolution: {integrity: sha512-NFSzszjR4+f0+fTUCuFKXrLWusJFqWvHMrIzHB0lXUE8dt3Dm1Ok9Emrdj3s3BvlguJz05MV9xSIz1puMvomtQ==} resolution: {integrity: sha512-NFSzszjR4+f0+fTUCuFKXrLWusJFqWvHMrIzHB0lXUE8dt3Dm1Ok9Emrdj3s3BvlguJz05MV9xSIz1puMvomtQ==}
hasBin: true hasBin: true
peerDependencies: peerDependencies:
@ -5215,12 +5215,12 @@ packages:
'@volar/typescript': 1.10.0 '@volar/typescript': 1.10.0
fast-glob: 3.3.1 fast-glob: 3.3.1
muggle-string: 0.3.1 muggle-string: 0.3.1
prettier: 3.0.2 prettier: 3.0.3
prettier-plugin-astro: 0.12.0 prettier-plugin-astro: 0.12.0
volar-service-css: 0.0.11(@volar/language-service@1.10.0) volar-service-css: 0.0.11(@volar/language-service@1.10.0)
volar-service-emmet: 0.0.11(@volar/language-service@1.10.0) volar-service-emmet: 0.0.11(@volar/language-service@1.10.0)
volar-service-html: 0.0.11(@volar/language-service@1.10.0) volar-service-html: 0.0.11(@volar/language-service@1.10.0)
volar-service-prettier: 0.0.11(@volar/language-service@1.10.0)(prettier@3.0.2) volar-service-prettier: 0.0.11(@volar/language-service@1.10.0)(prettier@3.0.3)
volar-service-typescript: 0.0.11(@volar/language-service@1.10.0)(@volar/typescript@1.10.0) volar-service-typescript: 0.0.11(@volar/language-service@1.10.0)(@volar/typescript@1.10.0)
volar-service-typescript-twoslash-queries: 0.0.11(@volar/language-service@1.10.0) volar-service-typescript-twoslash-queries: 0.0.11(@volar/language-service@1.10.0)
vscode-html-languageservice: 5.0.6 vscode-html-languageservice: 5.0.6
@ -11262,7 +11262,7 @@ packages:
engines: {node: '>=5.0.0'} engines: {node: '>=5.0.0'}
dev: true dev: true
/eslint-plugin-prettier@5.0.0(eslint-config-prettier@9.0.0)(eslint@8.47.0)(prettier@3.0.2): /eslint-plugin-prettier@5.0.0(eslint-config-prettier@9.0.0)(eslint@8.47.0)(prettier@3.0.3):
resolution: {integrity: sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w==} resolution: {integrity: sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w==}
engines: {node: ^14.18.0 || >=16.0.0} engines: {node: ^14.18.0 || >=16.0.0}
peerDependencies: peerDependencies:
@ -11278,7 +11278,7 @@ packages:
dependencies: dependencies:
eslint: 8.47.0 eslint: 8.47.0
eslint-config-prettier: 9.0.0(eslint@8.47.0) eslint-config-prettier: 9.0.0(eslint@8.47.0)
prettier: 3.0.2 prettier: 3.0.3
prettier-linter-helpers: 1.0.0 prettier-linter-helpers: 1.0.0
synckit: 0.8.5 synckit: 0.8.5
dev: true dev: true
@ -15247,7 +15247,7 @@ packages:
engines: {node: ^14.15.0 || >=16.0.0} engines: {node: ^14.15.0 || >=16.0.0}
dependencies: dependencies:
'@astrojs/compiler': 1.8.2 '@astrojs/compiler': 1.8.2
prettier: 3.0.2 prettier: 3.0.3
sass-formatter: 0.7.7 sass-formatter: 0.7.7
dev: true dev: true
@ -15257,8 +15257,8 @@ packages:
hasBin: true hasBin: true
dev: true dev: true
/prettier@3.0.2: /prettier@3.0.3:
resolution: {integrity: sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ==} resolution: {integrity: sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==}
engines: {node: '>=14'} engines: {node: '>=14'}
hasBin: true hasBin: true
dev: true dev: true
@ -17739,7 +17739,7 @@ packages:
vscode-uri: 3.0.7 vscode-uri: 3.0.7
dev: true dev: true
/volar-service-prettier@0.0.11(@volar/language-service@1.10.0)(prettier@3.0.2): /volar-service-prettier@0.0.11(@volar/language-service@1.10.0)(prettier@3.0.3):
resolution: {integrity: sha512-A4vEU5BUitNNAySb+t/fCjEoL01uYUkoe/Fe5UxR3JJbdgr2nTeXb5IlW90/1vzmnTKZznadJV4i1SoAf2CRbg==} resolution: {integrity: sha512-A4vEU5BUitNNAySb+t/fCjEoL01uYUkoe/Fe5UxR3JJbdgr2nTeXb5IlW90/1vzmnTKZznadJV4i1SoAf2CRbg==}
peerDependencies: peerDependencies:
'@volar/language-service': ~1.10.0 '@volar/language-service': ~1.10.0
@ -17751,7 +17751,7 @@ packages:
optional: true optional: true
dependencies: dependencies:
'@volar/language-service': 1.10.0 '@volar/language-service': 1.10.0
prettier: 3.0.2 prettier: 3.0.3
dev: true dev: true
/volar-service-typescript-twoslash-queries@0.0.11(@volar/language-service@1.10.0): /volar-service-typescript-twoslash-queries@0.0.11(@volar/language-service@1.10.0):

24
prettier.config.js Normal file
View file

@ -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',
},
},
],
};