Skip to content

Commit 2ee918b

Browse files
committed
chore: setup eslint and husky pre push git hook
1 parent 3ac04e3 commit 2ee918b

File tree

7 files changed

+4098
-4652
lines changed

7 files changed

+4098
-4652
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm run prepack && npm run lint-staged

.husky/pre-push

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm run test

eslint.config.mjs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// @ts-check
2+
3+
import eslint from '@eslint/js';
4+
import tseslint from 'typescript-eslint';
5+
6+
export default tseslint.config(
7+
eslint.configs.recommended,
8+
tseslint.configs.recommended,
9+
{
10+
files: ['src/**/*.{js,ts}'],
11+
rules: {
12+
'@typescript-eslint/interface-name-prefix': 'off',
13+
'@typescript-eslint/explicit-function-return-type': 'off',
14+
'@typescript-eslint/no-explicit-any': 'off',
15+
'@/semi': ['error'],
16+
'@typescript-eslint/array-type': ['error'],
17+
'@/no-throw-literal': ['error'],
18+
quotes: 'off',
19+
'@/quotes': ['error', 'single'],
20+
'max-len': ['error', { code: 120 }],
21+
'@typescript-eslint/no-namespace': 'off',
22+
"indent": [
23+
"error",
24+
2
25+
]
26+
},
27+
},
28+
);

0 commit comments

Comments
 (0)