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:
36
.github/workflows/eslint.yml
vendored
Normal file
36
.github/workflows/eslint.yml
vendored
Normal 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
|
||||||
@@ -11,6 +11,6 @@ install:
|
|||||||
- yarn
|
- yarn
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- yarn lerna run prepublish
|
- yarn build:all
|
||||||
- yarn lerna run check-types
|
- yarn turbo run check-types
|
||||||
- xvfb-run --server-args="-screen 0 1920x1080x24" yarn lerna run test
|
- xvfb-run --server-args="-screen 0 1920x1080x24" yarn lerna run test
|
||||||
|
|||||||
@@ -36,7 +36,8 @@
|
|||||||
"test:watch": "yarn turbo run test:watch",
|
"test:watch": "yarn turbo run test:watch",
|
||||||
"dev": "yarn turbo run dev",
|
"dev": "yarn turbo run dev",
|
||||||
"repl": "cd packages/rrweb && npm run repl",
|
"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": {
|
"resolutions": {
|
||||||
"**/jsdom/cssom": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz"
|
"**/jsdom/cssom": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz"
|
||||||
|
|||||||
16
turbo.json
16
turbo.json
@@ -3,17 +3,13 @@
|
|||||||
"baseBranch": "origin/master",
|
"baseBranch": "origin/master",
|
||||||
"pipeline": {
|
"pipeline": {
|
||||||
"prepublish": {
|
"prepublish": {
|
||||||
"dependsOn": [
|
"dependsOn": ["^prepublish"],
|
||||||
"^prepublish"
|
"outputs": ["lib/**", "es/**", "dist/**"]
|
||||||
],
|
|
||||||
"outputs": [
|
|
||||||
"lib/**",
|
|
||||||
"es/**",
|
|
||||||
"dist/**"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"test": {},
|
"test": {},
|
||||||
"test:watch": {},
|
"test:watch": {},
|
||||||
"dev": {}
|
"dev": {},
|
||||||
|
"lint": {},
|
||||||
|
"check-types": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user