-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Before opening a pull request, please read the [contributing guidelines](https://github.com/pancakeswap/pancake-frontend/blob/develop/CONTRIBUTING.md) first --> <!-- copilot:all --> ### <samp>🤖 Generated by Copilot at 42803aa</samp> ### Summary 🚧🔧🐛 <!-- 1. 🚧 - This emoji represents the addition of a new workflow file that checks for Typescript errors, which is a work in progress or maintenance task. 2. 🔧 - This emoji represents the addition of a new configuration file that enables strict null checks, which is a tooling or configuration change. 3. 🐛 - This emoji represents the potential fixing of bugs or errors that might be revealed by the Typescript check, which is a bug fix or improvement. --> This pull request adds a new workflow to check for Typescript errors in pull requests using strict null checks. It also adds a new `tsconfig.check.json` file to configure the Typescript check. > _`tsCheck.yml` runs_ > _on pull requests, finds errors_ > _with strict null checks_ ### Walkthrough * Add a workflow to check for Typescript errors in pull requests ([link](https://github.com/pancakeswap/pancake-frontend/pull/7851/files?diff=unified&w=0#diff-a347e684ced3a07c48e7e03c55692f1bd69af4c094a7fb599b9a1f8d41a37bb7R1-R56)) * Add a file to enable strict null checks for the Typescript check ([link](https://github.com/pancakeswap/pancake-frontend/pull/7851/files?diff=unified&w=0#diff-059feef48863d175ba6adf7839dd3da4ddb9d7de4a7b0d285bca7b3ee904e4c3R1-R6))
- Loading branch information
1 parent
92f9b2b
commit d25b6ae
Showing
11 changed files
with
100 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: 'Lint PR Title' | ||
name: Lint PR Title | ||
|
||
on: | ||
pull_request_target: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Check TS Errors | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
ts-check: | ||
name: Typescript Error Check | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up pnpm | ||
uses: pnpm/[email protected] | ||
|
||
- name: Set up node@18 | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: 'pnpm' | ||
node-version: 18 | ||
|
||
- name: Get pnpm store directory | ||
id: pnpm-cache | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
- uses: actions/cache@v3 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies | ||
run: pnpm i --ignore-scripts | ||
|
||
- name: Build package | ||
run: pnpm build:packages | ||
|
||
- name: Get diff lines | ||
id: diff | ||
uses: Equip-Collaboration/[email protected] | ||
with: | ||
include: '["\\.ts$"]' | ||
|
||
- name: Detecting files changed | ||
id: files | ||
uses: umani/[email protected] | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
pattern: '^.*\.ts$' | ||
|
||
- name: List files changed (you can remove this step, for monitoring only) | ||
run: | | ||
echo 'Changed: ${{ steps.files.outputs.changed }}' | ||
echo 'Files modified: ${{steps.files.outputs.files_updated}}' | ||
echo 'Files added: ${{steps.files.outputs.files_created}}' | ||
echo 'Files removed: ${{steps.files.outputs.files_deleted}}' | ||
- name: Check typescript errors | ||
uses: chefjackson/[email protected] | ||
if: steps.files.outputs.changed == 'true' | ||
env: | ||
NODE_OPTIONS: '--max_old_space_size=4096' | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
use-check: true | ||
check-fail-mode: errors_in_pr | ||
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: edit | ||
ts-config-path: ./apps/web/tsconfig.check.json |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"**/*.{js,jsx,ts,tsx}": [ | ||
"eslint -c .lintstaged.eslintrc", | ||
"eslint", | ||
"prettier --write" | ||
], | ||
"**/*.json": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.