eslint.config.mjs 2.01 KB
import antfu from "@antfu/eslint-config";

export default antfu({
// Type of the project. 'lib' for libraries, the default is 'app'
  type: "app",

  rules: {
    "antfu/if-newline": 0,
    "antfu/curly": 0,
  },

  // Enable stylistic formatting rules
  // stylistic: true,

  // Or customize the stylistic rules
  stylistic: {
    indent: 2, // 4, or 'tab'
    semi: true,
    stylistic: true,
    quotes: "double", // 'single' or 'double'
  },

  // TypeScript and Vue are autodetected, you can also explicitly enable them:
  typescript: true,
  vue: true,

  // Disable jsonc and yaml support
  jsonc: false,
  markdown: false,
  yaml: false,

  // `.eslintignore` is no longer supported in Flat config, use `ignores` instead
  ignores: [
    "**/fixtures",
    "**/.cache",
    "**/.data",
    "**/.gitignore",
    "**/.env",
    "**/.env.dist",
    "**/.output",
    "**/.nitro",
    "**/.nuxt",
    "**/assets",
    "**/dist",
    "**/logs",
    "**/node_modules",
    "**/public",
    "**/server",
  ],
});

// Ancienne config eslint.
// import withNuxt from "./.nuxt/eslint.config.mjs";
// import js from "@eslint/js";
// import eslintPluginVue from "eslint-plugin-vue";
// import ts from "typescript-eslint";
//
// const TsConfigRecommended = ts.configs.recommended;
//
// export default withNuxt(
//   // Your custom configs here
//   js.configs.recommended,
//   // eslint-disable-next-line @typescript-eslint/ban-ts-comment
//   // @ts-expect-error
//   ...TsConfigRecommended,
//   ...eslintPluginVue.configs["flat/recommended"],
//   {
//     files: ["*.vue", "**/*.vue"],
//     languageOptions: {
//       parserOptions: {
//         parser: "@typescript-eslint/parser",
//       },
//     },
//     rules: {
//       "vue/multi-word-component-names": "off",
//     },
//   },
//   // your custom flat configs go here, for example:
//   // {
//   //   files: ['**/*.ts', '**/*.tsx'],
//   //   rules: {
//   //     'no-console': 'off' // allow console.log in TypeScript files
//   //   }
//   // },
//   // {
//   //   ...
//   // }
// );