Skip to content

eslint --fix broken <script> target #367

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
moersing opened this issue Jan 29, 2018 · 1 comment · Fixed by #374
Closed

eslint --fix broken <script> target #367

moersing opened this issue Jan 29, 2018 · 1 comment · Fixed by #374
Labels

Comments

@moersing
Copy link

moersing commented Jan 29, 2018

Tell us about your environment

  • ESLint Version: 4.10.0
  • eslint-plugin-vue Version: 4.2.2
  • Node Version: 8.7.0

Please show your full configuration:

{
  "extends": [
    "plugin:vue/essential",
    "standard"
  ],
  "plugins": [
    "vue"
  ],
  "parserOptions": {
    "parser": "babel-eslint",
    "ecmaVersion": 2017,
    "sourceType": "module"
  },
  "rules": {
    "indent": "off",
    "vue/script-indent": [
      "error",
      2,
      {
        "baseIndent": 1
      }
    ]
  }
}




What did you do? Please include the actual source code causing the issue.

<script >export default {
    data () {
      return {
        msg: 'hello vue',
        logo: require('images/logo.png')
      }
    },
    methods: {
      printDemo () {
        console.log(this.msg)
      }
    }
  }
</script >

What did you expect to happen?

<script >
export default {
    data () {
      return {
        msg: 'hello vue',
        logo: require('images/logo.png')
      }
    },
    methods: {
      printDemo () {
        console.log(this.msg)
      }
    }
  }
</script >

What actually happened? Please include the actual, raw output from ESLint.

/// Here was missing......
  export default {
    data () {
      return {
        msg: 'hello vue',
        logo: require('images/logo.png')
      }
    },
    methods: {
      printDemo () {
        console.log(this.msg)
      }
    }
  }
</script >

I want use eslint --fix to format my code , But I found an error , Just the script was missing.

@mysticatea mysticatea added the bug label Feb 2, 2018
@mysticatea
Copy link
Member

Thank you for the report.

I confirmed it on online demo.

I had forgotten the possibility that there is no linebreak after the <script> tag.

michalsnik pushed a commit that referenced this issue Apr 1, 2018
* Add Vue.extend support, add missing info about Vue.mixin check in readme

* Docs: fixes wording in docs (#372)

* Fix: fix script-indent to prevent removing <script> tag (fixes #367) (#374)

*  [Update] Make `vue/max-attributes-per-line` fixable (#380)

* [Update] Make `vue/max-attributes-per-line` fixable

* [fix] bug and style

* [fix] Switch indent calculation method with node and attribute

* [fix] don't handle indentation

* [add] autofix test max-attributes-per-line.js

* Update: make `vue/order-in-components` fixable (#381)

* [Update] Make `vue/order-in-components` fixable

This Commit makes `vue/order-in-components` fixable.
In case of `The "A" property should be above the "B" property` error, autofix will move A before B

* [fix] fail test at [email protected]

* [fix] If there is a possibility of a side effect, don't autofix

* [fix] failed test at node v4

* [update] use Traverser

* [fix] failed test [email protected]

* [fix] I used `output: null` to specify "not fix"

* Fix: no-async-in-computed-properties crash (fixes #390)

* Fix: valid-v-on false positive (fixes #351)

* Fix: indent rules false positive (fixes #375)

* [New] Add `prop-name-casing`

* fix message and category

* fix category

* fix test message

* Set category to undefined

* Add more tests and fix edge case scenario

* attribute order linting

* updating docs, tests and category

* [Update] Make `vue/attributes-order` fixable

* [fix] That `vue/attributes-order` got duplicated when merging README

* [add] messed order properties test case

* [fix] unify input on test case
michalsnik pushed a commit that referenced this issue Jul 11, 2018
* Add Vue.extend support, add missing info about Vue.mixin check in readme

* Docs: fixes wording in docs (#372)

* Fix: fix script-indent to prevent removing <script> tag (fixes #367) (#374)

*  [Update] Make `vue/max-attributes-per-line` fixable (#380)

* [Update] Make `vue/max-attributes-per-line` fixable

* [fix] bug and style

* [fix] Switch indent calculation method with node and attribute

* [fix] don't handle indentation

* [add] autofix test max-attributes-per-line.js

* Update: make `vue/order-in-components` fixable (#381)

* [Update] Make `vue/order-in-components` fixable

This Commit makes `vue/order-in-components` fixable.
In case of `The "A" property should be above the "B" property` error, autofix will move A before B

* [fix] fail test at [email protected]

* [fix] If there is a possibility of a side effect, don't autofix

* [fix] failed test at node v4

* [update] use Traverser

* [fix] failed test [email protected]

* [fix] I used `output: null` to specify "not fix"

* Fix: no-async-in-computed-properties crash (fixes #390)

* Fix: valid-v-on false positive (fixes #351)

* Fix: indent rules false positive (fixes #375)

* [New] Add `prop-name-casing`

* fix message and category

* fix category

* fix test message

* Set category to undefined

* Add more tests and fix edge case scenario

* attribute order linting

* updating docs, tests and category

*  [New] Add rule `vue/no-use-v-if-with-v-for` (#2)

* [fix] `meta.docs.description` should not end with `.`  consistent-docs-description

* [fix] lint error caused by merging the master for conflict resolution

* [fix] That `vue/attributes-order` got duplicated when merging README

* [fixed] document `correct` and `incorrect` the contrary stated

* [fixed] error message
michalsnik pushed a commit that referenced this issue Jul 30, 2018
* Add Vue.extend support, add missing info about Vue.mixin check in readme

* Docs: fixes wording in docs (#372)

* Fix: fix script-indent to prevent removing <script> tag (fixes #367) (#374)

*  [Update] Make `vue/max-attributes-per-line` fixable (#380)

* [Update] Make `vue/max-attributes-per-line` fixable

* [fix] bug and style

* [fix] Switch indent calculation method with node and attribute

* [fix] don't handle indentation

* [add] autofix test max-attributes-per-line.js

* Update: make `vue/order-in-components` fixable (#381)

* [Update] Make `vue/order-in-components` fixable

This Commit makes `vue/order-in-components` fixable.
In case of `The "A" property should be above the "B" property` error, autofix will move A before B

* [fix] fail test at [email protected]

* [fix] If there is a possibility of a side effect, don't autofix

* [fix] failed test at node v4

* [update] use Traverser

* [fix] failed test [email protected]

* [fix] I used `output: null` to specify "not fix"

* [New] Add `vue/component-name-in-template-casing`

* [update] documents

* [fix] require-meta-docs-url

* [fix] failed tests

* [fix] review contents

* Default case to constant. and used it. `const defaultCase = 'PascalCase'`
* `'category'` to `undefined`
* Add empty line for clarity
* I used object shorthand. `caseType: caseType` to `caseType`

* [fix] No deletes space and attributes of endTag

* [fix] Remove test unnecessary option

* [fix] lint error caused by merging the master for conflict resolution

* Add ignores option.

* Fixed that extra differences.

* update docs link

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

Successfully merging a pull request may close this issue.

2 participants