Prettier Config
Install
Section titled “Install”npm install --save-dev --save-exact prettier prettier-plugin-tailwindcss-extra-plus prettier-plugin-tailwindcss prettier-plugin-organize-attributes
npm install --save-dev --save-exact prettier prettier-plugin-astro prettier-plugin-tailwindcss-extra-plus prettier-plugin-tailwindcss
.prettierrc.json
Section titled “.prettierrc.json”cat > .prettierrc.json <<EOF{ "arrowParens": "always", "bracketSameLine": true, "bracketSpacing": true, "embeddedLanguageFormatting": "auto", "endOfLine": "lf", "experimentalOperatorPosition": "end", "experimentalTernaries": false, "htmlWhitespaceSensitivity": "css", "insertPragma": false, "jsxSingleQuote": false, "objectWrap": "preserve", "printWidth": 120, "proseWrap": "preserve", "quoteProps": "as-needed", "requirePragma": false, "semi": true, "singleAttributePerLine": false, "singleQuote": true, "tabWidth": 4, "trailingComma": "all", "useTabs": false, "vueIndentScriptAndStyle": true, "plugins": ["prettier-plugin-organize-attributes", "prettier-plugin-astro", "prettier-plugin-tailwindcss-extra-plus", "prettier-plugin-tailwindcss"], "tailwindConfig": "tailwind.config.mjs", "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx", "*.mjs"], "options": { "parser": "typescript", "experimentalTernaries": true } }, { "files": ["*.handlebars", "*.hbs"], "options": { "parser": "glimmer", "singleQuote": false } }, { "files": "*.html", "options": { "embeddedLanguageFormatting": "off", "htmlWhitespaceSensitivity": "strict", "parser": "html", "printWidth": 2000, "singleAttributePerLine": true, "singleQuote": false } }, { "files": "*.md", "options": { "parser": "markdown", "jsxSingleQuote": true, "htmlWhitespaceSensitivity": "ignore", "embeddedLanguageFormatting": "auto", "vueIndentScriptAndStyle": false } }, { "files": "*.mdx", "options": { "parser": "mdx", "jsxSingleQuote": true, "htmlWhitespaceSensitivity": "css", "embeddedLanguageFormatting": "auto", "vueIndentScriptAndStyle": true } }, { "files": ["*.scss", "*.less", "*.sass", "*.css"], "options": { "parser": "scss", "printWidth": 200 } }, { "files": ["*.json", "*.jsonc"], "options": { "parser": "json", "trailingComma": "none" } }, { "files": ["*.yaml", "*.yml"], "options": { "parser": "yaml", "tabWidth": 2 } }, { "files": ["*.astro"], "options": { "parser": "astro" } }, { "files": ["*.vue"], "options": { "parser": "vue", "bracketSameLine": false, "printWidth": 80, "singleQuote": false, "tabWidth": 2, "vueIndentScriptAndStyle": false } } ]}EOF
.prettierignore
Section titled “.prettierignore”cat > .prettierignore <<EOF# Ignore artifacts:buildcoveragedistnode_modulesnode_modules/package-lock.jsonmdb-modulegruntv6-4-2package-lock.json.browserslistrc.editorconfig.eslintignore.gitignore.htmlhintrc.jsbeautifyrc.nvmrc.prettierignore.stylelintignore.gitattributes.hintrc.png*.png.webp*.webp.ico*.ico.jpg*.jpg.jpeg*.jpeg.json*.json.hbs*.hbs**/.hbs.handlebars*.handlebars.handlebars.json*.handlebars.json.min.css*.min.css.min.js*.min.js.min.css.map*.min.css.map**/.json**/.handlebars**/.handlebars.json**/.min.css**/.min.css.map
# Default Ignores**/.git**/.svn**/.hg**/node_modules**/.git**/.svn**/.hg**/.min.css**/.min.js**/.handlebars.json**/.json
# Ignore all of the following files:**/*.json**/*.eslintrc**/*.prettierrc.stylelintrc**/*.json**/*.handlebars**/*.handlebars.json**/*.min.css**/*.min.css.map**/*.min.jsEOF