Skip to content

Commit 4e04548

Browse files
authored
Enable prettier (#9)
* Install Prettier * Run Prettier * Disable eslint rules that conflict with prettier * Use eslint-plugin-solid directly rather than pulling in @Techassi metaconfig * Re-enable eslint-plugin-unicorn * Use trailing commas consistently * Disable promise lint due to false positives * Revert to single quotes * Run prettier
1 parent 185414a commit 4e04548

14 files changed

Lines changed: 489 additions & 757 deletions

pnpm-lock.yaml

Lines changed: 357 additions & 274 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/.eslintrc

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
{
22
"extends": [
3-
"@techassi/solid"
4-
]
5-
}
3+
"eslint:recommended",
4+
"plugin:@typescript-eslint/recommended",
5+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
6+
"plugin:solid/typescript",
7+
"plugin:unicorn/recommended",
8+
"prettier"
9+
],
10+
"parser": "@typescript-eslint/parser",
11+
"parserOptions": {
12+
"project": true
13+
},
14+
"plugins": ["@typescript-eslint", "solid", "unicorn"],
15+
"rules": {
16+
// Causes false positives for Solid resources
17+
"@typescript-eslint/no-misused-promises": "off",
18+
"unicorn/prevent-abbreviations": [
19+
"error",
20+
{
21+
"replacements": {
22+
"props": false,
23+
"env": false
24+
}
25+
}
26+
]
27+
}
28+
}

web/.husky/pre-commit

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

web/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist

web/.prettierrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"trailingComma": "all",
3+
"singleQuote": true
4+
}

web/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ The Stackable UI is a modern web app written in TypeScript. Core community-provi
1212
[unocss-link]: https://unocss.dev/
1313
[vite-link]: https://vitejs.dev/
1414

15-
## Development
15+
## Development

web/package.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,19 @@
77
"dev": "vite",
88
"build": "tsc && vite build",
99
"preview": "vite preview",
10-
"lint": "eslint --ext .js,.ts,.tsx,.jsx,.json ./src"
10+
"lint": "eslint --ext .js,.ts,.tsx,.jsx,.json ./src",
11+
"prepare": "cd .. && husky install web/.husky"
1112
},
1213
"devDependencies": {
13-
"@techassi/eslint-config-solid": "^0.1.1",
14+
"@typescript-eslint/eslint-plugin": "^5.59.5",
15+
"@typescript-eslint/parser": "^5.59.5",
1416
"eslint": "^8.40.0",
17+
"eslint-config-prettier": "^8.8.0",
1518
"eslint-plugin-solid": "^0.12.1",
19+
"eslint-plugin-unicorn": "^47.0.0",
20+
"husky": "^8.0.3",
21+
"lint-staged": "^13.2.2",
22+
"prettier": "^2.8.8",
1623
"typescript": "^5.0.2",
1724
"unocss": "^0.51.8",
1825
"vite": "^4.3.2",
@@ -22,5 +29,8 @@
2229
"@solidjs/router": "^0.8.2",
2330
"@unocss/reset": "^0.51.12",
2431
"solid-js": "^1.7.4"
32+
},
33+
"lint-staged": {
34+
"**/*": "prettier --write --ignore-unknown"
2535
}
26-
}
36+
}

0 commit comments

Comments
 (0)