diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..284ef2f --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +# Ignore artifacts: +public/build \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..e776df4 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,7 @@ +{ + "printWidth": 80, + "trailingComma": "es5", + "tabWidth": 2, + "semi": true, + "singleQuote": false +} diff --git a/README.md b/README.md index 87ce2e0..6bac458 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,10 @@ Standard build `npm run build` +Format the code + +`npm run prettier` + ### Run app 🚀 `npm run start` diff --git a/build.js b/build.js index 3833a14..2d4ef3c 100644 --- a/build.js +++ b/build.js @@ -11,7 +11,7 @@ const inputOptions = { rollupPluginCommonjs({ include: /node_modules/ }), rollupPluginReplace({ "process.env.NODE_ENV": JSON.stringify("production"), - "preventAssignment": true, + preventAssignment: true, }), rollupPluginTerser({ format: { comments: false } }), ], diff --git a/package.json b/package.json index 9b8520f..756e863 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "scripts": { "build:watch": "node --watch-path=./src build.js", "build": "node build.js", + "prettier": "prettier . --write", "start": "node dev-server.js" }, "author": "", @@ -18,6 +19,7 @@ "@rollup/plugin-replace": "5.0.7", "@rollup/plugin-terser": "0.4.4", "fastify": "4.28.0", + "prettier": "3.3.2", "rollup": "4.18.0" }, "dependencies": { diff --git a/public/element.html b/public/element.html index 33b943f..8da4051 100644 --- a/public/element.html +++ b/public/element.html @@ -5,7 +5,6 @@ h3 { color: purple; } -
@@ -18,7 +17,7 @@