Skip to content

Commit

Permalink
Switch to ESLint flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanzilla committed Jul 1, 2024
1 parent 7b13e4a commit 7877d93
Show file tree
Hide file tree
Showing 12 changed files with 338 additions and 169 deletions.
47 changes: 0 additions & 47 deletions .eslintrc.json

This file was deleted.

64 changes: 64 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import pluginVue from "eslint-plugin-vue";
import unocss from "@unocss/eslint-config/flat";
import eslint from "@eslint/js";
import tsEslint from "typescript-eslint";
import tsParser from "@typescript-eslint/parser";
import vueParser from "vue-eslint-parser";

export default [
eslint.configs.recommended,
...tsEslint.configs.recommendedTypeChecked,
...pluginVue.configs["flat/recommended"],
unocss,
{
languageOptions: {
parser: vueParser,
parserOptions: {
parser: tsParser,
sourceType: "module",
extraFileExtensions: [".vue"],
project: true,
},
},
},
{
ignores: [
"dist",
"node_modules",
"dist_electron",
"dist-electron",
"release",
"index.html",
"tools/**/*.js",
"uno.config.ts",
"vite.config.ts",
"*.d.ts",
],
rules: {
"no-console": "off",
"no-undef": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-unnecessary-type-assertion": "off",
"@typescript-eslint/no-base-to-string": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/require-await": "off",
"vue/multi-word-component-names": "off",
"vue/component-tags-order": [
"error",
{
order: [["script", "template"], "style"],
},
],
"vue/html-self-closing": "off",
"vue/html-indent": "off",
"vue/html-closing-bracket-newline": "off",
"vue/singleline-html-element-content-newline": "off",
},
},
];
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"i18n": "pnpm run compile-tools && node ./tools/scripts/extract-i18n-messages.js",
"i18n-report": "pnpm dlx vue-i18n-extract report --add --remove --separator 'buggy' --vueFiles './src/**/*.?(ts|vue)' --languageFiles './i18n/*.json'",
"preinstall": "npx only-allow pnpm",
"lint": "eslint . --cache --ext .ts,.js,.vue && prettier . --check --cache",
"lint:fix": "eslint . --ext .ts,.js,.vue --fix && prettier . --write",
"lint": "eslint ./src --cache && prettier . --check --cache",
"lint:fix": "eslint ./src --fix && prettier . --write",
"prepare": "husky"
},
"lint-staged": {
Expand All @@ -54,6 +54,7 @@
"tga": "^1.0.7"
},
"devDependencies": {
"@ianvs/prettier-plugin-sort-imports": "^4.3.0",
"@iconify-json/fa6-brands": "^1.1.19",
"@iconify-json/mdi": "^1.1.67",
"@iconify/tools": "^4.0.4",
Expand All @@ -63,7 +64,6 @@
"@types/luxon": "^3.4.2",
"@types/node": "^20.14.9",
"@types/tail": "^2.2.3",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"@unocss/eslint-config": "^0.61.0",
"@unocss/preset-icons": "^0.61.0",
Expand All @@ -75,8 +75,7 @@
"electron-log": "^5.1.5",
"electron-store": "^10.0.0",
"electron-updater": "^6.2.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint": "^9.6.0",
"eslint-plugin-vue": "^9.26.0",
"floating-vue": "^5.2.2",
"glob": "^10.4.2",
Expand All @@ -91,6 +90,7 @@
"tail": "^2.2.6",
"tree-kill": "^1.2.2",
"typescript": "^5.5.3",
"typescript-eslint": "8.0.0-alpha.39",
"unocss": "^0.61.0",
"vite": "^5.3.2",
"vite-plugin-electron": "^0.28.7",
Expand Down
Loading

0 comments on commit 7877d93

Please sign in to comment.