chore: set up prettier
This commit is contained in:
parent
2c7a153aa5
commit
5bc7712731
4 changed files with 29 additions and 25 deletions
7
.prettierignore
Normal file
7
.prettierignore
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# someday let's think about formatting html
|
||||||
|
**/*.html
|
||||||
|
|
||||||
|
**/*.md
|
||||||
|
**/*.css
|
||||||
|
**/*.yml
|
||||||
|
**/*.yaml
|
|
@ -1,24 +0,0 @@
|
||||||
/** @type {import("@types/prettier").Options} */
|
|
||||||
module.exports = {
|
|
||||||
printWidth: 100,
|
|
||||||
semi: true,
|
|
||||||
singleQuote: true,
|
|
||||||
tabWidth: 2,
|
|
||||||
trailingComma: 'es5',
|
|
||||||
useTabs: true,
|
|
||||||
plugins: ['./node_modules/prettier-plugin-astro'],
|
|
||||||
overrides: [
|
|
||||||
{
|
|
||||||
files: '*.astro',
|
|
||||||
options: {
|
|
||||||
parser: 'astro',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
files: ['.*', '*.json', '*.md', '*.toml', '*.yml'],
|
|
||||||
options: {
|
|
||||||
useTabs: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
|
@ -25,7 +25,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "npm run dev -w demo",
|
"start": "npm run dev -w demo",
|
||||||
"dev": "npm run dev -w demo",
|
"dev": "npm run dev -w demo",
|
||||||
"format": "prettier -w .",
|
"format": "prettier . --write",
|
||||||
"lint": "eslint . --config eslint.config.mjs",
|
"lint": "eslint . --config eslint.config.mjs",
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"demo": "npm run dev -w demo",
|
"demo": "npm run dev -w demo",
|
||||||
|
|
21
prettier.config.mjs
Normal file
21
prettier.config.mjs
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
/**
|
||||||
|
* @see https://prettier.io/docs/en/configuration.html
|
||||||
|
* @type {import("prettier").Config}
|
||||||
|
*/
|
||||||
|
const config = {
|
||||||
|
trailingComma: 'es5',
|
||||||
|
tabWidth: 2,
|
||||||
|
semi: false,
|
||||||
|
singleQuote: true,
|
||||||
|
plugins: ['prettier-plugin-astro'],
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: '*.astro',
|
||||||
|
options: {
|
||||||
|
parser: 'astro',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
export default config
|
Loading…
Reference in a new issue