-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: fixed ESlint error, added eslint-check GH workflow.
- Loading branch information
1 parent
e16173c
commit 2f9b374
Showing
6 changed files
with
45 additions
and
8 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
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,41 @@ | ||
name: Lint Code Base | ||
|
||
on: [ pull_request ] | ||
|
||
jobs: | ||
eslint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '16.4.0' | ||
|
||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Run ESLint | ||
id: eslint | ||
continue-on-error: true | ||
run: | | ||
ESLINT_OUTPUT=$(npx eslint . --ext .js,.jsx,.ts,.tsx) | ||
echo "::set-output name=result::$ESLINT_OUTPUT" | ||
if [ -z "$ESLINT_OUTPUT" ]; then | ||
echo "ESLint found no issues :white_check_mark:" | ||
echo "::set-output name=status::success" | ||
else | ||
echo "$ESLINT_OUTPUT" | ||
echo "::set-output name=status::failure" | ||
exit 1 | ||
fi | ||
- name: Success Message | ||
if: steps.eslint.outputs.status == 'success' | ||
run: echo "✅ ESLint check passed successfully!" | ||
|
||
- name: Failure Message | ||
if: failure() | ||
run: echo "❌ ESLint check failed. Please fix the issues." |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ describe('Array', function () { | |
const arr = []; | ||
expect(arr).to.be.empty; | ||
}); | ||
}); | ||
}); |