| | |
| | | |
| | | class UseEffectRulePlugin { |
| | | /** |
| | | * Applies the plugin by registering its hooks on the compiler. |
| | | * @param {RuleSetCompiler} ruleSetCompiler the rule set compiler |
| | | * @returns {void} |
| | | */ |
| | |
| | | PLUGIN_NAME, |
| | | (path, rule, unhandledProperties, result, references) => { |
| | | /** |
| | | * Processes the provided property. |
| | | * @param {keyof RuleSetRule} property property |
| | | * @param {string} correctProperty correct property |
| | | */ |
| | |
| | | (enforce ? `use-${enforce}` : "use"); |
| | | |
| | | /** |
| | | * Returns effect. |
| | | * @param {string} path options path |
| | | * @param {string} defaultIdent default ident when none is provided |
| | | * @param {RuleSetUseItem} item user provided use value |
| | |
| | | }; |
| | | |
| | | /** |
| | | * Returns effect. |
| | | * @param {string} path options path |
| | | * @param {string} defaultIdent default ident when none is provided |
| | | * @param {Exclude<NonNullable<RuleSetUseItem>, EXPECTED_FUNCTION>} item user provided use value |
| | |
| | | }; |
| | | |
| | | /** |
| | | * Use to effects without ident. |
| | | * @param {string} path options path |
| | | * @param {RuleSetUseItem | (Falsy | RuleSetUseItem)[]} items user provided use value |
| | | * @returns {Effect[]} effects |
| | |
| | | }; |
| | | |
| | | /** |
| | | * Returns effects. |
| | | * @param {string} path current path |
| | | * @param {RuleSetUse} items user provided use value |
| | | * @returns {(Effect | ((effectData: EffectData) => Effect[]))[]} effects |