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

Does not support --fix #1

Closed
jasonkuhrt opened this issue Dec 23, 2016 · 7 comments
Closed

Does not support --fix #1

jasonkuhrt opened this issue Dec 23, 2016 · 7 comments

Comments

@jasonkuhrt
Copy link

❯ echo "const a = 'single+semi';" > foobar.js
❯ ./node_modules/.bin/eslint --fix foobar.js

  1:7  error  'a' is assigned a value but never used  no-unused-vars

✖ 1 problem (1 error, 0 warnings)

❯ cat foobar.js
const a = "single+semi"
❯ ccat test.vue
<template>
  <div v-on:click.prevent="activateTab()" v-bind:class="{ active: active }">
    <slot></slot>
  </div>
</template>

<script>
  export default {
    name: 'tab-link',
    data() {
      return {
        storeRegistered: false,
      };
    },
    computed: {
      active() {
        const tab = this.tabs[this.tabGroup];
        const tabName = this.tabName;
        const forceActive = this.forceActive;
        const activeTabName = tab.activeTabName;
        const isActive = !!((tab && activeTabName === tabName) || forceActive);
        return isActive;
      },
      tabs() {
        return this.$store.getters.getTabs;
      },
    },
    props: {
      isDefaultTab: {
        type: Boolean,
      },
      tabGroup: {
        type: String,
        required: true,
      },
      tabName: {
        type: String,
        required: true,
      },
    },
    created() {
      const tab = {};

      tab[this.tabGroup] = {
        activeTabName: this.isDefaultTab ? this.tabName : '',
      };

      if (!this.storeRegistered) {
        this.$store.dispatch('REGISTER_TAB', tab);
        this.storeRegistered = true;
      }
    },
    methods: {
      activateTab() {
        this.$store.dispatch('SET_ACTIVE_TAB', { tabGroup: this.tabGroup, tabName: this.tabName });
      },
    },
  };
</script>

❯ ./node_modules/.bin/eslint --fix test.vue

   9:11  warning  Strings must use doublequote  quotes
  13:8   warning  Extra semicolon               semi
  17:21  error    Unallowed use of `this`       fp/no-this
  17:31  error    Unallowed use of `this`       fp/no-this
  17:45  warning  Extra semicolon               semi
  18:25  error    Unallowed use of `this`       fp/no-this
  18:37  warning  Extra semicolon               semi
  19:29  error    Unallowed use of `this`       fp/no-this
  19:45  warning  Extra semicolon               semi
  20:48  warning  Extra semicolon               semi
  21:79  warning  Extra semicolon               semi
  22:24  warning  Extra semicolon               semi
  25:16  error    Unallowed use of `this`       fp/no-this
  25:43  warning  Extra semicolon               semi
  42:21  warning  Extra semicolon               semi
  44:11  error    Unallowed use of `this`       fp/no-this
  45:24  error    Unallowed use of `this`       fp/no-this
  45:44  error    Unallowed use of `this`       fp/no-this
  45:59  warning  Strings must use doublequote  quotes
  46:8   warning  Extra semicolon               semi
  48:12  error    Unallowed use of `this`       fp/no-this
  49:9   error    Unallowed use of `this`       fp/no-this
  49:30  warning  Strings must use doublequote  quotes
  49:50  warning  Extra semicolon               semi
  50:9   error    Unallowed use of `this`       fp/no-this
  50:36  warning  Extra semicolon               semi
  55:9   error    Unallowed use of `this`       fp/no-this
  55:30  warning  Strings must use doublequote  quotes
  55:60  error    Unallowed use of `this`       fp/no-this
  55:84  error    Unallowed use of `this`       fp/no-this
  55:99  warning  Extra semicolon               semi
  58:4   warning  Extra semicolon               semi

✖ 32 problems (14 errors, 18 warnings)
@znck
Copy link
Member

znck commented Jan 17, 2017

Fixed in #3

Yet to create a release.

@znck znck closed this as completed Jan 17, 2017
@smyth64
Copy link

smyth64 commented Jan 19, 2017

Is there any manual how to use the --fix function?

I'm really fed of things like "Missing space before function parentheses" or "Extra semicolon" xD

@znck
Copy link
Member

znck commented Jan 19, 2017

@yyx990803 Can we publish a beta release?

@chrisvfritz
Copy link
Contributor

@znck I'll publish very soon (probably tomorrow).

@saiberz
Copy link

saiberz commented May 26, 2017

@znck @chrisvfritz btw did you publish it? maybe can we help a bit to publish it?

@znck
Copy link
Member

znck commented May 26, 2017

It's published. I see a release on 24th Jan.

/cc @chrisvfritz

@chrisvfritz
Copy link
Contributor

Confirmed. @saiberz Is it not working for you?

doug-wade pushed a commit to doug-wade/eslint-plugin-vue that referenced this issue Apr 17, 2022
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

5 participants