Skip to content

Commit b51760d

Browse files
committed
merge(ci): ESLint config + GitHub Actions build/test/lint gate
2 parents ae8a1f3 + 5b6056e commit b51760d

2 files changed

Lines changed: 76 additions & 0 deletions

File tree

.eslintrc.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"root": true,
3+
"env": {
4+
"browser": true,
5+
"webextensions": true,
6+
"serviceworker": true,
7+
"es2022": true
8+
},
9+
"parserOptions": {
10+
"ecmaVersion": 2022,
11+
"sourceType": "module"
12+
},
13+
"extends": "eslint:recommended",
14+
"rules": {
15+
"no-eval": "error",
16+
"no-implied-eval": "error",
17+
"no-undef": "error",
18+
"no-unused-vars": [
19+
"warn",
20+
{
21+
"argsIgnorePattern": "^_",
22+
"varsIgnorePattern": "^_",
23+
"caughtErrorsIgnorePattern": "^_"
24+
}
25+
]
26+
},
27+
"ignorePatterns": [
28+
"node_modules/",
29+
"dist/",
30+
"**/*.bundle.js"
31+
],
32+
"overrides": [
33+
{
34+
"files": ["test/**/*.js", "scripts/**/*.js"],
35+
"env": {
36+
"node": true,
37+
"browser": false
38+
}
39+
}
40+
]
41+
}

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build-test-lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20'
23+
cache: 'npm'
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Build
29+
run: npm run build
30+
31+
- name: Test
32+
run: npm test
33+
34+
- name: Lint
35+
run: npm run lint

0 commit comments

Comments
 (0)