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

Use ESLint selectors in custom rules #17572

Merged
merged 4 commits into from Dec 12, 2017

Conversation

Projects
None yet
5 participants
@cjihrig
Contributor

cjihrig commented Dec 9, 2017

This PR simplifies several of our custom ESLint rules by using selector syntax instead of handwritten functions to identify matching AST nodes.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

tools

@apapirovski

Great stuff! Just a couple of nits for legibility but not critical :)

Show outdated Hide outdated tools/eslint-rules/prefer-assert-methods.js Outdated
Show outdated Hide outdated tools/eslint-rules/prefer-common-mustnotcall.js Outdated
@cjihrig

This comment has been minimized.

Show comment
Hide comment
@cjihrig

cjihrig Dec 11, 2017

Contributor

Pulled selectors out into variables, as requested.

CI: https://ci.nodejs.org/job/node-test-pull-request/12036/

Contributor

cjihrig commented Dec 11, 2017

Pulled selectors out into variables, as requested.

CI: https://ci.nodejs.org/job/node-test-pull-request/12036/

cjihrig added a commit to cjihrig/node-1 that referenced this pull request Dec 12, 2017

tools: simplify prefer-common-mustnotcall rule
PR-URL: nodejs#17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

cjihrig added a commit to cjihrig/node-1 that referenced this pull request Dec 12, 2017

tools: simplify prefer-assert-methods rule
PR-URL: nodejs#17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

cjihrig added a commit to cjihrig/node-1 that referenced this pull request Dec 12, 2017

tools: simplify buffer-constructor rule
PR-URL: nodejs#17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

cjihrig added a commit to cjihrig/node-1 that referenced this pull request Dec 12, 2017

tools: simplify no-let-in-for-declaration rule
PR-URL: nodejs#17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

cjihrig added some commits Dec 9, 2017

tools: simplify prefer-common-mustnotcall rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
tools: simplify prefer-assert-methods rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
tools: simplify buffer-constructor rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
tools: simplify no-let-in-for-declaration rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

@cjihrig cjihrig merged commit 746534b into nodejs:master Dec 12, 2017

@cjihrig cjihrig deleted the cjihrig:lint branch Dec 12, 2017

MylesBorins added a commit that referenced this pull request Dec 12, 2017

tools: simplify prefer-common-mustnotcall rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

MylesBorins added a commit that referenced this pull request Dec 12, 2017

tools: simplify prefer-assert-methods rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

MylesBorins added a commit that referenced this pull request Dec 12, 2017

tools: simplify buffer-constructor rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

MylesBorins added a commit that referenced this pull request Dec 12, 2017

tools: simplify no-let-in-for-declaration rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

MylesBorins added a commit that referenced this pull request Dec 12, 2017

tools: simplify prefer-common-mustnotcall rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

MylesBorins added a commit that referenced this pull request Dec 12, 2017

tools: simplify prefer-assert-methods rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

MylesBorins added a commit that referenced this pull request Dec 12, 2017

tools: simplify buffer-constructor rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

MylesBorins added a commit that referenced this pull request Dec 12, 2017

tools: simplify no-let-in-for-declaration rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

@MylesBorins MylesBorins referenced this pull request Dec 12, 2017

Merged

v9.3.0 proposal #17631

@gibfahn

This comment has been minimized.

Show comment
Hide comment
@gibfahn

gibfahn Dec 20, 2017

Member

Missing landed in

Landed in e4a7109 66d3e6b 0c1dee5 746534b

Member

gibfahn commented Dec 20, 2017

Missing landed in

Landed in e4a7109 66d3e6b 0c1dee5 746534b

gibfahn added a commit that referenced this pull request Dec 20, 2017

tools: simplify prefer-common-mustnotcall rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

gibfahn added a commit that referenced this pull request Dec 20, 2017

tools: simplify prefer-assert-methods rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

gibfahn added a commit that referenced this pull request Dec 20, 2017

tools: simplify buffer-constructor rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

gibfahn added a commit that referenced this pull request Dec 20, 2017

tools: simplify prefer-common-mustnotcall rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

gibfahn added a commit that referenced this pull request Dec 20, 2017

tools: simplify prefer-assert-methods rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

gibfahn added a commit that referenced this pull request Dec 20, 2017

tools: simplify buffer-constructor rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

gibfahn added a commit that referenced this pull request Dec 20, 2017

tools: simplify no-let-in-for-declaration rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
@gibfahn

This comment has been minimized.

Show comment
Hide comment
@gibfahn

gibfahn Dec 20, 2017

Member

Didn't cherry-pick the last commit back to 6.x as it conflicted.

Member

gibfahn commented Dec 20, 2017

Didn't cherry-pick the last commit back to 6.x as it conflicted.

@gibfahn gibfahn referenced this pull request Dec 20, 2017

Closed

v8.9.4 proposal #17772

gibfahn added a commit that referenced this pull request Dec 20, 2017

tools: simplify prefer-common-mustnotcall rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

gibfahn added a commit that referenced this pull request Dec 20, 2017

tools: simplify prefer-assert-methods rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

gibfahn added a commit that referenced this pull request Dec 20, 2017

tools: simplify buffer-constructor rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

gibfahn added a commit that referenced this pull request Dec 20, 2017

tools: simplify no-let-in-for-declaration rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

@gibfahn gibfahn referenced this pull request Dec 20, 2017

Merged

v8.9.4 proposal #17774

@MylesBorins MylesBorins referenced this pull request Dec 20, 2017

Merged

v6.12.3 proposal #17776

gibfahn added a commit that referenced this pull request Dec 20, 2017

tools: simplify prefer-common-mustnotcall rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

gibfahn added a commit that referenced this pull request Dec 20, 2017

tools: simplify prefer-assert-methods rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

gibfahn added a commit that referenced this pull request Dec 20, 2017

tools: simplify buffer-constructor rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

gibfahn added a commit that referenced this pull request Dec 20, 2017

tools: simplify no-let-in-for-declaration rule
PR-URL: #17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

msoechting added a commit to hpicgs/node that referenced this pull request Feb 5, 2018

tools: simplify prefer-common-mustnotcall rule
PR-URL: nodejs#17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

msoechting added a commit to hpicgs/node that referenced this pull request Feb 5, 2018

tools: simplify prefer-assert-methods rule
PR-URL: nodejs#17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

msoechting added a commit to hpicgs/node that referenced this pull request Feb 5, 2018

tools: simplify buffer-constructor rule
PR-URL: nodejs#17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

msoechting added a commit to hpicgs/node that referenced this pull request Feb 5, 2018

tools: simplify no-let-in-for-declaration rule
PR-URL: nodejs#17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

msoechting added a commit to hpicgs/node that referenced this pull request Feb 7, 2018

tools: simplify prefer-common-mustnotcall rule
PR-URL: nodejs#17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

msoechting added a commit to hpicgs/node that referenced this pull request Feb 7, 2018

tools: simplify prefer-assert-methods rule
PR-URL: nodejs#17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

msoechting added a commit to hpicgs/node that referenced this pull request Feb 7, 2018

tools: simplify buffer-constructor rule
PR-URL: nodejs#17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>

msoechting added a commit to hpicgs/node that referenced this pull request Feb 7, 2018

tools: simplify no-let-in-for-declaration rule
PR-URL: nodejs#17572
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment