Skip to content

Commit efc0b41

Browse files
committed
chore: add Rslint
1 parent 6ed1bd4 commit efc0b41

5 files changed

Lines changed: 162 additions & 2 deletions

File tree

.github/workflows/lint.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
20+
21+
- name: Install Pnpm
22+
run: npm i -g corepack@latest --force && corepack enable
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
26+
with:
27+
node-version: 24.15.0
28+
cache: 'pnpm'
29+
30+
- name: Install Dependencies
31+
run: pnpm install
32+
33+
- name: Run Lint
34+
run: pnpm run lint

.vscode/extensions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"rstack.rslint",
4+
"esbenp.prettier-vscode"
5+
]
6+
}

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,18 @@
2525
"build": "rslib",
2626
"bump": "npx bumpp",
2727
"dev": "rslib -w",
28-
"fix": "yarn lint:fix && yarn style:fix",
28+
"fix": "pnpm run lint:write && pnpm run style:fix",
2929
"prepare": "pnpm build",
3030
"style": "prettier --check .",
3131
"style:fix": "prettier --write .",
3232
"test": "rstest",
33-
"test:types": "tsc -p ./types/test/tsconfig.json"
33+
"test:types": "tsc -p ./types/test/tsconfig.json",
34+
"lint": "rslint",
35+
"lint:write": "rslint --fix"
3436
},
3537
"devDependencies": {
3638
"@rslib/core": "0.21.3",
39+
"@rslint/core": "^0.5.1",
3740
"@rspack/core": "2.0.1",
3841
"@rstest/core": "^0.9.10",
3942
"deepmerge": "^4.3.1",

pnpm-lock.yaml

Lines changed: 100 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rslint.config.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { defineConfig, js, ts } from '@rslint/core';
2+
3+
export default defineConfig([
4+
js.configs.recommended,
5+
ts.configs.recommended,
6+
{
7+
rules: {
8+
'@typescript-eslint/no-explicit-any': 'off',
9+
},
10+
},
11+
{
12+
files: ['types/test/**/*.ts'],
13+
rules: {
14+
'no-empty-pattern': 'off',
15+
},
16+
},
17+
]);

0 commit comments

Comments
 (0)