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

Definition for rule 'vue/script-setup-uses-vars' was not found. #1578

Closed
2 tasks done
leonheess opened this issue Jul 22, 2021 · 3 comments
Closed
2 tasks done

Definition for rule 'vue/script-setup-uses-vars' was not found. #1578

leonheess opened this issue Jul 22, 2021 · 3 comments

Comments

@leonheess
Copy link

leonheess commented Jul 22, 2021

Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have read the FAQ and my problem is not listed.

Tell us about your environment

  • ESLint version: 7.31.0
  • eslint-plugin-vue version: 7.14.0
  • Node version: 14.17.3
  • Operating System: Windows 10

Please show your full configuration:

module.exports = {
  extends: [
    'plugin:vue/recommended',
    './base.js',
    './vue.js',
  ],
  rules: {
    'import/no-extraneous-dependencies': 'off',
  },
}

base.js:

module.exports = {
  ignorePatterns: [
    '.*',
    '*.config.js'
  ],
  env: {
    'es6': true,
    'browser': true,
    'node': true,
  },
  plugins: [
    'cypress',
    'prettier',
    'eslint-plugin-no-inline-styles',
  ],
  extends: [
    'eslint:recommended',
    'plugin:cypress/recommended',
    'prettier',
  ],
  rules: {
    'prettier/prettier': 'error',
    'linebreak-style': ['error', 'unix'],
    'no-console': 'warn',
    'no-debugger': 'warn',
    'no-unused-vars': [
      'error',
      {
        'ignoreRestSiblings': true
      }
    ],
    'prefer-const': ['error', {
      'destructuring': 'any',
      'ignoreReadBeforeAssign': false
    }],
    'no-inline-styles/no-inline-styles': 'error',
    'spaced-comment': ['error', 'always', { 'line': { 'exceptions': ['-', '+', '-', '*', '#'] } }],
    'capitalized-comments': [
      'error',
      'always',
      {
        'ignorePattern': 'noinspection|ignored|prettier-ignore',
        'ignoreConsecutiveComments': true
      }
    ]
  },
  overrides: [
    {
      'files': [
        '__tests__/*.{j,t}s?(x)',
        'tests/unit/**/*.spec.{j,t}s?(x)',
      ],
      'env': {
        'jest': true,
      }
    }
  ]
}

vue.js:

module.exports = {
  parser: 'vue-eslint-parser',
  extends: [
    'plugin:vue/essential',
  ],
  rules: {
    'vue/no-v-html': 'off',
    'vue/max-attributes-per-line': 'off',
    'vue/html-self-closing': ['error', {
      'html': {
        'void': 'always',
        'normal': 'never'
      }
    }],
    'vue/singleline-html-element-content-newline': 'off'
  },
}

What actually happened?
Error on every page: Definition for rule 'vue/script-setup-uses-vars' was not found.

@ota-meshi
Copy link
Member

I can't reproduce your problem. I close this issue because your configuration doesn't seem to use eslint-plugin-vue in the first place.

If you can't solve the problem using eslint-plugin-vue, open a new issue and share your repository where you can reproduce the problem.

@leonheess
Copy link
Author

Sorry, I forgot some files - see edit

@rehack
Copy link

rehack commented Aug 9, 2021

@leonheess
script setup is Syntax sugar of vue3
When vue2 project use this rule vue/script-setup-uses-vars,that mean if your eslint-plugin-vue version >= v7.13.0,
an error will occur

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

3 participants