Skip to content

Commit 97254df

Browse files
committed
add and fix eslint
1 parent 66f5abb commit 97254df

File tree

5 files changed

+576
-5
lines changed

5 files changed

+576
-5
lines changed

.eslintrc.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "https://json.schemastore.org/eslintrc.json",
3+
"env": {
4+
"es2021": true,
5+
"node": true
6+
},
7+
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
8+
"parserOptions": {
9+
"ecmaVersion": "latest",
10+
"sourceType": "module"
11+
},
12+
"rules": {
13+
"no-console": "error",
14+
"@typescript-eslint/semi": "off",
15+
"@typescript-eslint/no-explicit-any": "off"
16+
},
17+
"ignorePatterns": ["dist", "node_modules"]
18+
}

.prettierrc

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
{
2+
"$schema": "https://json.schemastore.org/prettierrc",
23
"useTabs": false,
34
"semi": true,
45
"singleQuote": true,
5-
"trailingComma": "all",
6-
"printWidth": 100
6+
"trailingComma": "es5",
7+
"printWidth": 100,
8+
"overrides": [
9+
{
10+
"files": "*.md",
11+
"options": {
12+
"parser": "markdown",
13+
"printWidth": 79
14+
}
15+
}
16+
]
717
}

package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
"build": "tsup",
88
"test": "mocha \"**/*.test.ts\" --retries 2",
99
"typecheck": "tsc --noEmit",
10+
"lint": "eslint \"src/**/*.ts\"",
11+
"lint:fix": "eslint --fix \"src/**/*.ts\"",
1012
"format:check": "prettier --check \"**/*.{ts,md}\"",
1113
"format": "prettier --write .",
12-
"prepublishOnly": "pnpm test && pnpm run format:check && pnpm run typecheck && pnpm build"
14+
"prepublishOnly": "pnpm test && pnpm lint && pnpm run format:check && pnpm run typecheck && pnpm build"
1315
},
1416
"type": "module",
1517
"packageManager": "pnpm@8.15.0",
@@ -21,7 +23,9 @@
2123
"@types/mocha": "^10.0.6",
2224
"@types/node": "^20.12.2",
2325
"@types/prompts": "^2.4.9",
26+
"@typescript-eslint/eslint-plugin": "^7.4.0",
2427
"chai": "^5.1.0",
28+
"eslint": "^8.57.0",
2529
"mocha": "^10.4.0",
2630
"prettier": "^3.2.5",
2731
"tsup": "^8.0.2",

0 commit comments

Comments
 (0)