Skip to content

Commit 7767f62

Browse files
authored
fix: update eslint (#156)
1 parent 074946f commit 7767f62

File tree

48 files changed

+385
-1090
lines changed

Some content is hidden

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

48 files changed

+385
-1090
lines changed

.github/workflows/typescript.yml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
uses: actions/cache@v4
2222
with:
2323
path: .turbo
24-
key: turbo-${{ runner.os }}-${{ github.sha }}
25-
restore-keys: turbo-${{ runner.os }}-
24+
key: turbo-test-${{ runner.os }}-${{ github.sha }}
25+
restore-keys: turbo-test-${{ runner.os }}-
2626
- name: Install pnpm
2727
uses: pnpm/action-setup@v4
2828
with:
@@ -36,6 +36,38 @@ jobs:
3636
run: pnpm install --frozen-lockfile
3737
- run: pnpm run build
3838
- run: pnpm run test:ci
39+
40+
run-lint:
41+
name: Lint
42+
runs-on: ubuntu-latest
43+
timeout-minutes: 30
44+
steps:
45+
- uses: actions/checkout@v4
46+
- name: Install protobuf compiler
47+
run: sudo apt-get update && sudo apt-get install -y -qq protobuf-compiler
48+
- name: Install the Buf CLI
49+
uses: bufbuild/buf-setup-action@v1
50+
with:
51+
github_token: ${{ github.token }}
52+
- name: Cache .turbo folder
53+
uses: actions/cache@v4
54+
with:
55+
path: .turbo
56+
key: turbo-lint-${{ runner.os }}-${{ github.sha }}
57+
restore-keys: turbo-lint-${{ runner.os }}-
58+
- name: Install pnpm
59+
uses: pnpm/action-setup@v4
60+
with:
61+
run_install: false
62+
- name: Install Node.js
63+
uses: actions/setup-node@v4
64+
with:
65+
node-version-file: package.json
66+
cache: "pnpm"
67+
- name: Install npm dependencies
68+
run: pnpm install --frozen-lockfile
69+
- run: pnpm run lint
70+
3971
audit:
4072
name: Audit
4173
runs-on: ubuntu-latest

extensions/gnome-extension/.eslintrc.yml

Lines changed: 0 additions & 252 deletions
This file was deleted.

extensions/gnome-extension/build-scripts/extension.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ tasks.add(
4949

5050
try {
5151
await fs.rm("./schemas/gschemas.compiled");
52-
} catch {}
52+
} catch {
53+
// ignore
54+
}
5355

5456
await promisify(exec)("glib-compile-schemas schemas");
5557

extensions/gnome-extension/build-scripts/types.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ if (process.env.CI === undefined && !exists("./types/.glib.d.ts")) {
1111

1212
try {
1313
await fs.mkdir("./types");
14-
} catch {}
14+
} catch {
15+
// ignore
16+
}
1517

1618
// Generate a bunch of typescript headers using this handy tool!
1719

extensions/gnome-extension/build-scripts/zip.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ export class Zip {
3333

3434
try {
3535
await fs.rm(file);
36-
} catch {}
36+
} catch {
37+
// ignore
38+
}
3739

3840
await promisify(exec)(`zip '${file}' $(find -type f | sed 's/^.\\///g')`, {
3941
cwd: directory,
@@ -83,7 +85,9 @@ export class Folder {
8385
async [Zip.write_to_intermittent_directory_as](file) {
8486
try {
8587
await fs.mkdir(file);
86-
} catch {}
88+
} catch {
89+
// ignore
90+
}
8791

8892
const tasks = new TaskSet();
8993

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import globals from "globals";
2+
import pluginJs from "@eslint/js";
3+
import tseslint from "typescript-eslint";
4+
5+
6+
/** @type {import('eslint').Linter.Config[]} */
7+
export default [
8+
{files: ["**/*.{js,mjs,cjs,ts}"]},
9+
{languageOptions: { globals: {...globals.browser, ...globals.node} }},
10+
pluginJs.configs.recommended,
11+
...tseslint.configs.recommended,
12+
];

extensions/gnome-extension/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
"lint:fix": "eslint --fix src build-scripts && prettier --write src build-scripts types"
1616
},
1717
"devDependencies": {
18-
"eslint": "^9.15.0",
19-
"eslint-plugin-jsdoc": "^50.6.0",
20-
"typescript": "^5.7.2"
18+
"@eslint/js": "^9.15.0",
19+
"eslint": "9.15.0",
20+
"globals": "^15.12.0",
21+
"typescript": "^5.7.2",
22+
"typescript-eslint": "^8.16.0"
2123
},
2224
"dependencies": {
2325
"@girs/gjs": "4.0.0-beta.16",

0 commit comments

Comments
 (0)