Skip to content

Commit 10d1085

Browse files
committed
Fix biome lint errors
Signed-off-by: Sora Morimoto <[email protected]>
1 parent 3a04e6e commit 10d1085

File tree

10 files changed

+90
-95
lines changed

10 files changed

+90
-95
lines changed

.eleventy.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
module.exports = function (eleventyConfig) {
2-
eleventyConfig.addPassthroughCopy('assets');
3-
eleventyConfig.addPassthroughCopy('favicon*');
1+
module.exports = (eleventyConfig) => {
2+
eleventyConfig.addPassthroughCopy("assets");
3+
eleventyConfig.addPassthroughCopy("favicon*");
44
return {
55
dir: {
6-
input: './', // Equivalent to Jekyll's source property
7-
output: './_site', // Equivalent to Jekyll's destination property
8-
layouts: './_layouts',
6+
input: "./", // Equivalent to Jekyll's source property
7+
output: "./_site", // Equivalent to Jekyll's destination property
8+
layouts: "./_layouts",
99
},
1010
};
1111
};

_data/octicons.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const octicons = require('@primer/octicons');
1+
const octicons = require("@primer/octicons");
22

33
// @ts-check
44
module.exports = {
5-
commentDiscussion: octicons['comment-discussion'].heights[16].path,
6-
markGithub: octicons['mark-github'].heights[16].path,
5+
commentDiscussion: octicons["comment-discussion"].heights[16].path,
6+
markGithub: octicons["mark-github"].heights[16].path,
77
};

_data/stages.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const EleventyFetch = require('@11ty/eleventy-fetch');
1+
const EleventyFetch = require("@11ty/eleventy-fetch");
22

33
function arrayEquals(a, b) {
44
return (
@@ -9,10 +9,10 @@ function arrayEquals(a, b) {
99
);
1010
}
1111

12-
module.exports = async function () {
13-
let json = await EleventyFetch('https://tc39.es/dataset/proposals.json', {
14-
duration: '1h', // 1 day
15-
type: 'json', // also supports "text" or "buffer"
12+
module.exports = async () => {
13+
const json = await EleventyFetch("https://tc39.es/dataset/proposals.json", {
14+
duration: "1h", // 1 day
15+
type: "json", // also supports "text" or "buffer"
1616
});
1717

1818
const stage3 = json.filter((v) => v.stage === 3);

assets/js/main.js

Lines changed: 40 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,83 @@
1-
'use strict';
2-
31
function openMenu(menu) {
4-
menu.style.maxHeight = menu.scrollHeight + 'px';
5-
setTimeout(function () {
6-
menu.style.maxHeight = 'none';
2+
menu.style.maxHeight = `${menu.scrollHeight}px`;
3+
setTimeout(() => {
4+
menu.style.maxHeight = "none";
75
}, 600);
86
}
97

108
function closeMenu(menu) {
11-
menu.style.maxHeight = menu.scrollHeight + 'px';
12-
setTimeout(function () {
13-
menu.style.maxHeight = '';
9+
menu.style.maxHeight = `${menu.scrollHeight}px`;
10+
setTimeout(() => {
11+
menu.style.maxHeight = "";
1412
}, 0);
1513
}
1614

17-
function toggleMenu(menu) {
18-
menu = menu || document.querySelector('#menu');
19-
var maxHeight = menu.style.maxHeight;
15+
function toggleMenu(menu = document.querySelector("#menu")) {
16+
const maxHeight = menu.style.maxHeight;
2017
maxHeight ? closeMenu(menu) : openMenu(menu);
21-
menu.classList.toggle('open');
18+
menu.classList.toggle("open");
2219
}
2320

2421
function toggleProposal(item) {
25-
var content = item.querySelector('.featurelist__item__info');
26-
var maxHeight = content.style.maxHeight;
27-
content.style.maxHeight = maxHeight ? '' : content.scrollHeight + 'px';
28-
content.setAttribute('aria-hidden', !!maxHeight);
22+
const content = item.querySelector(".featurelist__item__info");
23+
const maxHeight = content.style.maxHeight;
24+
content.style.maxHeight = maxHeight ? "" : `${content.scrollHeight}px`;
25+
content.setAttribute("aria-hidden", !!maxHeight);
2926
if (maxHeight) {
30-
content.setAttribute('tabindex', '-1');
27+
content.setAttribute("tabindex", "-1");
3128
} else {
32-
content.removeAttribute('tabindex');
29+
content.removeAttribute("tabindex");
3330
}
34-
item.classList.toggle('open');
31+
item.classList.toggle("open");
3532
}
3633

3734
/**
3835
* Represents the start of this application
3936
*/
4037
function start() {
41-
var items = document.querySelectorAll(
42-
'.featurelist__item .featurelist__item__example'
38+
const items = document.querySelectorAll(
39+
".featurelist__item .featurelist__item__example",
4340
);
4441

45-
document.body.classList.remove('no-js');
42+
document.body.classList.remove("no-js");
4643

47-
items.forEach(function (v) {
48-
v.addEventListener('click', function () {
44+
for (const item of items) {
45+
item.addEventListener("click", () => {
4946
toggleProposal(this.parentNode);
5047
});
51-
v.addEventListener('keypress', function (ev) {
52-
if (ev.key === 'Enter' || ev.key === ' ') {
48+
item.addEventListener("keypress", (ev) => {
49+
if (ev.key === "Enter" || ev.key === " ") {
5350
ev.preventDefault();
5451
toggleProposal(this.parentNode);
5552
}
5653
});
57-
});
54+
}
5855

59-
document
60-
.querySelector('.menu-toggle')
61-
.addEventListener('click', function (ev) {
62-
ev.preventDefault();
63-
toggleMenu();
64-
});
56+
document.querySelector(".menu-toggle").addEventListener("click", (ev) => {
57+
ev.preventDefault();
58+
toggleMenu();
59+
});
6560

66-
document.querySelectorAll('.menu-link').forEach(function (link) {
67-
var submenu = link.parentNode.querySelector('.submenu');
61+
for (const link of document.querySelectorAll(".menu-link")) {
62+
const submenu = link.parentNode.querySelector(".submenu");
6863
if (submenu) {
69-
link.addEventListener('click', function (ev) {
70-
var t = link.parentNode.querySelector('.submenu-toggle');
64+
link.addEventListener("click", (ev) => {
65+
const t = link.parentNode.querySelector(".submenu-toggle");
7166
ev.preventDefault();
7267
toggleMenu(submenu);
73-
t.classList.toggle('open');
68+
t.classList.toggle("open");
7469
});
7570
}
76-
});
71+
}
7772

78-
document.querySelectorAll('.submenu-toggle').forEach(function (toggle) {
79-
toggle.addEventListener('click', function (ev) {
80-
var t = ev.target;
81-
var submenu = t.parentNode.querySelector('.submenu');
73+
for (const toggle of document.querySelectorAll(".submenu-toggle")) {
74+
toggle.addEventListener("click", (ev) => {
75+
const t = ev.target;
76+
const submenu = t.parentNode.querySelector(".submenu");
8277
toggleMenu(submenu);
83-
t.classList.toggle('open');
78+
t.classList.toggle("open");
8479
});
85-
});
80+
}
8681
}
8782

8883
start();

de/de.11tydata.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module.exports = {
2-
intro: require('./intro.json'),
3-
proposals: require('./proposals.json'),
4-
site: require('./site.json'),
5-
stage3: require('./stage3.json'),
6-
locale: 'de',
7-
lang: 'de',
2+
intro: require("./intro.json"),
3+
proposals: require("./proposals.json"),
4+
site: require("./site.json"),
5+
stage3: require("./stage3.json"),
6+
locale: "de",
7+
lang: "de",
88
};

en/en.11tydata.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module.exports = {
2-
intro: require('./intro.json'),
3-
proposals: require('./proposals.json'),
4-
site: require('./site.json'),
5-
stage3: require('./stage3.json'),
6-
locale: 'en',
7-
lang: 'en',
2+
intro: require("./intro.json"),
3+
proposals: require("./proposals.json"),
4+
site: require("./site.json"),
5+
stage3: require("./stage3.json"),
6+
locale: "en",
7+
lang: "en",
88
};

fr/fr.11tydata.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module.exports = {
2-
intro: require('./intro.json'),
3-
proposals: require('./proposals.json'),
4-
site: require('./site.json'),
5-
stage3: require('./stage3.json'),
6-
locale: 'fr',
7-
lang: 'fr',
2+
intro: require("./intro.json"),
3+
proposals: require("./proposals.json"),
4+
site: require("./site.json"),
5+
stage3: require("./stage3.json"),
6+
locale: "fr",
7+
lang: "fr",
88
};

ja/ja.11tydata.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module.exports = {
2-
intro: require('./intro.json'),
3-
proposals: require('./proposals.json'),
4-
site: require('./site.json'),
5-
stage3: require('./stage3.json'),
6-
locale: 'ja',
7-
lang: 'ja',
2+
intro: require("./intro.json"),
3+
proposals: require("./proposals.json"),
4+
site: require("./site.json"),
5+
stage3: require("./stage3.json"),
6+
locale: "ja",
7+
lang: "ja",
88
};

ru/ru.11tydata.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module.exports = {
2-
intro: require('./intro.json'),
3-
proposals: require('./proposals.json'),
4-
site: require('./site.json'),
5-
stage3: require('./stage3.json'),
6-
locale: 'ru',
7-
lang: 'ru',
2+
intro: require("./intro.json"),
3+
proposals: require("./proposals.json"),
4+
site: require("./site.json"),
5+
stage3: require("./stage3.json"),
6+
locale: "ru",
7+
lang: "ru",
88
};

zh-Hans/zh-Hans.11tydata.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module.exports = {
2-
intro: require('./intro.json'),
3-
proposals: require('./proposals.json'),
4-
site: require('./site.json'),
5-
stage3: require('./stage3.json'),
6-
locale: 'zh-Hans',
7-
lang: 'zh-Hans',
2+
intro: require("./intro.json"),
3+
proposals: require("./proposals.json"),
4+
site: require("./site.json"),
5+
stage3: require("./stage3.json"),
6+
locale: "zh-Hans",
7+
lang: "zh-Hans",
88
};

0 commit comments

Comments
 (0)