Skip to content

Commit a64ef77

Browse files
committed
Add eslint
1 parent 2ae5dc0 commit a64ef77

File tree

5 files changed

+659
-7
lines changed

5 files changed

+659
-7
lines changed

.eslintrc

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": ["@typescript-eslint", "no-only-tests", "eslint-comments"],
5+
"ignorePatterns": ["node_modules", "dist", "dev", "tsup.config.ts", "vitest.config.ts"],
6+
"parserOptions": {
7+
"project": "./tsconfig.json",
8+
"tsconfigRootDir": ".",
9+
"sourceType": "module"
10+
},
11+
"rules": {
12+
"prefer-const": "warn",
13+
"no-console": "warn",
14+
"no-debugger": "warn",
15+
"@typescript-eslint/no-unused-vars": [
16+
"warn",
17+
{
18+
"argsIgnorePattern": "^_",
19+
"varsIgnorePattern": "^_",
20+
"caughtErrorsIgnorePattern": "^_"
21+
}
22+
],
23+
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
24+
"@typescript-eslint/no-unnecessary-condition": "warn",
25+
"@typescript-eslint/no-useless-empty-export": "warn",
26+
"no-only-tests/no-only-tests": "warn",
27+
"eslint-comments/no-unused-disable": "warn"
28+
}
29+
}

.github/workflows/tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ jobs:
3535
env:
3636
CI: true
3737

38-
- name: Typecheck
39-
run: pnpm run typecheck
38+
- name: Lint
39+
run: pnpm run lint

package.json

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"version": "0.0.0",
32
"name": "{{name_of_lib}}",
3+
"version": "0.0.0",
44
"description": "{{desc_of_lib}}",
55
"license": "MIT",
66
"author": "{{me}}",
@@ -50,16 +50,23 @@
5050
"test:ssr": "pnpm run test:client --mode ssr",
5151
"prepublishOnly": "pnpm build",
5252
"format": "prettier --ignore-path .gitignore -w \"src/**/*.{js,ts,json,css,tsx,jsx}\" \"dev/**/*.{js,ts,json,css,tsx,jsx}\"",
53-
"update-deps": "pnpm up -Li",
54-
"typecheck": "tsc --noEmit"
53+
"lint": "concurrently pnpm:lint:*",
54+
"lint:code": "eslint --ignore-path .gitignore --max-warnings 0 src/**/*.{js,ts,tsx,jsx}",
55+
"lint:types": "tsc --noEmit",
56+
"update-deps": "pnpm up -Li"
5557
},
5658
"peerDependencies": {
5759
"solid-js": "^1.6.0"
5860
},
5961
"devDependencies": {
62+
"@typescript-eslint/eslint-plugin": "^6.1.0",
63+
"@typescript-eslint/parser": "^6.1.0",
6064
"concurrently": "^8.2.0",
6165
"esbuild": "^0.18.14",
6266
"esbuild-plugin-solid": "^0.5.0",
67+
"eslint": "^8.45.0",
68+
"eslint-plugin-eslint-comments": "^3.2.0",
69+
"eslint-plugin-no-only-tests": "^3.1.0",
6370
"jsdom": "^22.1.0",
6471
"prettier": "3.0.0",
6572
"solid-js": "^1.7.8",
@@ -73,5 +80,9 @@
7380
"keywords": [
7481
"solid"
7582
],
76-
"packageManager": "[email protected]"
83+
"packageManager": "[email protected]",
84+
"engines": {
85+
"node": ">=18",
86+
"pnpm": ">=8.6.0"
87+
}
7788
}

0 commit comments

Comments
 (0)