Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSonOfThomp committed Oct 16, 2024
1 parent 1f1be18 commit 5dd551d
Show file tree
Hide file tree
Showing 3 changed files with 1,503 additions and 143 deletions.
4 changes: 4 additions & 0 deletions tools/eslint-plugin/scripts/buildRulesIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import { makeId, makeVarName } from './utils';

buildRulesIndexFile();

/**
* Utility function that creates or updates the Rules index file
* after a new Rule is created
*/
export function buildRulesIndexFile() {
const rulesDir = path.resolve(__dirname, '../src/rules');
fse.readdir(rulesDir).then(files => {
Expand Down
5 changes: 4 additions & 1 deletion tools/eslint-plugin/scripts/createNewRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ import {
const cli = new Command('');
cli.argument('<rule-name>', 'The name of the rule');
cli.action(createNewRule);
cli.parse();
cli.parse(process.argv);

/**
* Creates a new Rule within `eslint-plugin/src/rules`
*/
function createNewRule(ruleName: string) {
const rulesDir = path.resolve(__dirname, '../src/rules');
const testsDir = path.resolve(__dirname, '../src/tests');
Expand Down
Loading

0 comments on commit 5dd551d

Please sign in to comment.