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

Remove js-beautify and improve ESLint config #590

Merged
merged 1 commit into from
Sep 4, 2016
Merged

Conversation

SpaceK33z
Copy link
Member

@SpaceK33z SpaceK33z commented Sep 4, 2016

Please check if the PR fulfills these requirements

  • An example has been added or updated in examples/ (for features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior? (You can also link to an open issue here)

Before, there were two linters doing the same thing: linting and fixing lint errors. There were also two commands for this, npm run lint and npm run beautify-lint.
ESLint has gotten extremely popular (especially since JSCS was merged into ESLint) and is very actively developed, so it makes sense to move over to ESLint. Many people also have ESLint setup in their editor.

What is the new behavior?

Now, there is only one linter, ESLint. The js-beautify config is merged in the ESLint config
as best as I could do. There is almost no documentation about the rules of js-beautify,
so this was a bit hard.

ESLint was updated to v3, which provides many powerful rules, and auto-fixing of some rules (with npm run beautify).

npm run beautify-lint was removed, because npm run lint does the same now (which makes sense).

Does this PR introduce a breaking change?

  • Yes
  • No

If this PR contains a breaking change, please describe the following...

  • Impact:
  • Migration path for existing applications:
  • Github Issue(s) this is regarding:

Other information:

I also checked the new ESLint config against the main webpack repo, and adjusted the rules accordingly. This config finds about ~ 50 new errors in the main repo, but these are all very valid (e.g. dead code, inconsistent code style). Optionally, I could update the main webpack repo after this.

Another interesting thing to do would be to make a new repo with this config, eslint-config-webpack. But that's outside the scope of this PR for now.

Pinging @TheLarkInn for review.

Before, there were two linters doing the same thing: linting and fixing lint errors.
Now, there is only one, ESLint. The js-beautify config is merged in the ESLint config
as best as I could do. There is almost no documentation about the rules of js-beautify,
so this was a bit hard.

ESLint was updated to v3, which provides auto-fixing of some rules.

I also checked the new ESLint config against the main webpack repo. This caused some extra
linting errors (~40), but these were all valid violations.
@TheLarkInn
Copy link
Member

LGTM!

@SpaceK33z SpaceK33z merged commit 0b625b9 into master Sep 4, 2016
@SpaceK33z SpaceK33z deleted the linter-peace branch September 4, 2016 21:09
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

Successfully merging this pull request may close these issues.

2 participants