Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please provide an example .eslintrc.js in README #127

Open
nopeless opened this issue Mar 22, 2024 · 1 comment
Open

please provide an example .eslintrc.js in README #127

nopeless opened this issue Mar 22, 2024 · 1 comment

Comments

@nopeless
Copy link

vuejs/eslint-plugin-vue#2434

#114

#92

I think it's best if we put examples for javascript and typescript setup

@alecStewart1
Copy link

alecStewart1 commented Jun 19, 2024

May not be the place to mention, but I know that @antfu/eslint-config is a fairly popular configuration to use, and that uses the "flat config" of ESLint. And example eslint.config.js would be:

import antfu from '@antfu/eslint-config';

export default antfu(
  {
    vue: true,
    formatters: {
      css: true,
      html: true,
      graphql: false,
      markdown: false,
    },
    stylistic: {
      indent: 2,
      quotes: 'single',
      semi: true,
    },
    rules: {
      'prefer-arrow-callback': [
        'error',
        { allowNamedFunctions: true },
      ],
      'arrow-body-style': [
        'error',
        'as-needed',
        { requireReturnForObjectLiteral: false },
      ],
      'func-style': [
        'error',
        'declaration',
        { allowArrowFunctions: true },
      ],
      'vue/attribute-hyphenation': [
        'error',
        'always',
      ],
      'vue/mustache-interpolation-spacing': [
        'error',
        'always',
      ],
      'vue/no-spaces-around-equal-signs-in-attribute': ['error'],
      'vue/max-attributes-per-line': [
        'error',
        {
          singleline: {
            max: 2,
          },
          multiline: {
            max: 1,
          },
        },
      ],
      'vue/v-on-event-hyphenation': [
        'error',
        'always',
        {
          autofix: true,
          ignore: [],
        },
      ],
    },
  },
);

I don't know if the flat config will be the defacto way of configuring ESLint, but this could a start to this issue.

And I guess in this case, would it also be good to show how people could use existing ESLint configurations with this module? Again, maybe this is not the place to ask this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants