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

Implement automatic fixes for our custom eslint rules #16636

Closed
joyeecheung opened this issue Oct 31, 2017 · 13 comments
Closed

Implement automatic fixes for our custom eslint rules #16636

joyeecheung opened this issue Oct 31, 2017 · 13 comments
Labels
tools Issues and PRs related to the tools directory.

Comments

@joyeecheung
Copy link
Member

joyeecheung commented Oct 31, 2017

  • Version: master
  • Subsystem: tools

The rules are in https://github.com/nodejs/node/tree/master/tools/eslint-rules
Some of them should be possible to get fixed automatically e.g. to fix require-buffer simply put a line below 'use strict' and stuff.

ESLint documentation on how to implement custom fixes: https://eslint.org/docs/developer-guide/working-with-rules#applying-fixes

@joyeecheung joyeecheung added the good first issue Issues that are suitable for first-time contributors. label Oct 31, 2017
@shobhitchittora
Copy link
Contributor

Hi @joyeecheung. I'd like to pick this up as a good first issue. I've already forked, built and tested the master. Please provide further steps to test my fixer methods. Any guidance is more than appreciated.

@tniessen tniessen added the tools Issues and PRs related to the tools directory. label Oct 31, 2017
@gibfahn
Copy link
Member

gibfahn commented Oct 31, 2017

@shobhitchittora a good way to get started would be to:

* Command is:

./node tools/eslint/bin/eslint.js --cache --rulesdir=tools/eslint-rules --ext=.js,.mjs,.md benchmark doc lib test tools

Feel free to comment here if you run into any issues.

BTW the linter command is what gets run when you run make lint (which calls lint-js):

node/Makefile

Lines 994 to 1000 in 46ca177

lint-js:
@echo "Running JS linter..."
@if [ -x $(NODE) ]; then \
$(NODE) $(LINT_JS_CMD); \
else \
node $(LINT_JS_CMD); \
fi

@gibfahn gibfahn added the help wanted Issues that need assistance from volunteers or PRs that need help to proceed. label Oct 31, 2017
@shobhitchittora
Copy link
Contributor

Thanks for the help. I'm working on writing fixture functions and will create a PR.

shobhitchittora added a commit to shobhitchittora/node that referenced this issue Oct 31, 2017
This implements an eslint fixer function to auto insert common.hasCryto check if messed out.

Refs: nodejs#16636
shobhitchittora added a commit to shobhitchittora/node that referenced this issue Oct 31, 2017
This adds eslint fixer for auto-fixing the usage of assert operators. Also adding fileoverview for the perfer-assert-methods.js file.

Refs: nodejs#16636
starkwang added a commit to starkwang/node that referenced this issue Nov 1, 2017
shobhitchittora added a commit to shobhitchittora/node that referenced this issue Nov 1, 2017
This implements a fixer method to fix the usage of Deprecated Buffer() constructor.

Also adds some more test cases to the eslint rule.

Refs: nodejs#16636
shobhitchittora added a commit to shobhitchittora/node that referenced this issue Nov 1, 2017
This extends the current test for the custom eslint rule with expected output key.

Refs: nodejs#16636
shobhitchittora added a commit to shobhitchittora/node that referenced this issue Nov 1, 2017
1. Added fixer method for resolving lint error.
2. Added additional valid tests + Output for current and new invalid tests.

Refs: nodejs#16636
shobhitchittora added a commit to shobhitchittora/node that referenced this issue Nov 1, 2017
Fixing some build errors + added correct output for invalid cases

Refs: nodejs#16636
@shobhitchittora
Copy link
Contributor

@gibfahn Seems like that the path to eslint got changed from - tools/eslint/bin/eslint.js to tools/node_modules/eslint/bin/eslint.js. Thanks ! 👍🏻

shobhitchittora added a commit to shobhitchittora/node that referenced this issue Feb 17, 2018
rules-utils arguments check + spacing in test file

Refs: nodejs#16636
shobhitchittora added a commit to shobhitchittora/node that referenced this issue Feb 17, 2018
Removes extra spaces ( lint-error ) + rules-utils argument check
suggestoin

Refs : nodejs#16636
BridgeAR pushed a commit to BridgeAR/node that referenced this issue Feb 17, 2018
1. Fixer for crypto-check.js
2. Extends tests

PR-URL: nodejs#16647
Refs: nodejs#16636
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
BridgeAR pushed a commit to BridgeAR/node that referenced this issue Feb 17, 2018
1. Adds fixer method
2. Extends test

PR-URL: nodejs#16646
Refs: nodejs#16636
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this issue Feb 20, 2018
1. Extends tests
2. Refactors code
3. Adds fixer

Refs: #16636

PR-URL: #16652
Refs: #16636
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
MylesBorins pushed a commit that referenced this issue Feb 21, 2018
PR-URL: #16648
Refs: #16636
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
MylesBorins pushed a commit that referenced this issue Feb 21, 2018
1. Extends tests
2. Refactors code
3. Adds fixer

Refs: #16636

PR-URL: #16652
Refs: #16636
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
MylesBorins pushed a commit that referenced this issue Feb 21, 2018
PR-URL: #16648
Refs: #16636
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
MylesBorins pushed a commit that referenced this issue Feb 21, 2018
1. Extends tests
2. Refactors code
3. Adds fixer

Refs: #16636

PR-URL: #16652
Refs: #16636
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
MylesBorins pushed a commit that referenced this issue Feb 21, 2018
PR-URL: #16648
Refs: #16636
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
MylesBorins pushed a commit that referenced this issue Feb 21, 2018
1. Fixer for crypto-check.js
2. Extends tests

PR-URL: #16647
Refs: #16636
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
MylesBorins pushed a commit that referenced this issue Feb 21, 2018
1. Adds fixer method
2. Extends test

PR-URL: #16646
Refs: #16636
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this issue Feb 21, 2018
1. Fixer for crypto-check.js
2. Extends tests

PR-URL: #16647
Refs: #16636
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
MylesBorins pushed a commit that referenced this issue Feb 21, 2018
1. Adds fixer method
2. Extends test

PR-URL: #16646
Refs: #16636
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this issue Feb 21, 2018
1. Fixer for crypto-check.js
2. Extends tests

PR-URL: #16647
Refs: #16636
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
MylesBorins pushed a commit that referenced this issue Feb 21, 2018
1. Adds fixer method
2. Extends test

PR-URL: #16646
Refs: #16636
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this issue Mar 20, 2018
1. Extends tests
2. Refactors code
3. Adds fixer

Refs: #16636

PR-URL: #16652
Refs: #16636
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
MylesBorins pushed a commit that referenced this issue Mar 28, 2018
1. Extends tests
2. Refactors code
3. Adds fixer

Refs: #16636

PR-URL: #16652
Refs: #16636
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
MylesBorins pushed a commit that referenced this issue Mar 30, 2018
1. Extends tests
2. Refactors code
3. Adds fixer

Refs: #16636

PR-URL: #16652
Refs: #16636
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
gibfahn pushed a commit that referenced this issue Apr 13, 2018
PR-URL: #16648
Refs: #16636
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
MayaLekova pushed a commit to MayaLekova/node that referenced this issue May 8, 2018
1. Extends tests
2. Refactors code
3. Adds fixer

Refs: nodejs#16636

PR-URL: nodejs#16652
Refs: nodejs#16636
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
MayaLekova pushed a commit to MayaLekova/node that referenced this issue May 8, 2018
PR-URL: nodejs#16648
Refs: nodejs#16636
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
MayaLekova pushed a commit to MayaLekova/node that referenced this issue May 8, 2018
1. Fixer for crypto-check.js
2. Extends tests

PR-URL: nodejs#16647
Refs: nodejs#16636
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
MayaLekova pushed a commit to MayaLekova/node that referenced this issue May 8, 2018
1. Adds fixer method
2. Extends test

PR-URL: nodejs#16646
Refs: nodejs#16636
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this issue Aug 7, 2018
1. Fixer for crypto-check.js
2. Extends tests

PR-URL: #16647
Refs: #16636
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
MylesBorins pushed a commit that referenced this issue Aug 7, 2018
1. Adds fixer method
2. Extends test

PR-URL: #16646
Refs: #16636
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
rvagg pushed a commit that referenced this issue Aug 16, 2018
1. Fixer for crypto-check.js
2. Extends tests

PR-URL: #16647
Refs: #16636
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Khaidi Chu <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
rvagg pushed a commit that referenced this issue Aug 16, 2018
1. Adds fixer method
2. Extends test

PR-URL: #16646
Refs: #16636
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants