Skip to content

Commit bbcafc5

Browse files
authored
build: configure oxfmt formatter (#266)
1 parent 56e024b commit bbcafc5

44 files changed

Lines changed: 1162 additions & 703 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,36 @@ module.exports = {
44
browser: true,
55
es6: true,
66
node: true,
7-
webextensions: true
7+
webextensions: true,
88
},
99
parser: '@typescript-eslint/parser',
1010
extends: 'standard-with-typescript',
1111
parserOptions: {
1212
sourceType: 'module',
1313
project: './tsconfig.json',
14-
extraFileExtensions: ['.svelte']
14+
extraFileExtensions: ['.svelte'],
1515
},
16-
plugins: [
17-
'svelte3',
18-
'@typescript-eslint'
19-
],
16+
plugins: ['svelte3', '@typescript-eslint'],
2017
overrides: [
2118
{
2219
files: ['*.js', 'utils/*.js'],
2320
rules: {
2421
'@typescript-eslint/no-var-requires': 'off',
25-
}
22+
},
2623
},
2724
{
2825
files: ['*.svelte'],
2926
processor: 'svelte3/svelte3',
3027
rules: {
3128
'import/first': 'off',
32-
'no-multiple-empty-lines': [
33-
'error',
34-
{ max: 2 }
35-
],
29+
'no-multiple-empty-lines': ['error', { max: 2 }],
3630
// Causes false positives with reactive and auto subscriptions
3731
'@typescript-eslint/strict-boolean-expressions': 'off',
3832
'@typescript-eslint/no-unsafe-argument': 'off',
3933
'no-sequences': 'off',
4034
'svelte/missing-declaration': 'off',
41-
}
42-
}
35+
},
36+
},
4337
],
4438
rules: {
4539
// TODO: probably want to enable some of these
@@ -49,27 +43,21 @@ module.exports = {
4943
'@typescript-eslint/no-non-null-assertion': 'off',
5044
'@typescript-eslint/no-unused-expressions': 'off',
5145

52-
'linebreak-style': [
53-
'error',
54-
'unix'
55-
],
56-
'@typescript-eslint/semi': [
57-
'error',
58-
'always'
59-
],
46+
'linebreak-style': ['error', 'unix'],
47+
'@typescript-eslint/semi': ['error', 'always'],
6048
'@typescript-eslint/no-extra-semi': 'error',
6149
'@typescript-eslint/no-unused-vars': [
6250
'error',
6351
{
6452
varsIgnorePattern: '^_',
65-
argsIgnorePattern: '^_'
66-
}
53+
argsIgnorePattern: '^_',
54+
},
6755
],
6856
'@typescript-eslint/space-before-function-paren': [
6957
'error',
7058
{
71-
named: 'never'
72-
}
59+
named: 'never',
60+
},
7361
],
7462
'@typescript-eslint/strict-boolean-expressions': [
7563
'error',
@@ -80,22 +68,22 @@ module.exports = {
8068
allowNullableBoolean: false,
8169
allowNullableString: false,
8270
allowNullableNumber: false,
83-
allowAny: true
84-
}
71+
allowAny: true,
72+
},
8573
],
8674
'@typescript-eslint/prefer-nullish-coalescing': [
8775
'error',
8876
{
8977
ignoreConditionalTests: true,
90-
ignoreMixedLogicalExpressions: false
91-
}
78+
ignoreMixedLogicalExpressions: false,
79+
},
9280
],
9381
'@typescript-eslint/member-delimiter-style': [
9482
'error',
9583
{
9684
multiline: { delimiter: 'semi', requireLast: true },
97-
singleline: { delimiter: 'comma', requireLast: false }
98-
}
85+
singleline: { delimiter: 'comma', requireLast: false },
86+
},
9987
],
10088
},
10189
settings: {

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Bug Report
22
description: File a bug report
3-
title: "[Bug]: "
4-
labels: ["bug"]
3+
title: '[Bug]: '
4+
labels: ['bug']
55
body:
66
- type: checkboxes
77
attributes:
@@ -12,7 +12,7 @@ body:
1212
required: true
1313
- label: This issue is not a matter of opinion. If it is, I will use the feature suggestion issue template.
1414
required: true
15-
- label: I have checked for a duplicate or similar issue. I made sure to check closed issues as well.
15+
- label: I have checked for a duplicate or similar issue. I made sure to check closed issues as well.
1616
required: true
1717
- label: I am still able to reproduce the issue after I reinstall the extension.
1818
required: true
@@ -25,7 +25,7 @@ body:
2525
- type: textarea
2626
attributes:
2727
label: Describe the bug
28-
description: A clear and concise description of what the bug is.
28+
description: A clear and concise description of what the bug is.
2929
placeholder: What's wrong?
3030
validations:
3131
required: true
@@ -35,12 +35,12 @@ body:
3535
description: Step-by-step instructions to reproduce the unexpected behavior
3636
placeholder: |
3737
1. Go to '...'
38-
38+
3939
2. Click on '...'
40-
40+
4141
3. Scroll down to '...'
42-
43-
4. The error looks like '...'
42+
43+
4. The error looks like '...'
4444
validations:
4545
required: true
4646
- type: textarea

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ blank_issues_enabled: false
22
contact_links:
33
- name: LiveTL Discord
44
url: https://discord.gg/BVpdvt7weG
5-
about: "Not sure how to use the extension? Not sure if something is a bug? Just want to get some simple tech support? Join our discord server and ask your burning questions in the #bug-reports channel."
5+
about: 'Not sure how to use the extension? Not sure if something is a bug? Just want to get some simple tech support? Join our discord server and ask your burning questions in the #bug-reports channel.'

.github/ISSUE_TEMPLATE/suggestion.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Feature request
22
description: Suggest an idea for HyperChat
3-
title: "[Feature]: "
4-
labels: ["enhancement"]
3+
title: '[Feature]: '
4+
labels: ['enhancement']
55
body:
66
- type: checkboxes
77
attributes:
@@ -10,7 +10,7 @@ body:
1010
options:
1111
- label: This is an issue for Hyperchat, not LiveTL. I will go to [the LiveTL repo](https://github.com/LiveTL/LiveTL) to report an issue for LiveTL.
1212
required: true
13-
- label: I have checked for a duplicate or similar issue. I made sure to check closed issues as well.
13+
- label: I have checked for a duplicate or similar issue. I made sure to check closed issues as well.
1414
required: true
1515
- label: I am not reporting a bug. If I am, I will use the bug report issue template.
1616
required: true

.github/workflows/build.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ jobs:
1919
with:
2020
node-version: '24'
2121

22-
- run: |
23-
npm ci
24-
npm run lint:check
25-
npm run build
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Lint check
26+
run: npm run lint:check
27+
28+
- name: Format check
29+
run: npm run format:check
30+
31+
- name: Build
32+
run: npm run build

.github/workflows/codeql-analysis.yml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12-
name: "CodeQL"
12+
name: 'CodeQL'
1313

1414
on:
1515
push:
16-
branches: [ main ]
16+
branches: [main]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ main ]
19+
branches: [main]
2020

2121
jobs:
2222
analyze:
@@ -30,40 +30,40 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
language: [ 'javascript' ]
33+
language: ['javascript']
3434
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
3535
# Learn more:
3636
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
3737

3838
steps:
39-
- name: Checkout repository
40-
uses: actions/checkout@v6
39+
- name: Checkout repository
40+
uses: actions/checkout@v6
4141

42-
# Initializes the CodeQL tools for scanning.
43-
- name: Initialize CodeQL
44-
uses: github/codeql-action/init@v1
45-
with:
46-
languages: ${{ matrix.language }}
47-
# If you wish to specify custom queries, you can do so here or in a config file.
48-
# By default, queries listed here will override any specified in a config file.
49-
# Prefix the list here with "+" to use these queries and those in the config file.
50-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
42+
# Initializes the CodeQL tools for scanning.
43+
- name: Initialize CodeQL
44+
uses: github/codeql-action/init@v1
45+
with:
46+
languages: ${{ matrix.language }}
47+
# If you wish to specify custom queries, you can do so here or in a config file.
48+
# By default, queries listed here will override any specified in a config file.
49+
# Prefix the list here with "+" to use these queries and those in the config file.
50+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5151

52-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
53-
# If this step fails, then you should remove it and run the build manually (see below)
54-
- name: Autobuild
55-
uses: github/codeql-action/autobuild@v1
52+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
53+
# If this step fails, then you should remove it and run the build manually (see below)
54+
- name: Autobuild
55+
uses: github/codeql-action/autobuild@v1
5656

57-
# ℹ️ Command-line programs to run using the OS shell.
58-
# 📚 https://git.io/JvXDl
57+
# ℹ️ Command-line programs to run using the OS shell.
58+
# 📚 https://git.io/JvXDl
5959

60-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
61-
# and modify them (or add more) to build your code if your project
62-
# uses a compiled language
60+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
61+
# and modify them (or add more) to build your code if your project
62+
# uses a compiled language
6363

64-
#- run: |
65-
# make bootstrap
66-
# make release
64+
#- run: |
65+
# make bootstrap
66+
# make release
6767

68-
- name: Perform CodeQL Analysis
69-
uses: github/codeql-action/analyze@v1
68+
- name: Perform CodeQL Analysis
69+
uses: github/codeql-action/analyze@v1

AGENTS.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@
4242
`src/` depends on three bare globals, declared in `src/ts/typings/vite-env.d.ts`
4343
and supplied by `vite.config.ts` for our own builds:
4444

45-
| Constant | Emitted literal | Meaning |
46-
| --- | --- | --- |
47-
| `__BROWSER__` | string — `"chrome"` / `"firefox"` | target browser |
48-
| `__VERSION__` | string — `"3.3.0"` | version written into the manifest |
49-
| `__MV__` | **number**`2` / `3` | target manifest version |
45+
| Constant | Emitted literal | Meaning |
46+
| ------------- | --------------------------------- | --------------------------------- |
47+
| `__BROWSER__` | string — `"chrome"` / `"firefox"` | target browser |
48+
| `__VERSION__` | string — `"3.3.0"` | version written into the manifest |
49+
| `__MV__` | **number**`2` / `3` | target manifest version |
5050

5151
`__MV__` is compared with strict equality (`__MV__ === 2`), so it must emit a
5252
**number literal**. Defining it as the string `"2"` makes every check silently

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@
77
[![Commit Activity](https://img.shields.io/github/commit-activity/w/LiveTL/HyperChat)](https://github.com/LiveTL/HyperChat/commits/)
88
[![Discord](https://img.shields.io/discord/780938154437640232.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/uJrV3tmthg)
99

10-
1110
## Install
1211

1312
HyperChat is available in the Chrome and Firefox stores.
1413

1514
See https://livetl.app/hyperchat/install
1615

17-
1816
## Building from Source
1917

2018
### Build targets

docs/YOUTUBE_ACTIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ YouTube reorders context menu items. Never assume "block is item 3".
5454
Instead:
5555

5656
- request `get_item_context_menu`
57-
- search the response tree for endpoint *types*
57+
- search the response tree for endpoint _types_
5858
- prefer endpoint/type checks over label checks
5959

6060
Examples:

oxfmt.config.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { defineConfig } from 'oxfmt';
2+
3+
export default defineConfig({
4+
singleQuote: true,
5+
tabWidth: 2,
6+
printWidth: 120,
7+
experimentalSortImports: {
8+
enabled: true,
9+
groups: [['side_effect'], ['builtin'], ['external'], ['subpath', 'internal'], ['parent'], ['sibling']],
10+
},
11+
jsdoc: {
12+
preferCodeFences: true,
13+
separateReturnsFromParam: true,
14+
},
15+
});

0 commit comments

Comments
 (0)