Skip to content

Commit 8305ef8

Browse files
committed
replace eslint with biome
1 parent 2066f80 commit 8305ef8

File tree

5 files changed

+45
-38
lines changed

5 files changed

+45
-38
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ repos:
3737
hooks:
3838
- id: mypy
3939
additional_dependencies: [types-all]
40-
- repo: https://github.com/pre-commit/mirrors-eslint
41-
rev: v9.0.0-alpha.0
40+
- repo: https://github.com/biomejs/pre-commit
41+
rev: v0.1.0
4242
hooks:
43-
- id: eslint
44-
args: [--fix]
43+
- id: biome-check
44+
additional_dependencies: ["@biomejs/[email protected]"]
4545
- repo: local
4646
hooks:
4747
- id: no-github-dot-git

assets/copyable.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
(function () {
1+
'use strict';
2+
3+
(() => {
24
function copyTextToClipboard(text) {
3-
var textArea = document.createElement('textarea');
5+
const textArea = document.createElement('textarea');
46
textArea.value = text;
57
textArea.style.position = 'fixed';
68
textArea.style.left = '-1';
@@ -11,17 +13,17 @@
1113
document.execCommand('copy');
1214
document.body.removeChild(textArea);
1315
}
14-
var codeBlockElements = document.getElementsByClassName('copyable');
15-
for (var i = 0; i < codeBlockElements.length; i++) {
16-
var block = codeBlockElements[i];
17-
var copyIcon = new Image(16, 16);
16+
const codeBlockElements = document.getElementsByClassName('copyable');
17+
for (let i = 0; i < codeBlockElements.length; i++) {
18+
const block = codeBlockElements[i];
19+
const copyIcon = new Image(16, 16);
1820
copyIcon.setAttribute('src', './assets/copy-icon.svg');
1921
copyIcon.setAttribute('alt', 'copy');
2022
copyIcon.setAttribute('title', 'copy to clipboard');
2123
block.insertBefore(copyIcon, block.children[0]);
22-
copyIcon.addEventListener('click', function(block) {
23-
var text = block.getElementsByTagName('pre')[0].innerText;
24+
copyIcon.addEventListener('click', (block) => {
25+
const text = block.getElementsByTagName('pre')[0].innerText;
2426
copyTextToClipboard(text);
25-
}.bind(null, block));
27+
});
2628
}
2729
})();

assets/filter_repos.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@
2222
const hookId = repoHook.dataset.id.toLowerCase();
2323
const hookTypes = repoHook.dataset.types.split(', ');
2424

25-
if (hookId.includes(id) && (type === '' || hookTypes.includes(type))) {
25+
if (
26+
hookId.includes(id) &&
27+
(type === '' || hookTypes.includes(type))
28+
) {
2629
repoHook.hidden = false;
2730
hasVisibleHooks = true;
2831
} else {
@@ -32,7 +35,8 @@
3235
}
3336

3437
repo.hidden = !hasVisibleHooks;
35-
hooks.querySelector(`h3[data-repo="${repo.dataset.repo}"]`).hidden = !hasVisibleHooks;
38+
hooks.querySelector(`h3[data-repo="${repo.dataset.repo}"]`).hidden =
39+
!hasVisibleHooks;
3640
}
3741
};
3842

biome.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.4.0/schema.json",
3+
"organizeImports": {
4+
"enabled": false
5+
},
6+
"formatter": {
7+
"indentStyle": "space",
8+
"indentWidth": 4
9+
},
10+
"javascript": {
11+
"formatter": {
12+
"quoteStyle": "single"
13+
}
14+
},
15+
"linter": {
16+
"enabled": true,
17+
"rules": {
18+
"recommended": true,
19+
"suspicious": {
20+
"noRedundantUseStrict": "off"
21+
}
22+
}
23+
}
24+
}

package.json

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,5 @@
44
"dependencies": {
55
"bootstrap": "^5.0.0",
66
"sass": "^1.32.13"
7-
},
8-
"eslintConfig": {
9-
"extends": "eslint:recommended",
10-
"rules": {
11-
"indent": [
12-
"error",
13-
4
14-
],
15-
"quotes": [
16-
"error",
17-
"single"
18-
],
19-
"semi": [
20-
"error",
21-
"always"
22-
]
23-
},
24-
"parserOptions": {
25-
"ecmaVersion": 6
26-
},
27-
"env": {
28-
"browser": true
29-
}
307
}
318
}

0 commit comments

Comments
 (0)