Skip to content

Commit

Permalink
♻️ chore: update lint
Browse files Browse the repository at this point in the history
  • Loading branch information
yunsii committed Aug 25, 2024
1 parent f9a4f95 commit ddd2f39
Show file tree
Hide file tree
Showing 21 changed files with 1,429 additions and 911 deletions.
5 changes: 1 addition & 4 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit $1
npx --no -- @jannajs/lint emojify $1
npx --no -- @jannajs/lint emojify $1
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- lint-staged
npx --no -- lint-staged
8 changes: 5 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,
"eslint.options": {
"flags": ["unstable_ts_config"]
},

// Disable the default formatter, use eslint instead
"prettier.enable": false,
Expand Down Expand Up @@ -43,7 +44,8 @@
"css",
"less",
"scss",
"sass"
"sass",
"svg"
],
"cSpell.words": [
"brillout",
Expand Down
2 changes: 1 addition & 1 deletion commitlint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const config: UserConfig = {
],
],
},
// ref: https://commitlint.js.org/#src/reference-prompt
// ref: https://commitlint.js.org/#/reference-prompt
prompt: {
questions: {
type: {
Expand Down
3 changes: 1 addition & 2 deletions dev-server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ async function startServer() {

if (!httpResponse) {
return next()
}
else {
} else {
const { statusCode, headers } = httpResponse
headers.forEach(([name, value]) => res.setHeader(name, value))
res.status(statusCode)
Expand Down
6 changes: 5 additions & 1 deletion eslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import janna from '@jannajs/lint/dist/eslint/index.js'
import janna from '@jannajs/lint/eslint'

export default janna({
tailwind: true,
Expand All @@ -8,4 +8,8 @@ export default janna({
tags: ['cls', 'tw'],
},
},
}, {
rules: {
'style/jsx-indent': ['off'],
},
})
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"preview:production": "npm run build && wrangler dev --env production",
"deploy": "npm run build && wrangler deploy --env production",
"prepare": "husky install",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"lint": "eslint --flag unstable_ts_config .",
"lint:fix": "eslint --flag unstable_ts_config .",
"wrangler:types": "wrangler types",
"postinstall": "npm run public:assets"
},
Expand All @@ -30,14 +30,15 @@
"wrangler": "^3.32.0"
},
"devDependencies": {
"@antfu/eslint-config": "^2.6.3",
"@antfu/eslint-config": "^2.27.1",
"@cloudflare/workers-types": "^4.20240222.0",
"@commitlint/cli": "^18.4.4",
"@commitlint/config-conventional": "^18.4.4",
"@commitlint/types": "^18.4.4",
"@commitlint/cli": "^19.4.0",
"@commitlint/config-conventional": "^19.2.2",
"@commitlint/types": "^19.0.3",
"@eslint-react/eslint-plugin": "^1.12.1",
"@iconify-json/ic": "^1.1.17",
"@iconify-json/svg-spinners": "^1.1.2",
"@jannajs/lint": "3.0.0-next.4",
"@jannajs/lint": "3.0.0-next.18",
"@types/compression": "^1.7.5",
"@types/express": "^4.17.21",
"@types/node": "^20.11.25",
Expand All @@ -48,16 +49,15 @@
"autoprefixer": "^10.4.18",
"compression": "^1.7.4",
"dedent": "^1.5.1",
"eslint": "npm:[email protected]",
"eslint-plugin-format": "^0.1.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"eslint": "9.9.1",
"eslint-plugin-format": "^0.1.2",
"eslint-plugin-react-hooks": "5.1.0-rc-fb9a90fa48-20240614",
"eslint-plugin-react-refresh": "^0.4.11",
"eslint-plugin-tailwindcss": "^3.14.3",
"eslint-ts-patch": "^8.56.0-0",
"express": "^4.18.2",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"husky": "^9.1.5",
"lint-staged": "^15.2.9",
"postcss": "^8.4.35",
"tailwindcss": "^3.4.1",
"tailwindcss-animate": "^1.0.7",
Expand All @@ -72,6 +72,6 @@
"zx": "^7.2.3"
},
"lint-staged": {
"*": "eslint --fix"
"*": "eslint --flag unstable_ts_config --fix"
}
}
Loading

0 comments on commit ddd2f39

Please sign in to comment.