add eslint

This commit is contained in:
ClasWen 2024-05-18 18:23:51 +08:00
parent 92b728f6d0
commit a3a0f10463
3 changed files with 18525 additions and 13222 deletions

33
eslint.config.js Normal file
View file

@ -0,0 +1,33 @@
// ts-check
import globals from "globals"
import eslint from "@eslint/js"
import eslintPluginAstro from "eslint-plugin-astro"
import stylistic from "@stylistic/eslint-plugin"
export default [
eslint.configs.recommended,
...eslintPluginAstro.configs.recommended,
stylistic.configs.customize({
indent: 2,
quotes: "double",
semi: false,
jsx: true,
}),
{
ignores: ["dist"],
languageOptions: {
globals: {
...globals.browser,
},
},
rules: {
"prefer-const": [
"error",
{
destructuring: "any",
ignoreReadBeforeAssign: false,
},
],
},
},
]

5294
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -7,6 +7,7 @@
"start": "astro dev", "start": "astro dev",
"build": "astro build", "build": "astro build",
"preview": "astro preview", "preview": "astro preview",
"lint": "eslint",
"astro": "astro" "astro": "astro"
}, },
"dependencies": { "dependencies": {
@ -18,8 +19,7 @@
"@fullcalendar/daygrid": "^6.1.11", "@fullcalendar/daygrid": "^6.1.11",
"@fullcalendar/icalendar": "^6.1.11", "@fullcalendar/icalendar": "^6.1.11",
"@fullcalendar/react": "^6.1.11", "@fullcalendar/react": "^6.1.11",
"@types/react": "^18.2.79", "@stylistic/eslint-plugin": "^2.1.0",
"@types/react-dom": "^18.2.25",
"astro": "^4.5.12", "astro": "^4.5.12",
"ical.js": "^1.5.0", "ical.js": "^1.5.0",
"md5": "^2.3.0", "md5": "^2.3.0",
@ -30,5 +30,19 @@
"tailwindcss": "^3.4.3", "tailwindcss": "^3.4.3",
"unist-util-visit": "^5.0.0", "unist-util-visit": "^5.0.0",
"vue": "^3.4.21" "vue": "^3.4.21"
},
"devDependencies": {
"@types/eslint__js": "^8.42.3",
"@types/react": "^18.2.79",
"@types/react-dom": "^18.2.25",
"eslint": "^8.57.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-astro": "^1.2.0",
"eslint-plugin-import": "^2.29.1",
"globals": "^15.2.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"typescript": "^5.4.5",
"typescript-eslint": "^7.9.0"
} }
} }