Skip to content

Commit

Permalink
chore(ci/lint): add eslint (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahradelahi committed Apr 26, 2024
1 parent 88a7359 commit 3f79ae8
Show file tree
Hide file tree
Showing 9 changed files with 587 additions and 20 deletions.
18 changes: 18 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"env": {
"es2021": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"no-console": "error",
"@typescript-eslint/semi": "off",
"@typescript-eslint/no-explicit-any": "off"
},
"ignorePatterns": ["dist"]
}
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ name: CI

on:
push:
branches:
- canary
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
group: '${{ github.workflow }}-${{ github.event.number || github.sha }}'
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -38,17 +40,22 @@ jobs:

- run: pnpm install --frozen-lockfile
- run: pnpm check
- run: pnpm lint

test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16, 18, 20]
name: Node ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- run: pnpm install --frozen-lockfile
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"dev": "tsup --watch",
"build": "tsup",
"check": "tsc --noEmit",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"format:check": "prettier --check .",
"format": "prettier --write .",
"test": "mocha \"**/*.test.ts\"",
Expand All @@ -38,7 +40,9 @@
"@types/chai": "^4.3.14",
"@types/mocha": "^10.0.6",
"@types/node": "^20.12.7",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"chai": "^5.1.0",
"eslint": "^8.57.0",
"mocha": "^10.4.0",
"prettier": "^3.2.5",
"tsup": "^8.0.2",
Expand Down
Loading

0 comments on commit 3f79ae8

Please sign in to comment.