Skip to content

Support for new eslint flat config #28

@IlyaSemenov

Description

@IlyaSemenov

The eslint flat config is the new recommended approach.

I believe this plugin should be updated to either support it alongside the deprecated eslintrc config, or switch to the new format fully.


For the reference, in the meanwhile, one can "manually" craft the config with something like:

import defineConfig from "@antfu/eslint-config"
import vuePug from "eslint-plugin-vue-pug"

export default defineConfig(
  {
    // Use @antfu/eslint-config for the sake of not configuring vue manually.
  },
  {
    // Combined from eslint-plugin-vue-pug/lib/configs/*.js
    name: "vue-pug",
    files: ["**/*.vue"],
    languageOptions: {
      parserOptions: {
        templateTokenizer: { pug: "vue-eslint-parser-template-tokenizer-pug" },
      },
    },
    plugins: {
      "vue-pug": vuePug,
    },
    rules: {
      // base
      "vue/component-name-in-template-casing": "off",
      "vue/html-self-closing": "off",
      "vue/html-end-tags": "off",
      "vue/html-indent": "off",
      "vue/multiline-html-element-content-newline": "off",
      "vue/singleline-html-element-content-newline": "off",
      // vue3-essential
      "vue-pug/no-parsing-error": "error",
      // vue3-strongly-recommended
      "vue-pug/no-pug-control-flow": "warn",
    },
  },
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions