Skip to content

Commit

Permalink
chore: upgrade eslint and tweak and fix rules
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniDigger committed Nov 23, 2024
1 parent a380b84 commit 9148491
Show file tree
Hide file tree
Showing 142 changed files with 1,469 additions and 1,630 deletions.
118 changes: 0 additions & 118 deletions frontend/.eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/.prettierrc.js → frontend/.prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @type {import("prettier").Options}
*/
module.exports = {
export default {
tabWidth: 2,
semi: true,
singleQuote: false,
Expand Down
40 changes: 40 additions & 0 deletions frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import withNuxt from "./.nuxt/eslint.config.mjs";
import oxlint from "eslint-plugin-oxlint";
import comments from "@eslint-community/eslint-plugin-eslint-comments/configs";
import unicorn from "eslint-plugin-unicorn";

export default withNuxt()
.prepend({
ignores: ["src/types/backend/**"],
})
.append(comments.recommended, unicorn.configs["flat/recommended"], oxlint.configs["flat/recommended"])
.append({
name: "hangar",
rules: {
"import/namespace": "off", // its slow as fuck

"vue/multi-word-component-names": "off",
"vue/html-self-closing": "off",
"no-console": "off",
// TS
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/unified-signatures": "off",
"@typescript-eslint/no-dynamic-delete": "off",
"no-unused-vars": "off",
// "@typescript-eslint/consistent-type-exports": "error",
// "@typescript-eslint/consistent-type-imports": "error",
// unicorn
"unicorn/filename-case": "off",
"unicorn/prevent-abbreviations": "off",
"unicorn/catch-error-name": [
"error",
{
name: "err",
},
],
"unicorn/switch-case-braces": ["error", "avoid"],
"unicorn/prefer-query-selector": "off",
"unicorn/prefer-global-this": "off",
},
});
11 changes: 3 additions & 8 deletions frontend/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const local = true; // set to false if backendData should be fetched from stagin
const backendDataHost = process.env.BACKEND_DATA_HOST || (local ? "http://localhost:8080" : "https://hangar.papermc.dev");
const allowIndexing = process.env.HANGAR_ALLOW_INDEXING || "true";
const sentryDSN = process.env.SENTRY_DSN || "https://801c6e3ec217457e94b8d360e861242d@o4504989579804672.ingest.sentry.io/4504989584850944";
const sentryEnv = process.env.SENTRY_ENV || "local";
const sentryEnvironment = process.env.SENTRY_ENV || "local";

// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
Expand Down Expand Up @@ -45,7 +45,7 @@ export default defineNuxtConfig({
allowIndexing,
sentry: {
dsn: sentryDSN,
environment: sentryEnv,
environment: sentryEnvironment,
},
},
},
Expand All @@ -54,6 +54,7 @@ export default defineNuxtConfig({
"@pinia/nuxt",
"unplugin-icons/nuxt",
"@vueuse/nuxt",
"@nuxt/eslint",
"@nuxtjs/i18n",
"@sentry/nuxt/module",
"@nuxtjs/turnstile",
Expand All @@ -63,7 +64,6 @@ export default defineNuxtConfig({
autoInstall: true,
},
],
// "@unlighthouse/nuxt",
[
"./src/module/backendData",
{
Expand Down Expand Up @@ -103,11 +103,6 @@ export default defineNuxtConfig({
],
dts: "types/generated/icons.d.ts",
}),

// TODO this seems slow as fuck, wtf
// EslintPlugin({
// fix: true,
// }),
],
ssr: {
// Workaround until they support native ESM
Expand Down
18 changes: 5 additions & 13 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"generate": "nuxt generate",
"preview": "nuxt preview",
"previewBuild": "nuxt build && nuxt preview",
"lint:eslint": "eslint --ext \".js,.vue,.ts,.html\" --ignore-path .gitignore --fix .",
"lint:eslint": "eslint . --fix",
"lint:prettier": "prettier -w .",
"lint:oxlint": "oxlint -c .oxlint.json --import-plugin --fix",
"lint:typecheck": "nuxt typecheck",
Expand Down Expand Up @@ -62,8 +62,9 @@
"vuedraggable": "4.1.0"
},
"devDependencies": {
"@eslint-community/eslint-plugin-eslint-comments": "4.4.1",
"@iconify-json/mdi": "1.2.1",
"@nuxtjs/eslint-config-typescript": "12.1.0",
"@nuxt/eslint": "0.7.1",
"@nuxtjs/i18n": "8.5.5",
"@nuxtjs/turnstile": "0.9.11",
"@sentry/bun": "8.40.0",
Expand All @@ -81,16 +82,9 @@
"@types/prismjs": "1.26.5",
"@types/qs": "6.9.17",
"@unocss/nuxt": "0.64.1",
"@vue/eslint-config-typescript": "13.0.0",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-import-resolver-alias": "1.1.2",
"eslint-import-resolver-typescript": "3.6.3",
"eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-oxlint": "0.13.0",
"eslint-plugin-unicorn": "51.0.1",
"eslint-plugin-vue": "9.31.0",
"eslint-plugin-unicorn": "56.0.1",
"husky": "9.1.7",
"lint-staged": "15.2.10",
"nuxt": "3.14.1592",
Expand All @@ -99,11 +93,9 @@
"prettier": "3.3.3",
"regenerator-runtime": "0.14.1",
"sass": "1.81.0",
"typescript": "5.7.2",
"typescript": "5.6.3",
"unplugin-icons": "0.20.1",
"unplugin-vue-components": "0.27.4",
"vite": "5.4.11",
"vite-plugin-eslint": "1.8.1",
"vue-tsc": "2.1.10"
},
"packageManager": "[email protected]+sha256.24235772cc4ac82a62627cd47f834c72667a2ce87799a846ec4e8e555e2d4b8b"
Expand Down
Loading

0 comments on commit 9148491

Please sign in to comment.