Skip to content

Commit d54269a

Browse files
committed
chore(ext): Check extension formats in Actions
Using typescript-formatter for JavaScript and js-beautify for HTML. This should be quite close to my vtsls + vscode-html-languageservice (which uses js-beautify [1]) Neovim setup, as well as VSCode out of the box. [1] https://code.visualstudio.com/docs/languages/html#_formatting
1 parent 89f31ba commit d54269a

File tree

6 files changed

+34
-2
lines changed

6 files changed

+34
-2
lines changed

.github/workflows/ci.yml

+15
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,21 @@ jobs:
3131
path: |
3232
external-editor-revived.xpi
3333
34+
format_extension:
35+
name: Format MailExtension
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: actions/setup-node@v4
40+
- name: Format
41+
shell: bash
42+
run: |
43+
pushd ./extension
44+
yarn install
45+
find . -type f -name '*.js' ! -path './node_modules/*' -exec yarn run tsfmt -r '{}' \+
46+
find . -type f -name '*.html' ! -path './node_modules/*' -exec yarn run js-beautify --replace '{}' \+
47+
git diff --exit-code
48+
3449
messaging_host:
3550
name: Build, lint, and test messaging host
3651
runs-on: ${{ matrix.os }}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
/target
22
/*.xpi
3+
/extension/node_modules
4+
/extension/yarn.lock

extension/.jsbeautifyrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"indent_size": 2,
3+
"end_with_newline": true,
4+
"wrap_line_length": 120
5+
}

extension/options/options.html

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
#temp-dir {
6363
width: 100%;
6464
}
65-
6665
</style>
6766
</head>
6867

extension/package.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,11 @@
55
"main": "background.js",
66
"author": "Frederick Zhang",
77
"license": "GPL-3.0-or-later",
8-
"private": false
8+
"private": false,
9+
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
10+
"devDependencies": {
11+
"js-beautify": "^1.15.3",
12+
"typescript": "^5.7.3",
13+
"typescript-formatter": "^7.2.2"
14+
}
915
}

extension/tsfmt.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"indentSize": 2,
3+
"newLineCharacter": "\n",
4+
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false
5+
}

0 commit comments

Comments
 (0)