Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

Add Makefile.js and eslint #15

Merged
merged 2 commits into from
Feb 16, 2017
Merged

Conversation

soda0289
Copy link
Member

We currently have the lint target disabled until the babel is removed. The test run but depend on babel-core/register. When #14 is merged I will turn on the linter.

@soda0289 soda0289 force-pushed the makefile.js branch 3 times, most recently from 6976bf2 to dceb154 Compare February 11, 2017 02:38
@JamesHenry
Copy link
Member

Great stuff, thanks! I'll let you know as soon as #14 is merged

@JamesHenry
Copy link
Member

@soda0289 The build failed: istanbul: not found

@soda0289
Copy link
Member Author

Do we want code coverage? I will just remove it for now.

@JamesHenry
Copy link
Member

JamesHenry commented Feb 11, 2017

Ideally, yes, as that would match up with our other projects. Is it not just a matter of adding istanbul as a devDependency?

@soda0289
Copy link
Member Author

Hmm I'm not sure how travis works. I can add it as dependency and call by the node_modues path. Let me take a look at how eslint does it

@soda0289
Copy link
Member Author

I got code coverage working just going to fix all these linting errors. Give me an hour.

@soda0289 soda0289 force-pushed the makefile.js branch 2 times, most recently from 86bcb70 to ec7326d Compare February 11, 2017 21:10
@soda0289
Copy link
Member Author

It's going to take a little longer to finish fixing all the linting rules. I have pushed a WIP commit but will finish it later this evening.

@soda0289 soda0289 force-pushed the makefile.js branch 3 times, most recently from 7c68b7b to a000184 Compare February 12, 2017 18:15
@soda0289
Copy link
Member Author

@JamesHenry Should be good to go. I disabled some linting rules in the tests, but mostly had to add JSDoc comments and make minor tweaks to get everything passing.

Copy link
Member

@JamesHenry JamesHenry left a comment

Choose a reason for hiding this comment

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

Thanks so much for this @soda0289, this can't have been a fun PR to put together 😄

I just noted the one code change that I believe was made inadvertently

src/scope.js Outdated
@@ -400,19 +422,19 @@ class Scope {
}

__isClosed() {
return this.__left === null;
return this.__left === null || this.__left === undefined;
Copy link
Member

Choose a reason for hiding this comment

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

This is a code change, I have no idea if it is significant, but thought I should point it out as it is not necessary for the PR

Copy link
Member Author

Choose a reason for hiding this comment

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

They had some parts of the code that had != null and == null and I changed those to triple equals with undefined. I can change this one back.

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 saw, and so you did not change that meaning of the code in those cases. Here you did, that's why I am pointing it out

Copy link
Member

Choose a reason for hiding this comment

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

As I say, I have no idea what significance that has, but it's probably worth pointing out

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed it back. Although the tests pass I dont want to risk introducing new bugs.

Copy link
Member

Choose a reason for hiding this comment

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

Exactly 👍 Would be an awful one to track down

@@ -56,7 +61,7 @@ class PatternVisitor extends esrecurse.Visitor {
const lastRestElement = getLast(this.restElements);
this.callback(pattern, {
topLevel: pattern === this.rootPattern,
rest: lastRestElement != null && lastRestElement.argument === pattern,
rest: lastRestElement !== null && lastRestElement.argument === pattern,
Copy link
Member

Choose a reason for hiding this comment

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

Ah here's another code change

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch will fix. Thanks

function traverseIdentifierInPattern(options, rootPattern, referencer, callback) {
// Call the callback at left hand identifier nodes, and Collect right hand nodes.
var visitor = new PatternVisitor(options, rootPattern, callback);
visitor.visit(rootPattern);

// Process the right hand nodes recursively.
if (referencer != null) {
if (referencer !== null) {
Copy link
Member

Choose a reason for hiding this comment

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

Another one

Copy link
Member Author

Choose a reason for hiding this comment

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

Got it. Thanks

@soda0289
Copy link
Member Author

I pushed the changes. Think that's all of them. Thanks for the review

Copy link
Member

@JamesHenry JamesHenry left a comment

Choose a reason for hiding this comment

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

This LGTM now, but given it touches such a large number of files, I would love another pair of eyes on this @eslint/eslint-team

@mikesherov
Copy link

LGTM, only thing I'd say is to add an .eslintrc file to the test directory that extends the main .eslintrc file and allows describe and it as globals.

@soda0289
Copy link
Member Author

@mikesherov Great Idea. I can set environment to mocha in the test directory and that should handle all the globals. Thanks

This adds a Makefile that will run the tests, lint the code, and check licenses
@JamesHenry
Copy link
Member

Is this finalised now @soda0289?

@soda0289
Copy link
Member Author

Yup should be good.

@JamesHenry JamesHenry merged commit 12a1ca1 into eslint:master Feb 16, 2017
@JamesHenry JamesHenry mentioned this pull request Feb 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants