Skip to content

chore(deps): update dependency prettier to v3 #178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion commands/wordle.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ module.exports = {
for (let j = 0; j < 6; j++) {
const imageNums = getAnswer(answer, guesses[j]);
for (let i = 0; i < 5; i++) {
// eslint-disable-next-line no-undef
const imageNumber = imageNums[i];
square = square_arr[imageNumber];

Expand Down
7 changes: 6 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@ export default [...compat.extends("eslint:recommended", "prettier"), {
"no-var": "error",
"object-curly-spacing": ["error", "always"],
"prefer-const": "error",
"prettier/prettier": "error",
"prettier/prettier": [
"error",
{
"endOfLine": "auto",
}
],
semi: ["error", "always"],
"space-before-blocks": "error",
"space-in-parens": "error",
Expand Down
132 changes: 63 additions & 69 deletions events/createvc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,80 +4,74 @@
// The function has 2 parts to it. The first part is that which deletes all the channels from the saved file that are deleted in the channel.
// In the second part, we delete all the temporary channels that have no user in it.

/* eslint-disable */

module.exports = {
name: "ready",
once: true,
execute(client) {
const timer = setInterval(function () {
// const temp_data = [];
// Reading data from the file
fs.readFile("./data/createvc.json", "utf-8", (err, jsonString) => {
if (err) {
console.log("Error reading file from disk:", err);
return;
} else {
// Converting the data to a dictionary
const data = JSON.parse(jsonString);

// Deleting all the channels, that should have been deleted
const b = data.channels.filter((e) => e.delete == true);
b.forEach((f) =>
data.channels.splice(
data.channels.findIndex((e) => e.delete === f.delete),
1,
),
);

fs.writeFileSync(
"./data/createvc.json",
JSON.stringify({ users: data.users, channels: data.channels }, null, 4),
);
const timer = setInterval(

Check warning on line 11 in events/createvc.js

View workflow job for this annotation

GitHub Actions / Format & lint check

'timer' is assigned a value but never used
function () {
// Reading data from the file
fs.readFile("./data/createvc.json", "utf-8", (err, jsonString) => {
if (err) {
console.log("Error reading file from disk:", err);
return;
} else {
deleteExistentChannels(client, jsonString);
}
});
// Write back to the file
},
60 * 60 * 1000,
);
},
};

// console.log(data);
function deleteExistentChannels(client, jsonString) {
// Converting the data to a dictionary
const data = JSON.parse(jsonString);

data.channels.forEach((item) => {
// item here is the channel id
if (item.delete == false) {
client.channels
.fetch(item.channel_id)
.then((channel) => {
channel
.fetch()
.then((channel) => {
if (channel.members.size == 0) {
// console.log(channel.name);
// console.log(channel.members.size);
// Deleting all the channels, that should have been deleted
const b = data.channels.filter((e) => e.delete == true);
b.forEach((f) =>
data.channels.splice(
data.channels.findIndex((e) => e.delete === f.delete),
1,
),
);

item.delete = true;
fs.writeFileSync(
"./data/createvc.json",
JSON.stringify(
{
users: data.users,
channels: data.channels,
},
null,
4,
),
);
channel
.delete()
.then(console.log)
.catch(console.error);
}
})
.catch(console.error);
})
.catch(console.error);
}
});
fs.writeFileSync(
"./data/createvc.json",
JSON.stringify({ users: data.users, channels: data.channels }, null, 4),
);

// console.log(data.channels);
}
});
// Write back to the file
}, 60 * 60 * 1000);
},
};
data.channels.forEach((item) => {
// item here is the channel id
if (item.delete == false) {
client.channels
.fetch(item.channel_id)
.then((channel) => {
channel
.fetch()
.then((vcChannel) => {
if (vcChannel.members.size == 0) {
item.delete = true;
fs.writeFileSync(
"./data/createvc.json",
JSON.stringify(
{
users: data.users,
channels: data.channels,
},
null,
4,
),
);
vcChannel.delete().then(console.log).catch(console.error);
}
})
.catch(console.error);
})
.catch(console.error);
}
});
}
1 change: 0 additions & 1 deletion events/faq_ready.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @ts-check
const { DBFaq } = require("../lib/database/faq");
/* eslint-disable */

module.exports = {
name: "ready",
Expand Down
1 change: 0 additions & 1 deletion events/reactrole_read.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { DBReactRole } = require("../lib/database/dbreactrole");
/* eslint-disable */

module.exports = {
name: "ready",
Expand Down
1 change: 0 additions & 1 deletion events/schedulepost_ready.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const { DBSchedulePost } = require("../lib/database/dbschedulepost");
/* eslint-disable */

module.exports = {
name: "ready",
Expand Down
95 changes: 74 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "",
"main": "index.js",
"scripts": {
"format": "prettier -w './**/*.js'",
"format:check": "prettier --check './**/*.js'",
"format": "prettier -w ./**/*.js",
"format:check": "prettier --check ./**/*.js",
"lint": "eslint",
"lint:fix": "eslint --fix",
"test": "echo \"Error: no test specified\" && exit 1",
Expand Down Expand Up @@ -58,9 +58,9 @@
"@eslint/js": "^9.5.0",
"eslint": "^9.5.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-prettier": "^5.0.0",
"globals": "^15.5.0",
"node-pre-gyp": "0.12.0",
"prettier": "2.7.1"
"prettier": "3.3.2"
}
}
Loading