Skip to content

Deprecated filter complains about stage 1 pipeline operator #1344

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

Closed
ssipos90 opened this issue Oct 26, 2020 · 2 comments · Fixed by #1365
Closed

Deprecated filter complains about stage 1 pipeline operator #1344

ssipos90 opened this issue Oct 26, 2020 · 2 comments · Fixed by #1365

Comments

@ssipos90
Copy link

Tell us about your environment

  • ESLint version: 7.7
  • eslint-plugin-vue version: 6.2.2
  • Node version: 12
  • Operating System: linux

Please show your full configuration:

/* eslint-disable quote-props */
module.exports = {
  root: true,
  env: {
    node: true,
    'cypress/globals': true
  },
  extends: [
    'plugin:vue/essential',
    '@vue/standard'
  ],
  rules: {
    'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'vue/no-confusing-v-for-v-if': 'warn',
    'vue/order-in-components': 'warn',
    'vue/this-in-template': 'warn',
    'vue/html-self-closing': 'warn',
    'semi': ['error', 'always'],
    'vue/script-indent': ['warn', 2, {
      'baseIndent': 0
    }],
    'vue/attributes-order': ['warn', {
      'order': [
        'DEFINITION',
        'LIST_RENDERING',
        'CONDITIONALS',
        'RENDER_MODIFIERS',
        'GLOBAL',
        'TWO_WAY_BINDING',
        'EVENTS',
        'CONTENT',
        'UNIQUE',
        'OTHER_DIRECTIVES',
        'OTHER_ATTR'
      ],
      'alphabetical': false
    }],
    'vuetify/no-deprecated-classes': 'error',
    'vuetify/grid-unknown-attributes': 'warn',
    'vuetify/no-legacy-grid': 'warn',
    'no-prototype-builtins': 'off'
  },
  plugins: [
    'vue',
    'vuetify',
    'cypress'
  ],
  parserOptions: {
    parser: 'babel-eslint'
  }
};

What did you do?
Using the pipeline operator and babel

<template>
  <span>{{ true |> boolean }}</span>
</template>
<script>
export default {
  methods: {
    boolean (v) {
      return v ? 'yes' : 'no';
    }
  }
};
</script>

What did you expect to happen?
eslint should not complain.

What actually happened?
eslint complained.

{
        ...
	"message": "[vue/no-deprecated-filter]\nFilters are deprecated.",
	"source": "eslint-plugin-vue"
        ...
}

Repository to reproduce this issue
none

@ssipos90 ssipos90 changed the title Deprecated filter Deprecated filter complains about stage 1 pipeline operator Oct 26, 2020
@ota-meshi
Copy link
Member

Thank you for this issue.
This is a parser issue. The parser now parses | as a Vue2 filter. We need to add an option to the parser it to parse as JavaScript.

@ota-meshi
Copy link
Member

Try turning off parserOptions.vueFeatures.filter using v7.2.0 of vue-eslint-parser.

      parserOptions: {
        vueFeatures: { filter: false }
      }

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

Successfully merging a pull request may close this issue.

2 participants