Skip to content

Commit

Permalink
feat: add zod & update eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
FlandreDaisuki committed Nov 5, 2023
1 parent d59546c commit 35c79f1
Show file tree
Hide file tree
Showing 36 changed files with 1,539 additions and 818 deletions.
6 changes: 0 additions & 6 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .vscode/i18n-ally-custom-framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ languageIds:
- javascript

usageMatchRegex:
- "[^\\w\\d]t\\(['\"`]({key})['\"`]"
- '[^\w\d]t\([''"`]({key})[''"`]'

monopoly: true
40 changes: 39 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,44 @@
{
// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,

// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},

// Silent the stylistic rules in you IDE, but still auto fix them
// "eslint.rules.customizations": [
// { "rule": "style/*", "severity": "off" },
// { "rule": "*-indent", "severity": "off" },
// { "rule": "*-spacing", "severity": "off" },
// { "rule": "*-spaces", "severity": "off" },
// { "rule": "*-order", "severity": "off" },
// { "rule": "*-dangle", "severity": "off" },
// { "rule": "*-newline", "severity": "off" },
// { "rule": "*quotes", "severity": "off" },
// { "rule": "*semi", "severity": "off" }
// ],

// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml"
],

"cSpell.words": [
"AUTOINCREMENT",
"dmhy",
Expand All @@ -26,5 +63,6 @@
],
"i18n-ally.sourceLanguage": "zh",
"i18n-ally.displayLanguage": "zh",

"markdown.extension.toc.levels": "2..6"
}
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3"
version: 3

services:
aria2:
Expand Down
2 changes: 1 addition & 1 deletion docs/aria2.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ aria2 常用的 ui 介面有 `webui-aria2` 和 `AriaNg`,不過安裝稍微有
改成剛剛設定的密碼 (以上面 `hello-dmhy-subscribe` 為例) 並移除註解 (`//`) 如下:
```js
```txt
token: 'hello-dmhy-subscribe'
```
Expand Down
3 changes: 2 additions & 1 deletion docs/webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ app.post('/download', (req, res) => {

if (!token || token !== expectedToken) {
res.status(403).send('Forbidden');
} else {
}
else {
console.log(req.body);
res.json(req.body);
}
Expand Down
3 changes: 3 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import flandre from '@flandredaisuki/eslint-config';

export default flandre();
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
{
"name": "dmhy-subscribe",
"type": "module",
"version": "1.0.6",
"description": "Subscribe by keywords and download megnets",
"keywords": [],
"license": "ISC",
"author": "FlandreDaisuki <vbnm123c+github@gmail.com>",
"license": "ISC",
"homepage": "https://github.com/FlandreDaisuki/dmhy-subscribe#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/FlandreDaisuki/dmhy-subscribe.git"
},
"bugs": {
"url": "https://github.com/FlandreDaisuki/dmhy-subscribe/issues"
},
"homepage": "https://github.com/FlandreDaisuki/dmhy-subscribe#readme",
"keywords": [],
"main": "index.mjs",
"bin": {
"dmhy": "./src/cli/index.mjs"
},
"engines": {
"node": ">=18.0.0"
},
"scripts": {
"lint": "eslint --fix .",
"lint": "eslint . --fix",
"test": "vitest"
},
"dependencies": {
Expand All @@ -31,22 +35,20 @@
"rss-parser": "^3.13.0",
"semver": "^7.5.4",
"sqlite3": "^5.1.6",
"yargs": "^17.7.2"
"yargs": "^17.7.2",
"zod": "^3.22.4"
},
"devDependencies": {
"@flandredaisuki/eslint-config": "^0.0.4",
"@flandredaisuki/eslint-config": "^0.1.2",
"@types/debug": "^4.1.9",
"@types/js-yaml": "^4.0.6",
"@types/node": "^20.8.3",
"@types/semver": "^7.5.3",
"@types/yargs": "^17.0.28",
"eslint": "^8.51.0",
"eslint": "^8.53.0",
"typescript": "^5.2.2",
"vitest": "^0.34.6"
},
"engines": {
"node": ">=18"
},
"pnpm": {
"overrides": {
"array-includes": "npm:@nolyfill/array-includes@latest",
Expand Down
Loading

0 comments on commit 35c79f1

Please sign in to comment.