Skip to content

Conversation

Anemy
Copy link
Member

@Anemy Anemy commented Jan 4, 2021

This PR adds a lint check for our check script, which runs in the precommit. Updated our eslint to search all the files, and added all of our entries to the dependency check which mongodb-js-precommit runs.

This PR includes fixes for the existing lint errors, and some of the errors. There are still a couple warnings (see screenshot below). Also updates a couple of our dependencies and our eslint config generation to be a bit cleaner and work with the new deps.

Here's what the commit output now looks like:
Screen Shot 2021-01-04 at 6 34 43 AM

Looks like mongodb-js-precommit is throwing en error when trying to lint now. I think we want to add an optional parameter to skip the lint check. Haven't looked into what's causing it to fail yet.
Screen Shot 2021-01-04 at 6 38 46 AM

@Anemy Anemy requested a review from alenakhineika January 4, 2021 06:21
@Anemy Anemy changed the title chore: Add lint to check chore(code-lint): Add lint to check Jan 4, 2021
@mcasimir
Copy link
Contributor

mcasimir commented Jan 4, 2021

Error: Callback was already called is haunting VSCode too :)

Copy link
Contributor

@mcasimir mcasimir left a comment

Choose a reason for hiding this comment

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

Nice! Maybe Alena wants to review this too.

return vscode.FileType.SymbolicLink;
}

return vscode.FileType.Unknown;
Copy link
Contributor

Choose a reason for hiding this comment

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

Thx :)

}))
label: item.name,
kind: CompletionItemKind.Value
}))
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this endless adding/deleting spaces be fixed by this PR with lint improvements?

Copy link
Member Author

Choose a reason for hiding this comment

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

With #231 yes

@Anemy
Copy link
Member Author

Anemy commented Jan 4, 2021

@mcasimir Removed the mongodb-js-precommit dependency and added depcheck. Looks like it's doing a better job than dependency-check was doing too, updated package.json to remove a few unused deps and explicitly add download and fs-extra which we didn't have. Here's what the precommit output looks like now:
Screen Shot 2021-01-04 at 2 19 14 PM

@Anemy Anemy changed the title chore(code-lint): Add lint to check chore(code-lint): Add lint to check VSCODE-215 Jan 5, 2021
@Anemy Anemy changed the title chore(code-lint): Add lint to check VSCODE-215 chore(code-lint): Add lint to check (VSCODE-215) Jan 5, 2021
package.json Outdated
"@types/ws": "^7.2.4",
"@typescript-eslint/eslint-plugin": "^2.19.2",
"@typescript-eslint/parser": "^2.19.2",
"@typescript-eslint/eslint-plugin": "^4.11.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

This and "@typescript-eslint/parser" are already 4.12.0

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 will rebase once the editing playground results pr goes through and then we can look at this again and merge.

@Anemy
Copy link
Member Author

Anemy commented Jan 11, 2021

@Anemy Anemy force-pushed the add-lint-to-check branch from 27d2cb1 to 036801b Compare January 12, 2021 13:07
@Anemy
Copy link
Member Author

Anemy commented Jan 12, 2021

@alenakhineika @mcasimir rebased off master, fixed those issues. Also added parser: '@typescript-eslint/parser' and 'plugin:@typescript-eslint/recommended-requiring-type-checking' to the eslint config. They introduce a ton of warnings, but they all look like good warnings. I think we can reduce them overtime. Want to try them out and see if there are any we should change? We can also do in future prs if better too.

Something I noticed in a number of our tests is we're importing sinon and sometimes other packages as any types which could lead to some misuse/broken tests. I'll address those in a later pr. We could also definitely reduce the amount of any in this project a lot lol.

@Anemy Anemy merged commit 6e96bfa into master Jan 12, 2021
@Anemy Anemy deleted the add-lint-to-check branch January 12, 2021 16:46
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.

3 participants