-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI workflow to lint TypeScript and JavaScript code
On every push and pull request that affects relevant files, and periodically, run eslint on the repository's TypeScript and JavaScript files. eslint is configured via the .eslintrc.yml file: https://eslint.org/docs/user-guide/configuring/configuration-files
- Loading branch information
Showing
10 changed files
with
6,352 additions
and
2,154 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist | ||
lib | ||
node_modules |
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,29 @@ | ||
# See: https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/README.md#configuration | ||
|
||
extends: | ||
- airbnb-typescript/base | ||
- prettier | ||
plugins: | ||
- "@typescript-eslint" | ||
parser: "@typescript-eslint/parser" | ||
parserOptions: | ||
project: | ||
- ./tsconfig.eslint.json | ||
rules: | ||
max-len: | ||
- error | ||
- code: 180 | ||
"@typescript-eslint/comma-dangle": "off" | ||
no-console: "off" | ||
padded-blocks: "off" | ||
"@typescript-eslint/indent": | ||
- error | ||
- 2 | ||
- SwitchCase: 1 | ||
spaced-comment: warn | ||
arrow-parens: "off" | ||
consistent-return: "off" | ||
no-useless-escape: "off" | ||
no-underscore-dangle: "off" | ||
import/prefer-default-export: "off" | ||
"@typescript-eslint/type-annotation-spacing": error |
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,54 @@ | ||
name: Check TypeScript | ||
|
||
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows | ||
on: | ||
push: | ||
paths: | ||
- ".github/workflows/check-typescript-task.yml" | ||
- ".eslintignore" | ||
- "**/.eslintrc*" | ||
- "package.json" | ||
- "package-lock.json" | ||
- "Taskfile.yml" | ||
- "tsconfig.eslint.json" | ||
- "tsconfig.json" | ||
- "**.js" | ||
- "**.jsx" | ||
- "**.ts" | ||
- "**.tsx" | ||
pull_request: | ||
paths: | ||
- ".github/workflows/check-typescript-task.yml" | ||
- ".eslintignore" | ||
- "**/.eslintrc*" | ||
- "package.json" | ||
- "package-lock.json" | ||
- "Taskfile.yml" | ||
- "tsconfig.eslint.json" | ||
- "tsconfig.json" | ||
- "**.js" | ||
- "**.jsx" | ||
- "**.ts" | ||
- "**.tsx" | ||
schedule: | ||
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to tools. | ||
- cron: "0 8 * * TUE" | ||
workflow_dispatch: | ||
repository_dispatch: | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Taskfile | ||
uses: arduino/actions/setup-taskfile@master | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
version: 3.x | ||
|
||
- name: Lint | ||
run: task ts:lint |
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
Oops, something went wrong.