Skip to content

Commit

Permalink
chore: Prettier formatting. Ran command. (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
purplebugs authored Jul 3, 2024
1 parent c21c0a1 commit 7a84921
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore artifacts:
public/build
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"printWidth": 80,
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": false
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ Standard build

`npm run build`

Format the code

`npm run prettier`

### Run app 🚀

`npm run start`
Expand Down
2 changes: 1 addition & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 } }),
],
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand All @@ -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": {
Expand Down
3 changes: 1 addition & 2 deletions public/element.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
h3 {
color: purple;
}

</style>
</head>
<body>
Expand All @@ -18,7 +17,7 @@ <h3 slot="header">This is the header</h3>
<h3 slot="footer">This is the footer</h3>
</alpaca-element>

<hr\>
<hr />

<script type="module" src="/build/element.js"></script>
</body>
Expand Down
9 changes: 7 additions & 2 deletions src/alpaca-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ export default class AlpacaMap extends LitElement {
// markers can only be keyboard focusable when they have click listeners
// open info window when marker is clicked
marker.addListener("click", () => {
infoWindow.setContent(farm.location.lat_lng.lat + ", " + farm.location.lat_lng.lng);
infoWindow.setContent(
farm.location.lat_lng.lat + ", " + farm.location.lat_lng.lng
);
infoWindow.open(this.map, marker);
});

Expand All @@ -145,7 +147,10 @@ export default class AlpacaMap extends LitElement {

_filterMarkers(element) {
const form = new FormData(element.target.parentElement);
console.log("element.target.parentElement.id", element.target.parentElement.id);
console.log(
"element.target.parentElement.id",
element.target.parentElement.id
);

console.log("has public", form.has("public"));
console.log("has private", form.has("private"));
Expand Down
4 changes: 3 additions & 1 deletion src/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export class AlpacaElement extends LitElement {

_title() {
// Calling this._increase without parentheses ensures it is not run on page load, but only when the h3 element is clicked
return html`<button @click="${this._increase}">Alpaca: ${this.name} - Counter: ${this.counter}</button>`;
return html`<button @click="${this._increase}">
Alpaca: ${this.name} - Counter: ${this.counter}
</button>`;
}

render() {
Expand Down

0 comments on commit 7a84921

Please sign in to comment.