Skip to content

Commit 256ccda

Browse files
authored
chore(canvas): fix errors and miscellaneous things (#1227)
* chore(canvas): Fix errors and miscellaneous things * chore: Always error on trailing spaces
1 parent cfd5ad6 commit 256ccda

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ module.exports = {
55
rules: {
66
indent: ['error', 'tab'],
77
semi: ['error', 'always'],
8+
'no-trailing-spaces': 'error',
89
},
910
};

guide/popular-topics/canvas.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,14 @@ const { request } = require('undici');
142142
client.on('interactionCreate', async interaction => {
143143
// ...
144144
context.strokeRect(0, 0, canvas.width, canvas.height);
145-
146-
// using undici to make http requests for better performance
145+
146+
// Using undici to make HTTP requests for better performance
147147
const { body } = await request(interaction.user.displayAvatarURL({ extension: 'jpg' }));
148148
const avatar = await Canvas.loadImage(await body.arrayBuffer());
149-
150-
// if you don't care about the performance of http requests, you can instead load the avatar using
149+
150+
// If you don't care about the performance of HTTP requests, you can instead load the avatar using
151151
// const avatar = await Canvas.loadImage(interaction.user.displayAvatarURL({ extension: 'jpg' }));
152-
152+
153153
// Draw a shape onto the main canvas
154154
context.drawImage(avatar, 25, 0, 200, canvas.height);
155155
// ...

0 commit comments

Comments
 (0)