Function
findPluginRuleMeta
(
plugin: string,
name: string,
configs: Linter.Config[],
)
Source from the content-addressed store, hash-verified
| 98 | } |
| 99 | |
| 100 | function findPluginRuleMeta( |
| 101 | plugin: string, |
| 102 | name: string, |
| 103 | configs: Linter.Config[], |
| 104 | ): Rule.RuleMetaData | undefined { |
| 105 | const config = configs.find(({ plugins = {} }) => plugin in plugins); |
| 106 | const rule = config?.plugins?.[plugin]?.rules?.[name]; |
| 107 | |
| 108 | if (typeof rule === 'function') { |
| 109 | logger.warn( |
| 110 | `Cannot parse metadata for rule ${plugin}/${name}, plugin registers it as a function`, |
| 111 | ); |
| 112 | return undefined; |
| 113 | } |
| 114 | |
| 115 | return rule?.meta; |
| 116 | } |
Tested by
no test coverage detected