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

Error while loading rule '@typescript-eslint/naming-convention' #44

Open
VinceFanZ opened this issue Jul 11, 2022 · 3 comments
Open

Error while loading rule '@typescript-eslint/naming-convention' #44

VinceFanZ opened this issue Jul 11, 2022 · 3 comments

Comments

@VinceFanZ
Copy link

VinceFanZ commented Jul 11, 2022

Hi,

"@vue/eslint-config-typescript": "^11.0.0",

I set the rules.

.eslintrc.js:

module.exports = {
  root: true,
  env: {
    node: true
  },
  extends: [
    'plugin:vue/vue3-essential',
    'plugin:vue-pug/vue3-recommended',
    '@vue/standard',
    '@vue/eslint-config-typescript/recommended'
  ],
  parserOptions: {
    ecmaVersion: 2020
  },
  rules: {
    'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'prefer-regex-literals': 'off',
    'multiline-ternary': 'off',
    indent: ['error', 2, { SwitchCase: 1, ignoredNodes: ['PropertyDefinition'] }],
    'space-before-function-paren': 'off',
    '@typescript-eslint/no-explicit-any': 'off',
    '@typescript-eslint/camelcase': 'off',
    camelcase: 'off',
    '@typescript-eslint/member-delimiter-style': 'off',
    '@typescript-eslint/no-use-before-define': 'off',
    '@typescript-eslint/no-var-requires': 'off',
    '@typescript-eslint/no-inferrable-types': 'off',
    '@typescript-eslint/naming-convention': [
      'warn',
      {
        selector: 'interface',
        format: ['PascalCase'],
        custom: {
          regex: '^I[A-Z]',
          match: true
        },
        filter: {
          regex: '[wW]indow',
          match: false
        }
      }
    ],
    '@typescript-eslint/explicit-module-boundary-types': 'off',
    'vue/multi-word-component-names': 'off',
    'vue/no-reserved-component-names': 'off',
    'vue/return-in-computed-property': 'warn'
  }
}

The result lint reported an error.

npm run lint 

> vue-cli-service lint

 ERROR  Error: Error while loading rule '@typescript-eslint/naming-convention': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.
        Occurred while linting /Users/test/.eslintrc.js
@brc-dd
Copy link
Member

brc-dd commented Jul 17, 2022

Experiencing same issue. This is the commit that broke this: 8c3628c. Using the previous commit is working fine:

"@vue/eslint-config-typescript": "github:vuejs/eslint-config-typescript#c32ab92"

@freakzlike
Copy link

I fixed my error by setting the parserOptions.parser inside the .eslintrc.js:

parserOptions: {
  parser: '@typescript-eslint/parser'
},

@antonkulakov-it
Copy link

antonkulakov-it commented Dec 5, 2023

works for me:
adding to .eslintrc.js

parserOptions: {
  parser: 'tsconfig.json'
},

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

4 participants