Skip to content

Commit

Permalink
chore: eslint to 9.x/flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
ctot-nondef committed Sep 9, 2024
1 parent c377e61 commit d1a70ef
Show file tree
Hide file tree
Showing 4 changed files with 14,388 additions and 10 deletions.
27 changes: 27 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/** @typedef {import("typescript-eslint").Config} Config */

import baseConfig from "@acdh-oeaw/eslint-config";
import nuxtConfig from "@acdh-oeaw/eslint-config-nuxt";
import playwrightConfig from "@acdh-oeaw/eslint-config-playwright";
import tailwindcssConfig from "@acdh-oeaw/eslint-config-tailwindcss";
import vueConfig from "@acdh-oeaw/eslint-config-vue";
import gitignore from "eslint-config-flat-gitignore";

import { withNuxt } from "./.nuxt/eslint.config.mjs";

/** @type {Config} */
const config = [
gitignore(),
...baseConfig,
...vueConfig,
...nuxtConfig,
...tailwindcssConfig,
...playwrightConfig,
{
rules: {
"vue/attributes-order": ["warn", { alphabetical: true }],
},
},
];

export default withNuxt(/** @type {any} */ (config));
26 changes: 26 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,51 @@ export default defineNuxtConfig({
"@": fileURLToPath(new URL("./src", import.meta.url)),
"~": fileURLToPath(new URL("./", import.meta.url)),
},

components: [{ path: "@/components", pathPrefix: false }],

content: {
defaultLocale,
locales: Object.keys(locales),
markdown: {},
},

css: [
"@fontsource-variable/inter/slnt.css",
"tailwindcss/tailwind.css",
"@/styles/index.css",
"vuetify/lib/styles/main.sass",
"@mdi/font/css/materialdesignicons.css",
],

devtools: {
enabled: true,
},

dir: {
public: "../public",
},

imports: {
dirs: ["../stores", "./stores", "types"],
},

experimental: {
componentIslands: true,
renderJsonPayloads: false,
},

pinia: {
// @ts-ignore
autoImports: ["defineStore", "acceptHMRUpdate"],
},

piniaPersistedstate: {
cookieOptions: {
sameSite: "strict",
},
},

i18n: {
baseUrl: process.env.NUXT_PUBLIC_APP_BASE_URL,
defaultLocale,
Expand All @@ -53,6 +63,7 @@ export default defineNuxtConfig({
locales: Object.values(locales),
strategy: "prefix",
},

shadcn: {
/**
* Prefix for all the imported component
Expand All @@ -64,28 +75,38 @@ export default defineNuxtConfig({
*/
componentDir: "./src/components/ui",
},

modules: [
"@nuxt/content",
"@nuxt/devtools",
"@nuxt/eslint",
"@nuxtjs/i18n",
"@pinia/nuxt",
"@pinia-plugin-persistedstate/nuxt",
"shadcn-nuxt",
],
eslint: {
config: {
standalone: true,
},
},
nitro: {
compressPublicAssets: true,
},

postcss: {
plugins: {
"tailwindcss/nesting": "postcss-nesting",
tailwindcss: {},
autoprefixer: {},
},
},

routeRules: {
"/": { static: true },
"/imprint": { static: true },
},

runtimeConfig: {
BOTS: process.env.BOTS,
ENV_VALIDATION: process.env.ENV_VALIDATION,
Expand All @@ -99,10 +120,13 @@ export default defineNuxtConfig({
NUXT_PUBLIC_REDMINE_ID: process.env.NUXT_PUBLIC_REDMINE_ID,
},
},

build: {
transpile: ["vuetify"],
},

srcDir: "./src/",

typescript: {
shim: false,
strict: true,
Expand All @@ -116,4 +140,6 @@ export default defineNuxtConfig({
},
},
},

compatibilityDate: "2024-09-06",
});
24 changes: 14 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"format:fix": "pnpm run format:check --write",
"lint:check": "run-p --continue-on-error \"lint:*:check\"",
"lint:fix": "run-p --continue-on-error \"lint:*:fix\"",
"lint:code:check": "eslint . --cache --ext .js,.ts,.vue --ignore-path ./.gitignore",
"lint:code:check": "eslint . --cache",
"lint:code:fix": "pnpm run lint:code:check --fix",
"lint:styles:check": "stylelint \"./**/*.@(css|vue)\" --cache --ignore-path ./.gitignore",
"lint:styles:fix": "pnpm run lint:styles:check --fix",
Expand Down Expand Up @@ -60,17 +60,21 @@
"zipcelx": "^1.6.2"
},
"devDependencies": {
"@acdh-oeaw/eslint-config": "^1.0.5",
"@acdh-oeaw/eslint-config-nuxt": "^1.0.11",
"@acdh-oeaw/eslint-config-vue": "^1.0.10",
"@acdh-oeaw/prettier-config": "^1.0.1",
"@acdh-oeaw/stylelint-config": "^1.0.7",
"@acdh-oeaw/tsconfig": "^1.0.2",
"@acdh-oeaw/eslint-config": "^2.0.0",
"@acdh-oeaw/eslint-config-nuxt": "^2.0.3",
"@acdh-oeaw/eslint-config-playwright": "^2.0.1",
"@acdh-oeaw/eslint-config-tailwindcss": "^2.0.0",
"@acdh-oeaw/eslint-config-vue": "^2.0.3",
"@acdh-oeaw/prettier-config": "^2.0.0",
"@acdh-oeaw/stylelint-config": "^2.0.3",
"@acdh-oeaw/tailwindcss-preset": "^0.0.22",
"@acdh-oeaw/tsconfig": "^1.1.1",
"@axe-core/playwright": "^4.8.4",
"@fontsource-variable/inter": "^5.0.16",
"@hey-api/openapi-ts": "^0.34.5",
"@highcharts/map-collection": "^2.1.0",
"@nuxt/devtools": "^0.6.7",
"@nuxt/eslint": "^0.5.6",
"@nuxt/test-utils": "^3.14.1",
"@pinia-plugin-persistedstate/nuxt": "^1.2.0",
"@playwright/test": "^1.41.1",
Expand All @@ -80,8 +84,8 @@
"@types/node": "^20.11.10",
"@vue/test-utils": "^2.4.6",
"autoprefixer": "^10.4.17",
"eslint": "^8.56.0",
"eslint-plugin-tailwindcss": "^3.14.1",
"eslint": "^9.9.1",
"eslint-config-flat-gitignore": "^0.3.0",
"happy-dom": "^15.0.0",
"highcharts": "^11.3.0",
"highcharts-vue": "^1.4.3",
Expand All @@ -97,7 +101,7 @@
"schema-dts": "^1.1.2",
"shadcn-nuxt": "^0.10.4",
"simple-git-hooks": "^2.9.0",
"stylelint": "^15.11.0",
"stylelint": "^16.9.0",
"swagger-typescript-api": "^13.0.13",
"tailwindcss": "^3.4.1",
"tailwindcss-animate": "^1.0.7",
Expand Down
Loading

0 comments on commit d1a70ef

Please sign in to comment.