Skip to content

Commit

Permalink
update prettier & husky
Browse files Browse the repository at this point in the history
  • Loading branch information
chicunic committed Jan 30, 2024
1 parent 744b79c commit a011254
Show file tree
Hide file tree
Showing 19 changed files with 741 additions and 576 deletions.
13 changes: 13 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
extends: ['standard-with-typescript', 'plugin:prettier/recommended'],
ignorePatterns: ['**/_routes_tsoa.ts','.eslintrc.*', 'node_modules/', 'dist/', 'coverage/'],
rules: {
"@typescript-eslint/consistent-type-exports": 0,
"@typescript-eslint/consistent-type-imports": [2,{
"prefer": "no-type-imports"
}],
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/no-unsafe-argument": 0,
"@typescript-eslint/strict-boolean-expressions": 0,
}
};
23 changes: 0 additions & 23 deletions .eslintrc.js

This file was deleted.

6 changes: 1 addition & 5 deletions .husky/pre-commit
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm lint
pnpm build
pnpm test
5 changes: 3 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"trailingComma": "all",
"printWidth": 120,
"semi": true,
"singleQuote": true
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all"
}
20 changes: 19 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
{
"[javascript]": {
"editor.formatOnSave": false,
"editor.tabSize": 2
},
"[typescript]": {
"editor.formatOnSave": false,
"editor.tabSize": 2
},
"[typescriptreact]": {
"editor.formatOnSave": false,
"editor.tabSize": 2
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"eslint.enable": true,
"prettier.configPath": ".prettierrc",
"prettier.printWidth": 120,
"prettier.requireConfig": true,
"prettier.trailingComma": "all",
"typescript.preferences.quoteStyle": "single"
"typescript.preferences.quoteStyle": "single",
"typescript.tsdk": "./node_modules/typescript/lib"
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Yui
Copyright (c) 2024 chicunic

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
40 changes: 25 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
{
"name": "koa-ts-demo",
"version": "0.0.1",
"description": "Demo of Koa with TypeScript",
"description": "Koa TypeScript Demo",
"author": "chicunic",
"private": true,
"license": "MIT",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/chicunic/vscode-ts-linter.git"
},
"engines": {
"node": ">=20"
},
"type": "commonjs",
"scripts": {
"format": "prettier --write \"src/**/*.ts\"",
"start": "ts-node -r tsconfig-paths/register src/app.ts",
Expand All @@ -16,43 +21,48 @@
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
"build": "tsoa spec-and-routes && tsc",
"build:swagger": "tsoa spec-and-routes",
"prepare": "husky install"
"prepare": "husky",
"test": "eslint \"{src,apps,libs,test}/**/*.ts\""
},
"dependencies": {
"@koa/cors": "^5.0.0",
"@koa/router": "^12.0.1",
"@tsoa/runtime": "^5.0.0",
"dotenv": "^16.3.1",
"@tsoa/runtime": "^6.0.0",
"dotenv": "^16.4.1",
"jsonwebtoken": "^9.0.2",
"koa": "^2.14.2",
"koa": "^2.15.0",
"koa-bodyparser": "^4.4.1",
"koa-mount": "^4.0.0",
"koa-session": "^6.4.0",
"koa-static": "^5.0.0",
"koa2-swagger-ui": "^5.10.0",
"promise.any": "^2.0.6",
"tsoa": "^5.1.1"
"tsoa": "^6.0.1"
},
"devDependencies": {
"@types/jsonwebtoken": "^9.0.5",
"@types/koa": "^2.13.12",
"@types/koa": "^2.14.0",
"@types/koa-bodyparser": "^4.3.12",
"@types/koa-cors": "^0.0.6",
"@types/koa-mount": "^4.0.5",
"@types/koa-session": "^6.4.5",
"@types/koa-static": "^4.0.4",
"@types/koa__router": "^12.0.4",
"@types/node": "^20.10.4",
"@types/node": "^20.11.10",
"@types/nodemon": "^1.19.6",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"concurrently": "^8.2.2",
"eslint": "^8.55.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.0.1",
"husky": "^8.0.3",
"nodemon": "^3.0.2",
"prettier": "^3.1.1",
"eslint-config-standard-with-typescript": "^43.0.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-promise": "^6.1.1",
"husky": "^9.0.7",
"nodemon": "^3.0.3",
"prettier": "^3.2.4",
"source-map-support": "^0.5.21",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
Expand Down
Loading

0 comments on commit a011254

Please sign in to comment.