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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade ESLint and all dependencies #79

Merged
merged 16 commits into from Aug 21, 2019

Conversation

mroderick
Copy link
Member

@mroderick mroderick commented Aug 19, 2019

This PR upgrades ESLint and all related packages to latest versions.

Purpose (TL;DR)

In order to prepare for linting JSDoc, I thought it would be a good idea to get samsam caught up with the other projects.

That turned out to be more work than I anticipated 馃槷

Solution

  • Upgrade ESLint and related plugins and configs
  • Fix lint violations
  • Import no-prototype-methods from sinon
  • Fix even more lint violations

How to verify - mandatory

  1. Check out this branch
  2. npm install
  3. npm run lint
  4. `npm test``
  5. Observe that all is green

Checklist for author

  • npm run lint passes
  • References to standard library functions are cached ... because ESLint now validates this 馃殌

@mroderick mroderick force-pushed the upgrade-eslint branch 2 times, most recently from d45f474 to 323fe76 Compare August 19, 2019 21:17
@mroderick mroderick changed the title WIP: Upgrade ESLint and all dependencies Upgrade ESLint and all dependencies Aug 19, 2019
@coveralls
Copy link

coveralls commented Aug 19, 2019

Pull Request Test Coverage Report for Build 307

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 5 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.02%) to 98.017%

Files with Coverage Reduction New Missed Lines %
create-set.js 1 81.25%
deep-equal.js 2 97.5%
match.js 2 97.58%
Totals Coverage Status
Change from base Build 300: 0.02%
Covered Lines: 464
Relevant Lines: 472

馃挍 - Coveralls

@mroderick mroderick force-pushed the upgrade-eslint branch 2 times, most recently from db0466b to 9095be1 Compare August 20, 2019 19:30
In order to prepare for future improvements, where the
`local-rules/no-prototype-methods` eslint rule detects errors, we
upgrade @sinonjs/commons to a version that has cached references to
`Map` and `Set`.
In order to satisfy `local-rules/no-prototype-methods`
In order to satisfy `local-rules/no-prototype-methods`
In order to satisfy `local-rules/no-prototype-methods`
In order to satisfy `local-rules/no-prototype-methods`
In order to satisfy `local-rules/no-prototype-methods`
In order to satisfy `local-rules/no-prototype-methods`
This allows us to lint for uncached uses of the object prototypes, which
can be stubbed in userland code.
This allows ESLint to detect when uncached references to prototypes are
used.

* Install eslint-plugin-local-rules plugin
* Configure ESLint to use plugin
    * Ignore errors in tests
As this can take many different forms
In preparation of upgrading to `eslint@latest` and
`eslint-config-sinon@latest`
In preparation of upgrading to `eslint@latest` and
`eslint-config-sinon@latest`
In preparation of upgrading to `eslint@latest` and
`eslint-config-sinon@latest`
In preparation of upgrading to `eslint@latest` and
`eslint-config-sinon@latest`
In preparation of upgrading to `eslint@latest` and
`eslint-config-sinon@latest`
* And all related plugins and configs
* Update eslintrc.yaml to meet `eslint@6` required format
@mroderick mroderick marked this pull request as ready for review August 20, 2019 19:35
Copy link
Contributor

@mgred mgred left a comment

Choose a reason for hiding this comment

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

LGTM 馃憤

@@ -74,6 +74,7 @@ function propertyMatcherTests(matcher, additionalTests) {
it("compares with matcher", function() {
var has = matcher("callback", createMatcher.typeOf("function"));

// eslint-disable-next-line no-empty-function
Copy link
Member

Choose a reason for hiding this comment

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

I think you can alternatively write function () { /* empty */ }. Just sayin, no need to change here.

@@ -0,0 +1,79 @@
"use strict";
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this something we'd need in all projects? Shouldn't it live in the sinon eslint project?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is. In the interest of getting this moving, I opted for a bit of duplication, until we figure out how to get it distributed properly.

@mroderick mroderick merged commit 5db326e into sinonjs:master Aug 21, 2019
@mroderick mroderick deleted the upgrade-eslint branch August 21, 2019 15:55
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

4 participants