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

style(code): implements eslint & prettier #31

Merged
merged 2 commits into from Mar 17, 2018
Merged

Conversation

axe312ger
Copy link
Owner

  • Adds and applies eslint with standard config
  • Adds and applies prettier with standard config
  • Adds husky to enfore clean code on pre commit

BREAKING CHANGE: lib return values are now camelCased

This is my first step to get this lib in 2018 shape. 99% of the changes are auto fixed from eslint or prettier. I'd keep this in the next branch and start releasing 1.0.0-alpha's as soon we got the plugin system running.

Next step might be upgrading all dependencies.

@axe312ger axe312ger requested a review from efegurkan March 9, 2018 16:30
@axe312ger axe312ger mentioned this pull request Mar 11, 2018
7 tasks
@@ -1,175 +1,1770 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should ignore this since this files is managed by npm, not by hand

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure I did touch it via npm only, no prettier or eslint included. Will regenerate it to ensure this :)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, no changes did show up after deleting the file and reinstalling. Should be fine as it is :)

src/index.js Outdated
const sizeOf = require('image-size')
const argv = require('argv')
const os = require('os')
const childProcess = require('childProcess')
Copy link
Collaborator

@efegurkan efegurkan Mar 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Package name is child_process so this is going to brake,

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😱 omg yes, sorry for this one 😅

BREAKING CHANGE: lib return values are now camelCased
src/index.js Outdated
const sizeOf = require('image-size')
const argv = require('argv')
const os = require('os')
const childProcess = require('child-process')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is still wrong ? 😄

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also eslint will fail on camelcase I assume, for that we can disable check for that line.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what u mean here. Camelcase is enforced for variable names, not for module names/string content 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it is not failing on ESLint as you said sorry :)

But child_process module is with underscore instead of dash.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Omg. Sure! Note to myself: Test the code before pushing.

Usually I do that but since we plan do do more for the next version I actually did not test this commit. Sorry

@axe312ger
Copy link
Owner Author

@efegurkan fixed 😅

@efegurkan
Copy link
Collaborator

@axe312ger LGTM, feel free to merge it :)

@axe312ger axe312ger merged commit 84ef7d4 into next Mar 17, 2018
@axe312ger axe312ger deleted the style/eslint-prettier branch March 17, 2018 14:12
axe312ger added a commit that referenced this pull request Apr 14, 2018
BREAKING CHANGE: lib return values are now camelCased
koszta pushed a commit to fuww/sqip that referenced this pull request Feb 4, 2019
BREAKING CHANGE: lib return values are now camelCased
axe312ger added a commit that referenced this pull request Mar 2, 2019
BREAKING CHANGE: lib return values are now camelCased
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.

None yet

2 participants