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

Upgrade eslint; fix some new warnings and disable others #145

Merged
merged 1 commit into from
May 7, 2018

Conversation

cdhowie
Copy link
Collaborator

@cdhowie cdhowie commented Apr 9, 2018

Upgrades eslint and related packages to the latest versions available. This fixes three of the bitHound dependency tests (#148). I will be preparing another PR to deal with the remaining five tests, but since this is a fairly far-reaching set of changes, I wanted this one to be reviewed separately.

New warnings either in eslint or in eslint-config-airbnb-base were subsequently triggered and resolved as follows:

  • prefer-destructuring: Disabled. IMO, applying this rule is silly and results in intentionally-obtuse code.
  • no-multi-assign: Disabled. There are many places where we publish functions on exports and internals simultaneously using chained assignments (a = b = c;). IMO, this is useful and makes the code clearer.
  • prefer-spread: Disabled. The spread operator is not supported until Node 6, and we support back to Node 4 according to the CI build.
  • object-curly-newline: Tweaked rule from airbnb-base to remove minParameters; resolved resulting warnings by reformatting object literals to either all be one one line or have one attribute per line.
  • arrow-parens: Resolved warnings. (a => { } forms changed to (a) => { })
  • function-paren-newline: Resolved warnings by reformatting some chained method calls to span multiple lines for improved clarity.
  • import/newline-after-import: Resolved warnings by moving all non-require lines to follow require lines.
  • no-buffer-constructor: Resolved warnings by changing the deprecated new Buffer(...) forms to Buffer.from(...).
  • indent: Resolved warnings by applying consistent indentation rules to the few sections of code that did not conform.
  • no-mixed-operators: Resolved warnings by using parens to explicitly group mathematical operations between different operators. (Particularly in forms like a - b * c, grouping like a - (b * c) makes the author's intent clear, even though that's what's happening anyway.)
  • no-plusplus: Resolved warnings by changing all x++ forms to x += 1.
  • space-unary-ops: Resolved warnings by changing typeof(x) forms to typeof x.
  • no-prototype-builtins: Resolved warnings by replacing x.hasOwnProperty(y) forms with Object.prototype.hasOwnProperty.call(x, y).
  • no-unused-vars: Resolved warnings by removing unused variable declarations.
  • no-restricted-properties: Resolved warnings by replacing x.__defineGetter__() forms with equivalent Object.defineProperty() calls.
  • no-useless-escape: Resolved warnings by removing unnecessary \ characters in string literals.

@cdhowie cdhowie requested review from clarkie and jkav77 April 9, 2018 01:17
@cdhowie cdhowie force-pushed the update-dependencies branch from 994f003 to bf12411 Compare April 20, 2018 16:41
@cdhowie
Copy link
Collaborator Author

cdhowie commented Apr 20, 2018

@clarkie @dangerginger If you guys are able to review this, I would like to get it done sooner rather than later; it touches nearly every source file and there is a high change it will conflict with any future merged PRs.

@cdhowie cdhowie force-pushed the update-dependencies branch 2 times, most recently from b75801b to 5cd635f Compare April 22, 2018 18:58
@coveralls
Copy link

coveralls commented Apr 22, 2018

Coverage Status

Coverage decreased (-0.08%) to 98.541% when pulling f1b343a on cdhowie:update-dependencies into a14b760 on clarkie:master.

@cdhowie cdhowie force-pushed the update-dependencies branch from 5cd635f to f1b343a Compare April 22, 2018 19:03
@cdhowie cdhowie merged commit f1b343a into clarkie:master May 7, 2018
@cdhowie
Copy link
Collaborator Author

cdhowie commented May 7, 2018

@clarkie @dangerginger Since there's been no review activity in 15+ days, I just pushed this. I don't want to hold this up.

@cdhowie cdhowie deleted the update-dependencies branch May 7, 2018 20:15
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