add Eslint action and update travis CI (#931)

* refactor: eliminate eslint errors as many as I can

* refactor: fix more eslint errors in the record module

* LINT: fix @typescript-eslint/unbound-method

* LINT: fix all eslint errors in source code

* LINT: fix as many eslint warnings as possible

* CI: add a github action to check ESLINT status

* CI: update github action

* build: update travis CI and github action

* CI: update github action

* CI: update job name

* CI: restore test command from turbo to lerna

* Merge branch master into eslint-action

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
This commit is contained in:
Yun Feng
2026-04-01 12:00:00 +08:00
committed by GitHub
parent 44df37c118
commit 21d8d858a9
4 changed files with 46 additions and 13 deletions

36
.github/workflows/eslint.yml vendored Normal file
View File

@@ -0,0 +1,36 @@
name: Eslint Check
on: [pull_request]
jobs:
eslint_check_upload:
runs-on: ubuntu-latest
name: ESLint Check and Report Upload
steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
- name: Install Dependencies
run: yarn
- name: Build Packages
run: yarn build:all
- name: Test Code Linting
run: yarn turbo run lint
- name: Save Code Linting Report JSON
run: yarn lint:report
# Continue to the next step even if this fails
continue-on-error: true
- name: Annotate Code Linting Results
uses: ataylorme/eslint-annotate-action@v2
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
report-json: 'eslint_report.json'
- name: Upload ESLint report
uses: actions/upload-artifact@v2
with:
name: eslint_report.json
path: eslint_report.json

View File

@@ -11,6 +11,6 @@ install:
- yarn
script:
- yarn lerna run prepublish
- yarn lerna run check-types
- yarn build:all
- yarn turbo run check-types
- xvfb-run --server-args="-screen 0 1920x1080x24" yarn lerna run test

View File

@@ -36,7 +36,8 @@
"test:watch": "yarn turbo run test:watch",
"dev": "yarn turbo run dev",
"repl": "cd packages/rrweb && npm run repl",
"lint": "yarn run concurrently --success=all -r -m=1 'yarn run markdownlint docs' 'yarn eslint packages/*/src --ext .ts,.tsx,.js,.jsx,.svelte'"
"lint": "yarn run concurrently --success=all -r -m=1 'yarn run markdownlint docs' 'yarn eslint packages/*/src --ext .ts,.tsx,.js,.jsx,.svelte'",
"lint:report": "yarn eslint --output-file eslint_report.json --format json packages/*/src --ext .ts,.tsx,.js,.jsx"
},
"resolutions": {
"**/jsdom/cssom": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz"

View File

@@ -3,17 +3,13 @@
"baseBranch": "origin/master",
"pipeline": {
"prepublish": {
"dependsOn": [
"^prepublish"
],
"outputs": [
"lib/**",
"es/**",
"dist/**"
]
"dependsOn": ["^prepublish"],
"outputs": ["lib/**", "es/**", "dist/**"]
},
"test": {},
"test:watch": {},
"dev": {}
"dev": {},
"lint": {},
"check-types": {}
}
}
}