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

test: eslint rule making common.js mandatory #3157

Closed
wants to merge 2 commits into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Oct 2, 2015

test/common.js contains code that detects global variable leaks.

This eslint rule checks that a module named common is loaded. It is
only applicable to files in the test directory. Tests that intentionally
leak variables can opt out with an eslint-disable comment.

@Trott Trott added the test Issues and PRs related to the tests. label Oct 2, 2015
@Trott
Copy link
Member Author

Trott commented Oct 2, 2015

/cc @brendanashworth @Fishrock123

@Trott
Copy link
Member Author

Trott commented Oct 2, 2015

@rvagg
Copy link
Member

rvagg commented Oct 2, 2015

lgtm tho I'd suggest 2 commits here, one for eslint and one for the changes in test/

@Trott
Copy link
Member Author

Trott commented Oct 2, 2015

@rvagg OK, I split it into two commits. (Let me know if I should split them into two PRs as well. Otherwise, I'll just apply the same commit log metadata to each commit before merging, assuming no one expresses disapproval of this PR in the next 24 hours or so.)

@rvagg
Copy link
Member

rvagg commented Oct 2, 2015

single PR is fine

@cjihrig
Copy link
Contributor

cjihrig commented Oct 2, 2015

LGTM with one small comment.

@Trott
Copy link
Member Author

Trott commented Oct 2, 2015

@cjihrig Rebased and pushed with the commented-out code removed. Thanks for catching that.

@Fishrock123
Copy link
Contributor

If it's an external module please put in a comment with that that points to the upstream repo. I think that's probably the best way. Still needs the EOF newline fixed though. :)

@Trott
Copy link
Member Author

Trott commented Oct 3, 2015

@Fishrock123 It's not in an external repo yet, but I'm trying: eslint/eslint#4024

@Fishrock123
Copy link
Contributor

@Trott if it's not external can you please make it conform to our styles?

@Fishrock123
Copy link
Contributor

(and I guess lint itself if it doesn't already)

@Trott
Copy link
Member Author

Trott commented Oct 5, 2015

@Fishrock123 Cool. Linting of eslint-rules dir submitted as #3195. Style here changed so it will pass that linting.

common.js contains code that detects leaked variables.

In preparation for an eslint rule that will enforce loading common.js in
test files, load it everywhere it can be loaded and use an
`eslint-disable` comment for files that intentionally leak.
test/common.js contains code that detects global variable leaks.

This eslint rule checks that a module named `common` is loaded. It is
only applicable to files in the test directory. Tests that intentionally
leak variables can opt out with an eslint-disable comment.
@Trott
Copy link
Member Author

Trott commented Oct 6, 2015

One final CI run before landing: https://ci.nodejs.org/job/node-test-pull-request/431/

Assuming no red flags in the CI and no objections from anyone here, I'll land in the next few hours.

Trott added a commit that referenced this pull request Oct 6, 2015
common.js contains code that detects leaked variables.

In preparation for an eslint rule that will enforce loading common.js in
test files, load it everywhere it can be loaded and use an
`eslint-disable` comment for files that intentionally leak.

PR-URL: #3157
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Trott added a commit that referenced this pull request Oct 6, 2015
test/common.js contains code that detects global variable leaks.

This eslint rule checks that a module named `common` is loaded. It is
only applicable to files in the test directory. Tests that intentionally
leak variables can opt out with an eslint-disable comment.

PR-URL: #3157
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@Trott
Copy link
Member Author

Trott commented Oct 6, 2015

Landed in c78091d and 3de353b

@Trott Trott closed this Oct 6, 2015
@jasnell jasnell mentioned this pull request Oct 8, 2015
29 tasks
Trott added a commit that referenced this pull request Oct 8, 2015
common.js contains code that detects leaked variables.

In preparation for an eslint rule that will enforce loading common.js in
test files, load it everywhere it can be loaded and use an
`eslint-disable` comment for files that intentionally leak.

PR-URL: #3157
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Trott added a commit that referenced this pull request Oct 8, 2015
test/common.js contains code that detects global variable leaks.

This eslint rule checks that a module named `common` is loaded. It is
only applicable to files in the test directory. Tests that intentionally
leak variables can opt out with an eslint-disable comment.

PR-URL: #3157
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@Trott Trott deleted the eslint-require-common branch January 13, 2022 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants