Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
sheyabernstein committed Feb 28, 2024
1 parent 613f4fc commit 4115724
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ on:

jobs:
format:
name: Format Code
name: Lint
runs-on: ubuntu-latest
if: "!contains(github.actor, 'actions-user')"

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Format Code with Prettier
- name: Lint with Prettier
uses: creyD/[email protected]
with:
prettier_options: --write --tab-width 4 **/*.{js,md}
prettier_options: --check --tab-width 4 **/*.{js,md}
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Close stale issues and PRs'
name: "Close stale issues and PRs"
on:
schedule:
- cron: "0 0 * * *"
Expand Down
6 changes: 3 additions & 3 deletions MMM-pihole-stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Module.register("MMM-pihole-stats", {
floatingPoints: 2,

retryDelay: 1000 * 30,
initialLoadDelay: 0,
initialLoadDelay: 0
},

formatInt(n) {
Expand Down Expand Up @@ -124,7 +124,7 @@ Module.register("MMM-pihole-stats", {
Log.info(`${this.name}: Getting data`);

this.sendSocketNotification("GET_PIHOLE", {
config: this.config,
config: this.config
});
},

Expand Down Expand Up @@ -172,5 +172,5 @@ Module.register("MMM-pihole-stats", {
}

this.top_sources = data.top_sources || [];
},
}
});
14 changes: 9 additions & 5 deletions node_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ module.exports = NodeHelper.create({
if (config.showSources && config.sourcesCount > 0) {
if (config.showSources && !config.apiToken) {
Log.error(
`${this.name}: Can't load sources because the apiKey is not set.`,
`${this.name}: Can't load sources because the apiKey is not set.`
);
} else {
this.getPiholeData(
config,
{ getQuerySources: config.sourcesCount },
"PIHOLE_SOURCES",
"PIHOLE_SOURCES"
);
}
}
Expand Down Expand Up @@ -77,11 +77,15 @@ module.exports = NodeHelper.create({
self.sendSocketNotification(notification, data);
} else {
Log.error(
`${this.name}: Expected JSON but received ${response.headers.get("content-type")}`,
`${
this.name
}: Expected JSON but received ${response.headers.get(
"content-type"
)}`
);
}
} catch (error) {
Log.error(`${this.name}: ${error}`),
Log.error(`${this.name}: ${error}`);
}
},
}
});
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "1.0.0",
"description": "Pi-hole stats module for MagicMirror².",
"main": "MMM-pihole-stats.js",
"scripts": {
"format": "prettier --write --tab-width 4 **/*.{js,md}"
},
"repository": {
"type": "git",
"url": "git+https://github.com/sheyabernstein/MMM-pihole-stats.git"
Expand All @@ -17,5 +20,8 @@
"bugs": {
"url": "https://github.com/sheyabernstein/MMM-pihole-stats/issues"
},
"homepage": "https://github.com/sheyabernstein/MMM-pihole-stats#readme"
"homepage": "https://github.com/sheyabernstein/MMM-pihole-stats#readme",
"devDependencies": {
"prettier": "^2.8.8"
}
}

0 comments on commit 4115724

Please sign in to comment.