-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Comments
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. |
@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 Lines 994 to 1000 in 46ca177
|
Thanks for the help. I'm working on writing fixture functions and will create a PR. |
This implements an eslint fixer function to auto insert common.hasCryto check if messed out. Refs: nodejs#16636
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
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
This extends the current test for the custom eslint rule with expected output key. Refs: nodejs#16636
1. Added fixer method for resolving lint error. 2. Added additional valid tests + Output for current and new invalid tests. Refs: nodejs#16636
Fixing some build errors + added correct output for invalid cases Refs: nodejs#16636
@gibfahn Seems like that the path to eslint got changed from - |
rules-utils arguments check + spacing in test file Refs: nodejs#16636
Removes extra spaces ( lint-error ) + rules-utils argument check suggestoin Refs : nodejs#16636
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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
The text was updated successfully, but these errors were encountered: