Skip to content

Commit 038ac51

Browse files
committed
add comments
1 parent 25aace9 commit 038ac51

File tree

3 files changed

+862
-17
lines changed

3 files changed

+862
-17
lines changed

tools/eslint-plugin/scripts/buildRulesIndex.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import { makeId, makeVarName } from './utils';
55

66
buildRulesIndexFile();
77

8+
/**
9+
* Utility function that creates or updates the Rules index file
10+
* after a new Rule is created
11+
*/
812
export function buildRulesIndexFile() {
913
const rulesDir = path.resolve(__dirname, '../src/rules');
1014
fse.readdir(rulesDir).then(files => {

tools/eslint-plugin/scripts/createNewRule.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ import {
1313
const cli = new Command('');
1414
cli.argument('<rule-name>', 'The name of the rule');
1515
cli.action(createNewRule);
16-
cli.parse();
16+
cli.parse(process.argv);
1717

18+
/**
19+
* Creates a new Rule within `eslint-plugin/src/rules`
20+
*/
1821
function createNewRule(ruleName: string) {
1922
const rulesDir = path.resolve(__dirname, '../src/rules');
2023
const testsDir = path.resolve(__dirname, '../src/tests');

0 commit comments

Comments
 (0)