Add ESLint

This commit is contained in:
Soitora 2023-07-26 00:22:22 +02:00
parent c450416d86
commit 79225a0bfb
No known key found for this signature in database
GPG Key ID: A6D711EB4F2CCD97
7 changed files with 2344 additions and 5 deletions

12
.eslintignore Normal file
View File

@ -0,0 +1,12 @@
*.sh
*.md
*.woff
*.ttf
.vscode
.idea
.husky
.local
node_modules
!docs/.vitepress
docs/.vitepress/cache
docs/.vitepress/dist/

49
.eslintrc.js Normal file
View File

@ -0,0 +1,49 @@
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
node: true,
"vue/setup-compiler-macros": true,
},
parser: "vue-eslint-parser",
extends: [
"plugin:vue/vue3-recommended",
"plugin:@typescript-eslint/recommended",
"standard",
],
parserOptions: {
ecmaVersion: "latest",
parser: "@typescript-eslint/parser",
sourceType: "module",
},
plugins: [
"vue",
"@typescript-eslint",
],
rules: {
"comma-dangle": ["error", "only-multiline"],
quotes: ["error", "double"],
indent: ["error", "tab"],
"no-tabs": 0,
"no-console": "off",
"no-debugger": "off",
"vue/multi-word-component-names": "off",
"vue/comment-directive": "off",
"no-unused-vars": "off",
"vue/no-parsing-error": [
2,
{
"x-invalid-end-tag": false,
"missing-semicolon-after-character-reference": false,
},
],
/* --ECMAScript 6 ES6-- */
"no-useless-escape": "off",
"no-unused-expressions": [
"error",
{ allowShortCircuit: true, allowTernary: true },
],
},
}

2228
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -15,8 +15,10 @@
"docs:dev": "vitepress dev src", "docs:dev": "vitepress dev src",
"docs:build": "npm run lint && vitepress build src", "docs:build": "npm run lint && vitepress build src",
"docs:preview": "vitepress preview src", "docs:preview": "vitepress preview src",
"lint": "npm run lint:prettier && npm run lint:mdl && npm run lint:style", "lint": "npm run lint:es && npm run lint:prettier && npm run lint:mdl && npm run lint:style",
"lint:fix": "npm run lint:prettier:fix && npm run lint:style:fix", "lint:fix": "npm run lint:es:fix && npm run lint:prettier:fix && npm run lint:style:fix",
"lint:es": "eslint . --ext .vue,.js,.ts,.jsx,.tsx",
"lint:es:fix": "eslint . --ext .vue,.js,.ts,.jsx,.tsx --fix",
"lint:prettier": "prettier --check \"src/**/*\"", "lint:prettier": "prettier --check \"src/**/*\"",
"lint:prettier:fix": "prettier --check --write \"src/**/*\"", "lint:prettier:fix": "prettier --check --write \"src/**/*\"",
"lint:mdl": "markdownlint \"**/*.md\" \".github/**/*.md\" --enable sentences-per-line --disable MD025 MD033", "lint:mdl": "markdownlint \"**/*.md\" \".github/**/*.md\" --enable sentences-per-line --disable MD025 MD033",
@ -31,6 +33,11 @@
"@mdit/plugin-img-size": "^0.4.8", "@mdit/plugin-img-size": "^0.4.8",
"@mdit/plugin-include": "^0.4.8", "@mdit/plugin-include": "^0.4.8",
"@mdit/plugin-tab": "^0.4.8", "@mdit/plugin-tab": "^0.4.8",
"@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0",
"eslint": "^8.45.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-vue": "^9.15.1",
"feed": "^4.2.2", "feed": "^4.2.2",
"lint-staged": "^13.2.3", "lint-staged": "^13.2.3",
"markdown-it-mdi": "^0.1.0", "markdown-it-mdi": "^0.1.0",
@ -42,8 +49,10 @@
"stylelint": "^15.10.2", "stylelint": "^15.10.2",
"stylelint-stylus": "^0.18.0", "stylelint-stylus": "^0.18.0",
"stylus": "^0.59.0", "stylus": "^0.59.0",
"vite-plugin-eslint": "^1.8.1",
"vitepress": "^1.0.0-beta.6", "vitepress": "^1.0.0-beta.6",
"vue": "^3.3.4" "vue": "^3.3.4",
"vue-eslint-parser": "^9.3.1"
}, },
"simple-git-hooks": { "simple-git-hooks": {
"pre-commit": "npm run lint-staged" "pre-commit": "npm run lint-staged"

View File

@ -22,4 +22,4 @@ module.exports = {
], ],
}, },
extends: ["stylelint-stylus/standard"], extends: ["stylelint-stylus/standard"],
}; }

33
tsconfig.json Normal file
View File

@ -0,0 +1,33 @@
{
"compilerOptions": {
"target": "esnext",
"useDefineForClassFields": true,
"module": "esnext",
"moduleResolution": "node",
"strict": true,
"jsx": "preserve",
"sourceMap": true,
"resolveJsonModule": true,
"isolatedModules": true,
"esModuleInterop": true,
"lib": ["esnext", "dom"],
"skipLibCheck": true,
"types": ["vite/client"],
"paths": {
"@/*": ["./docs/.vitepress/*"]
}
},
"include": [
"typings/**/*.d.ts",
"docs/**/*.vue",
"docs/**/*.tsx",
"docs/**/*.ts",
"docs/.**/**/*.ts",
"docs/.**/**/*.tsx",
"docs/.**/**/*.vue"
],
"exclude": ["**/node_modules/**", "**/dist/**"],
"extensions": [".js", ".ts", ".tsx", ".jsx", ".vue"],
"references": [{ "path": "./tsconfig.node.json" }],
"allowSyntheticDefaultImports": true
}

10
tsconfig.node.json Normal file
View File

@ -0,0 +1,10 @@
{
"compilerOptions": {
"composite": true,
"module": "esnext",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"types": ["vite/client"]
},
"exclude": ["**/node_modules/**", "**/dist/**"]
}