Skip to content

Commit

Permalink
fix(rules): explicitly import rules to trigger side effects
Browse files Browse the repository at this point in the history
This adds an explicit import for the rules index file, to trigger the registration side effects of each rule being imported. This already happened in the CLI due to the import being present in "autoload.ts", but was missing in programmatic usage. This resulted in "rules.loadAll" loading no rules.
  • Loading branch information
atkinchris committed Oct 6, 2024
1 parent dcb6ed0 commit 933a927
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion src/autoload.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { loadAllRules } from './loader.js';
import './rules/index.js';

loadAllRules();
1 change: 1 addition & 0 deletions src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import type {
TechMatcher,
} from './types/rule.js';
import type { AllowedKeys } from './types/techs.js';
import './rules/index.js';

export const rulesTechs: TechMatcher[] = [];
export const rulesExtensions: ExtensionMatcher[] = [];
Expand Down

0 comments on commit 933a927

Please sign in to comment.