Skip to content

Commit

Permalink
Add typechecking
Browse files Browse the repository at this point in the history
  • Loading branch information
win0err committed Jul 15, 2024
1 parent a5b6848 commit b2f9ced
Show file tree
Hide file tree
Showing 18 changed files with 3,671 additions and 189 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install NPM dependencies
run: npm install
- name: Lint code
run: npm install && npm run test:lint
run: npm run test:lint
- name: Typecheck
run: npm run test:typecheck
- name: Check that the translation files have been updated
run: |
make --always-make translations
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ build/
dist/
.idea/
.vscode/
@types/
@types/generated/
node_modules/
yarn.lock
package-lock.json
docs-lock.json
src/schemas/gschemas.compiled
po/*~
Expand Down
8 changes: 0 additions & 8 deletions .ts-for-girrc.json

This file was deleted.

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ To create a new translation file, use the following command: \

You need to install project JS dependencies first: `npm i`

- `npm run types:generate` — generate type definition for GJS environment;
- `npm run test` — run all available tests;
- `npm run test:typecheck` — check types;
- `npm run test:lint` — lint project files.

## macOS version
Expand Down
32 changes: 12 additions & 20 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
{
"compilerOptions": {
"target": "ES2022",
"allowJs": true,
"noEmit": true,
"skipLibCheck": true,
"module": "ES2022",
"allowJs": true,
"checkJs": true,
"target": "ESNext",
"lib": ["ESNext"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"noUnusedLocals": true,
"noUnusedParameters": true,
"baseUrl": ".",
"paths": {
"gi://Adw": ["@types/adw-1.d.ts"],
"gi://Gtk": ["@types/gtk-4.0.d.ts"],
"gi://GLib": ["@types/glib-2.0.d.ts"],
"gi://Gio": ["@types/gio-2.0.d.ts"],
"gi://Shell": ["@types/shell-12.d.ts"],
"gi://St": ["@types/st-12.d.ts"],
"gi://Gdk": ["@types/gdk-4.0.d.ts"],
"gi://GObject": ["@types/gobject-2.0.d.ts"]
},
"rootDirs": ["src"]
"rootDirs": ["src"],
"noImplicitAny": true
},
"include": [
"src/**/*",
"@types/gjs.d.ts",
"@types/dom.d.ts"
]
"include": ["./typings/*.d.ts", "./src/**/*"],
"files": ["./src/extension.js", "./src/prefs.js"]
}
Loading

0 comments on commit b2f9ced

Please sign in to comment.