Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

JS file is auto formatted after edit #518

Closed
bnjmnt4n opened this issue Jun 10, 2016 · 6 comments
Closed

JS file is auto formatted after edit #518

bnjmnt4n opened this issue Jun 10, 2016 · 6 comments

Comments

@bnjmnt4n
Copy link

The JavaScript code is automatically formatted after I edit it, which I did not expect at first. I removed the eslint --fix option in package.json for linting, but it still automatically formats my code when I run phenomic. Is there a way to disable that?

@MoOx
Copy link
Owner

MoOx commented Jun 10, 2016

Take a look to the eslint-loader configuration in webpack.config file, You will see it over there. "eslint-loader?fix",. Just remove ?fix and it should be good.
Just curious, what is the problem with this autofix behavior?

@bnjmnt4n
Copy link
Author

bnjmnt4n commented Jun 30, 2016 via email

@kennu
Copy link

kennu commented Aug 22, 2016

I also found this very annoying since I don't agree with most of the formatting defaults, like double-quotes and spaces inside { }. So I spent lots of time adding exceptions to the default rules.

Also, the auto-formatting completely breaks with this tag:

<ReactBootstrapSlider
  value={ this.state.width }
  handleChange={ this.changeValue }
  step={ this.state.step }
  max={ this.state.max }
  min={ this.state.min }
  orientation="horizontal"
  disabled={ this.props.logoVariation ? "" : "disabled" } />

(It generates 3 kilobytes of spaces before the closing tag />)

Anyway, I was able to turn it off, thanks for the instructions @MoOx.

@MoOx
Copy link
Owner

MoOx commented Aug 22, 2016

I will remove the too strict config by default in a near future. Please track #631.

@MoOx MoOx added the docs label Aug 22, 2016
@MoOx
Copy link
Owner

MoOx commented Aug 22, 2016

(It generates 3 kilobytes of spaces before the closing tag />)

This is probably an eslint issue that should be reported :)

@MoOx
Copy link
Owner

MoOx commented Sep 16, 2016

Easy fix: just remove "?fix" in webpack config of the defautl theme.

@MoOx MoOx closed this as completed in b641f0f Sep 16, 2016
MoOx pushed a commit that referenced this issue Sep 17, 2016
* Use stateless components (#747)

* Removed: eslint-loader "fix" option has been removed from theme-base (#752)

 Closes #518.

* Upgrade babel-plugin-flow-react-proptypes to ^0.10.1
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants