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: update dependencies after dropping support for Node <8 #53

Merged
merged 4 commits into from
Jul 20, 2019

Conversation

kaicataldo
Copy link
Member

@kaicataldo kaicataldo commented Jun 26, 2019

This PR updates some outdated dependencies. I have also run the autofixer and will comment on places I manually changed things.

I haven't worked in this repository very much, so I'd really love feedback/reviews from others! I'm specifically unsure of the TypeScript change (though I think what I have here makes sense?).

CI is failing in Node <=6 because we've dropped support in ESLint v6. Should we also drop support and do a major release of eslint-scope?

Edit: PR can be found here.
Edit 2: As mentioned in #54, Webpack relies on this package directly and still supports Node@6. Maybe we want to keep support for Node 6 (and just drop support for Node 4)? We won't be able to upgrade to the latest version of ESLint in our devDependencies, though.

I've downgraded ESLint to v5 and it now passes CI in Node 6, however this still fails in Node 4. At this point, I guess we should just wait until we drop Node <8.

Edit 3: The TSC resolved to drop Node <8 for this package. See #54.

@@ -93,7 +93,7 @@ function updateDeeply(target, override) {
}

for (const key in override) {
if (override.hasOwnProperty(key)) {
if (Object.prototype.hasOwnProperty.call(override, key)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

96:22  error  Do not access Object.prototype method 'hasOwnProperty' from target object  no-prototype-builtins

This was manually fixed.

});
}

visitPattern(node, options, callback) {
let visitPatternOptions = options;
Copy link
Member Author

Choose a reason for hiding this comment

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

160:13  error  Assignment to function parameter 'callback'     no-param-reassign
161:13  error  Assignment to function parameter 'options'      no-param-reassign

This was manually fixed.

@@ -122,7 +122,7 @@ describe("export declaration", () => {
});

it("should refer exported references#1", () => {
const ast = espree("export {x};");
const ast = espree("const x = 1; export {x};");
Copy link
Member Author

Choose a reason for hiding this comment

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

More recent versions of Espree will throw an error if the export is not defined: SyntaxError: Export 'x' is not defined

});

it("should refer exported references#2", () => {
const ast = espree("export {v as x};");
const ast = espree("const v = 1; export {v as x};");
Copy link
Member Author

Choose a reason for hiding this comment

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

More recent versions of Espree will throw an error if the export is not defined: SyntaxError: Export 'v' is not defined

@@ -29,7 +29,7 @@ const analyze = require("..").analyze;
describe("ES6 super", () => {
it("is not handled as reference", () => {
const ast = espree(`
class Hello {
class Foo extends Bar {
Copy link
Member Author

Choose a reason for hiding this comment

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

More recent versions of Espree will throw an error when super methods are called in methods of a class that is not a subclass: SyntaxError: super() call outside constructor of a subclass

@@ -31,39 +31,22 @@ describe("typescript", () => {

const scopeManager = analyze(ast);

expect(scopeManager.scopes).to.have.length(4);
expect(scopeManager.scopes).to.have.length(2);
Copy link
Member Author

Choose a reason for hiding this comment

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

Does this seem correct? I think this makes sense, since the first two are type definitions and so shouldn't actually create a new scope? Would love it if @bradzacher or @JamesHenry would be so kind to chime in!

Copy link
Member

Choose a reason for hiding this comment

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

Yes. I think that eslint/typescript-eslint-parser#540 has affected it.

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

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

Some minor readability suggestions and one question about consuming ESLint 6, otherwise looks great!

package.json Outdated Show resolved Hide resolved
tests/implied-strict.js Outdated Show resolved Hide resolved
tests/nodejs-scope.js Outdated Show resolved Hide resolved
@kaicataldo
Copy link
Member Author

@platinumazure Thanks for the review! Changes made - ready for re-review :)

@kaicataldo kaicataldo changed the title Upgrade: Update dependencies Upgrade: update dependencies after dropping support for Node <8 Jul 19, 2019
@kaicataldo kaicataldo merged commit e9fa22e into master Jul 20, 2019
@kaicataldo kaicataldo deleted the update-deps branch July 20, 2019 15:07
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

3 participants