Skip to content

Commit 4ad790e

Browse files
Merge pull request #1 from notanengineercom/improve-dx-contribution-and-usage
Improve DX for contributions and usage
2 parents ba0800c + 6e75d43 commit 4ad790e

File tree

15 files changed

+2279
-1464
lines changed

15 files changed

+2279
-1464
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,59 @@
11
name: CI
22

3-
on:
4-
push:
5-
branches: [ main ]
6-
pull_request:
7-
branches: [ main ]
3+
on: [push]
84

95
jobs:
106
build:
117
runs-on: ubuntu-latest
128
strategy:
139
matrix:
14-
node-version: [10.x, 12.x, 14.x, 15.x]
10+
node-version: [18.x, 20.x, 22.x, 24.x]
1511

1612
steps:
17-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
14+
with:
15+
show-progress: false
1816
- name: Use Node.js ${{ matrix.node-version }}
19-
uses: actions/setup-node@v2
17+
uses: actions/setup-node@v4
2018
with:
2119
node-version: ${{ matrix.node-version }}
22-
- name: Cache node dependencies
23-
id: cache-node_modules
24-
uses: actions/cache@v2
25-
with:
26-
path: node_modules
27-
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
20+
cache: 'npm'
2821
- name: Install dependencies
29-
if: steps.cache-node_modules.outputs.cache-hit != 'true'
3022
run: npm ci
3123
- run: npm run build
3224

25+
lint:
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
with:
31+
show-progress: false
32+
- name: Use Node.js 24
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: 24
36+
cache: 'npm'
37+
- name: Install dependencies
38+
run: npm ci
39+
- run: npm run lint
40+
3341
test:
42+
needs: lint
3443
runs-on: ubuntu-latest
3544
strategy:
3645
matrix:
37-
node-version: [10.x, 12.x, 14.x, 15.x]
46+
node-version: [18.x, 20.x, 22.x, 24.x]
3847

3948
steps:
40-
- uses: actions/checkout@v2
49+
- uses: actions/checkout@v4
50+
with:
51+
show-progress: false
4152
- name: Use Node.js ${{ matrix.node-version }}
42-
uses: actions/setup-node@v2
53+
uses: actions/setup-node@v4
4354
with:
4455
node-version: ${{ matrix.node-version }}
45-
- name: Cache node dependencies
46-
id: cache-node_modules
47-
uses: actions/cache@v2
48-
with:
49-
path: node_modules
50-
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
56+
cache: 'npm'
5157
- name: Install dependencies
52-
if: steps.cache-node_modules.outputs.cache-hit != 'true'
5358
run: npm ci
5459
- run: npm test

.husky/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
npm run lint
2+
npm test

.oxlintrc.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": [
4+
"unicorn",
5+
"typescript",
6+
"oxc",
7+
"import",
8+
"node",
9+
"promise"
10+
],
11+
"rules": {
12+
"oxc/no-accumulating-spread": "error",
13+
"unicorn/prefer-array-find": "error",
14+
"unicorn/prefer-array-flat-map": "error",
15+
"unicorn/prefer-set-has": "warn",
16+
"eslint/default-case": "warn",
17+
"eslint/no-bitwise": "warn",
18+
"eslint/no-console": "warn",
19+
"eslint/no-empty": "error",
20+
"eslint/no-empty-function": "error",
21+
"eslint/no-eq-null": "error",
22+
"eslint/no-unused-expressions": "error",
23+
"eslint/no-var": "error",
24+
"eslint/eqeqeq": "error",
25+
"import/no-cycle": "error",
26+
"import/exports-last": "error",
27+
"import/first": "error",
28+
"import/group-exports": "error",
29+
"import/no-duplicates": "error",
30+
"promise/catch-or-return": "error",
31+
"typescript/explicit-module-boundary-types": "error",
32+
"typescript/consistent-type-imports": "warn"
33+
}
34+
}

0 commit comments

Comments
 (0)