Skip to content

Commit

Permalink
Chore: add CI check to run tsc on the code (#142)
Browse files Browse the repository at this point in the history
Hopefully it will work after I merge it?
  • Loading branch information
hoodmane authored May 3, 2024
1 parent 5c745f6 commit 992509c
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 21 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/check_ts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: check-ts
on:
pull_request:
permissions: write-all

jobs:
ts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get diff lines
id: diff
uses: Equip-Collaboration/diff-line-numbers@v1.0.0
with:
include: '["\\.ts$"]'
- name: Detecting files changed
id: files
uses: umani/changed-files@v4.0.0
with:
repo-token: ${{ github.token }}
pattern: '^.*\.ts$'
- name: List files changed (you can remove this step, for monitoring only)
run: |
echo 'Files modified: ${{steps.files.outputs.files_updated}}'
echo 'Files added: ${{steps.files.outputs.files_created}}'
echo 'Files removed: ${{steps.files.outputs.files_deleted}}'
- uses: Arhia/action-check-typescript@v1.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
use-check: true
check-fail-mode: added
files-changed: ${{steps.files.outputs.files_updated}}
files-added: ${{steps.files.outputs.files_created}}
files-deleted: ${{steps.files.outputs.files_deleted}}
line-numbers: ${{steps.diff.outputs.lineNumbers}}
output-behaviour: both
comment-behaviour: new
ts-config-path: "./sphinx_js/js/tsconfig.json"
29 changes: 8 additions & 21 deletions sphinx_js/js/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,13 @@
{
"compilerOptions": {
/* Projects */
"incremental": true /* Save .tsbuildinfo files to allow for incremental compilation of projects. */,
"tsBuildInfoFile": "tsconfig.tsbuildinfo",

/* Language and Environment */
"target": "ES2022" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
/* Modules */
"module": "NodeNext" /* Specify what module code is generated. */,
"moduleResolution": "NodeNext" /* Specify how TypeScript looks up a file from a given module specifier. */,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"noEmit": true,
"allowImportingTsExtensions": true /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */,

/* Interop Constraints */
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,

/* Type Checking */
"strict": true /* Enable all strict type-checking options. */,

/* Completeness */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
"allowImportingTsExtensions": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}
}

0 comments on commit 992509c

Please sign in to comment.