Skip to content

Commit 00bb3ba

Browse files
committed
chore: add linter
1 parent 58b41f4 commit 00bb3ba

14 files changed

+4729
-1462
lines changed

.eslintrc

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"plugins": ["@typescript-eslint"],
4+
"extends": [
5+
"plugin:@typescript-eslint/recommended",
6+
"plugin:prettier/recommended"
7+
],
8+
"rules": {
9+
"@typescript-eslint/consistent-type-imports": [
10+
"error",
11+
{
12+
"prefer": "type-imports",
13+
"disallowTypeAnnotations": false,
14+
"fixStyle": "separate-type-imports"
15+
}
16+
],
17+
"semi": [
18+
"error",
19+
"never",
20+
{
21+
"beforeStatementContinuationChars": "never"
22+
}
23+
],
24+
"no-unused-vars": "off",
25+
"@typescript-eslint/naming-convention": [
26+
"error",
27+
{
28+
"selector": "variable",
29+
"format": ["camelCase", "PascalCase"],
30+
"leadingUnderscore": "allow",
31+
"trailingUnderscore": "allow"
32+
},
33+
{
34+
"selector": "typeLike",
35+
"format": ["PascalCase"]
36+
}
37+
],
38+
"@typescript-eslint/no-non-null-assertion": "off",
39+
"@typescript-eslint/ban-ts-comment": "off",
40+
"@typescript-eslint/no-explicit-any": "off",
41+
"@typescript-eslint/no-unused-vars": "off",
42+
"prettier/prettier": "warn"
43+
},
44+
"env": {
45+
"browser": true,
46+
"node": true
47+
}
48+
}

.prettierrc

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"printWidth": 80,
3+
"semi": false,
4+
"arrowParens": "avoid",
5+
"trailingComma": "none",
6+
"overrides": [
7+
{
8+
"files": ".prettierrc",
9+
"options": {
10+
"parser": "json"
11+
}
12+
}
13+
]
14+
}

README.md

+25-23
Large diffs are not rendered by default.

package.json

+22-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
"build:netlify": "SERVER=netlify astro build",
1212
"start": "node ./dist/server/entry.mjs",
1313
"preview": "astro preview",
14-
"astro": "astro"
14+
"astro": "astro",
15+
"lint:fix": "eslint . --fix --ext .ts",
16+
"lint": "eslint . --ext .ts",
17+
"prettier": "prettier --write ."
1518
},
1619
"dependencies": {
1720
"@astrojs/netlify": "^2.2.0",
@@ -35,7 +38,25 @@
3538
"markdown-it-kbd": "^2.2.2",
3639
"solid-js": "^1.6.15"
3740
},
41+
"simple-git-hooks": {
42+
"pre-commit": "pnpm exec lint-staged"
43+
},
44+
"lint-staged": {
45+
"src/**/*.{js,jsx,ts,tsx,json}": [
46+
"prettier --write",
47+
"eslint --cache --fix",
48+
"git add"
49+
]
50+
},
3851
"devDependencies": {
52+
"eslint": "^7.23.0",
53+
"eslint-config-prettier": "^8.5.0",
54+
"eslint-plugin-prettier": "^4.2.1",
55+
"lint-staged": "^13.0.3",
56+
"prettier": "^2.7.1",
57+
"simple-git-hooks": "^2.8.1",
58+
"@typescript-eslint/eslint-plugin": "^5.36.2",
59+
"@typescript-eslint/parser": "^5.36.2",
3960
"@iconify-json/carbon": "^1.1.16",
4061
"@iconify-json/ri": "^1.1.5",
4162
"@types/markdown-it": "^12.2.3",

0 commit comments

Comments
 (0)