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

'vue/no-deprecated-scope-attribute' doesn't work #996

Closed
boggddan opened this issue Dec 5, 2019 · 1 comment
Closed

'vue/no-deprecated-scope-attribute' doesn't work #996

boggddan opened this issue Dec 5, 2019 · 1 comment

Comments

@boggddan
Copy link

boggddan commented Dec 5, 2019

Tell us about your environment

  • ESLint version: 6.7.2
  • eslint-plugin-vue version: 6.0.1
  • Node version: 12.13.0

Please show your full configuration:

.eslintrc.js

module.exports = {
  root: true,
  env: {
    node: true
  },
  extends: [
    '@vue/eslint-config-airbnb',
    'plugin:vue/strongly-recommended',
    'plugin:vue/recommended',
    'plugin:vue/essential'
  ],
  rules: {
    'vue/html-quotes': ['error',  'single'],
    'vue/no-spaces-around-equal-signs-in-attribute': 'off',

    'vue/array-bracket-spacing': ['error', 'never'],
    'vue/arrow-spacing': ['error', { before: true, after: true }],
    'vue/block-spacing': ['error', 'always'],
    'vue/brace-style': ['error', '1tbs', { allowSingleLine: true }],
    'vue/camelcase': ['error', { properties: 'never' }],
    'vue/comma-dangle': ['error', 'never'],

    'vue/component-name-in-template-casing': [
      'error',
      'PascalCase', {
        registeredComponentsOnly: true,
        ignores: []
      }
    ],

    'vue/eqeqeq': ['error', 'always', { null: 'ignore' }],
    'vue/key-spacing': ['error', { beforeColon: false, afterColon: true }],

    'vue/match-component-file-name': [
      'error',
      {
        extensions: [ 'vue', 'jsx', 'js'],
        shouldMatchCase: true
      }
    ],

    'vue/no-boolean-default': ['error', 'default-false'],

    'vue/no-restricted-syntax': 'off',

    // 'vue/no-restricted-syntax': [
    //   'error',
    //   {
    //     'selector': 'VElement > VExpressionContainer CallExpression',
    //     'message': 'Call expressions are not allowed.'
    //   },
    //   {
    //     'selector': 'VElement VAttribute[key.name != "on"] CallExpression',
    //     'message': 'Call expressions are not allowed.'
    //   }
    // ],

    'vue/object-curly-spacing': ['error', 'always'],
    'vue/require-direct-export': 'error',

    // Отключаем за ненадобностью
    // 'vue/script-indent': ['error', 2, {
    //   baseIndent: 0,
    //   switchCase: 0,
    //   ignores: []
    // }],

    'vue/space-infix-ops': 'error',

    'vue/space-unary-ops': [
      'error',
      {
        words: true,
        nonwords: false,
        overrides: {},
      }
    ],

    'vue/v-on-function-call': ['error', 'never'],

    'vue/no-empty-pattern': 'error',

    'vue/dot-location': ['error', 'property'],

    'vue/keyword-spacing': ['error', {
      before: true,
      after: true,
      overrides: {
        return: { after: true },
        throw: { after: true },
        case: { after: true }
      }
    }],

    'vue/no-deprecated-scope-attribute': 'error',

    'vue/valid-v-slot': 'error',

    "vue/v-slot-style": ["error", {
      atComponent: 'v-slot',
      default: 'shorthand',
      named: 'shorthand'
    }],

    // -------------------------------------------------------

    // require or disallow trailing commas (comma-dangle)
    'comma-dangle': ['error', 'never'],

    //Require parens in arrow function arguments (arrow-parens)
    'arrow-parens': ['error', 'as-needed'],

    // Require Radix Parameter (radix)
    radix: ['error', 'as-needed'],

    // Disallow Reassignment of Function Parameters (no-param-reassign)
    'no-param-reassign': ['error', {
      props: true,
      ignorePropertyModificationsFor: ['state', 'config']
    }],

    // disallow the unary operators ++ and -- (no-plusplus)
    'no-plusplus': 'off',

    // disallow bitwise operators (no-bitwise)
    'no-bitwise': ['error', { allow: ['&'] }],

    // Disallow Assignment in return Statement (no-return-assign)
    'no-return-assign': 'off',

    // Disallow use of the void operator. (no-void)
    'no-void': 'off',

    // disallow empty block statements (no-empty)
    'no-empty': ['error', { allowEmptyCatch: true }],

  },
  parserOptions: {
    parser: 'babel-eslint'
  }
};

What did you do?
Doesn't work rule vue/no-deprecated-scope-attribute. eslint does not find an error

<template>
  <ListComponent>
    <!-- ✗ BAD -->
    <template
      slot='name'
      slot-scope='props'
    >
      {{ props.title }}
    </template>
  </ListComponent>
</template>

<script>
export default {
  name: 'Login2'
};
</script>
@ota-meshi
Copy link
Member

ota-meshi commented Dec 6, 2019

Thank you for this issue.

vue/no-deprecated-scope-attribute does not report slot-scope attributes. 'vue/no-deprecated-scope-attribute' reports scope attributes.
scope was available in versions prior to Vue 2.5.

https://vuejs.org/v2/api/index.html#scope-removed

The rule to report the slot-scope attributes is in PR #840.

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