Skip to content
This repository was archived by the owner on Apr 20, 2025. It is now read-only.

Commit 780b5fd

Browse files
build: setup eslint and lintstaged
1 parent 5eecf14 commit 780b5fd

File tree

8 files changed

+1973
-24
lines changed

8 files changed

+1973
-24
lines changed

.eslintrc.cjs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
root: true,
3+
env: { browser: false, es2021: true, node: true },
4+
extends: ['love', 'eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
5+
ignorePatterns: ['node_modules', 'build', '.eslintrc.cjs', '.vscode'],
6+
parser: '@typescript-eslint/parser',
7+
parserOptions: {
8+
ecmaVersion: 'latest',
9+
sourceType: 'module',
10+
},
11+
plugins: ['@typescript-eslint'],
12+
rules: {},
13+
};

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx lint-staged

.lintstagedrc.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"*.{js,ts}": ["eslint", "prettier --write"],
3+
"*.json": "prettier --write"
4+
}

package.json

+14-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "",
55
"main": "build/index.js",
66
"scripts": {
7+
"lint": "eslint .",
78
"format": "prettier --write \"src/**/*.ts\"",
89
"postinstall": "husky install",
910
"build": "rimraf build && tsc",
@@ -16,14 +17,26 @@
1617
"devDependencies": {
1718
"@commitlint/cli": "^19.2.1",
1819
"@commitlint/config-conventional": "^19.1.0",
20+
"@eslint/eslintrc": "^3.0.2",
21+
"@eslint/js": "^9.0.0",
1922
"@total-typescript/ts-reset": "^0.5.1",
2023
"@types/cors": "^2.8.17",
2124
"@types/express": "^4.17.21",
2225
"@types/morgan": "^1.9.9",
2326
"@types/node": "^20.12.7",
27+
"@typescript-eslint/eslint-plugin": "^7.7.0",
28+
"@typescript-eslint/parser": "^7.7.0",
2429
"concurrently": "^8.2.2",
2530
"cross-env": "^7.0.3",
31+
"eslint": "^8.57.0",
32+
"eslint-config-love": "^47.0.0",
33+
"eslint-config-prettier": "^9.1.0",
34+
"eslint-plugin-import": "^2.29.1",
35+
"eslint-plugin-n": "^16.6.2",
36+
"eslint-plugin-promise": "^6.1.1",
37+
"globals": "^15.0.0",
2638
"husky": "^9.0.11",
39+
"lint-staged": "^15.2.2",
2740
"nodemon": "^3.1.0",
2841
"prettier": "^3.2.5",
2942
"rimraf": "^5.0.5",
@@ -39,4 +52,4 @@
3952
"http-status-codes": "^2.3.0",
4053
"morgan": "^1.10.0"
4154
}
42-
}
55+
}

0 commit comments

Comments
 (0)