Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
plugins.md
document and createPlugin
type definition
- Loading branch information
1 parent
4772851
commit a215d5c
Showing
6 changed files
with
99 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
'use strict'; | ||
|
||
/** @typedef {import('stylelint').Rule} StylelintRule */ | ||
|
||
/** | ||
* @param {string} ruleName | ||
* @param {StylelintRule} rule | ||
* @returns {{ruleName: string, rule: StylelintRule}} | ||
* @type {typeof import('stylelint').createPlugin} | ||
*/ | ||
function createPlugin(ruleName, rule) { | ||
module.exports = function createPlugin(ruleName, rule) { | ||
const ruleFunc = /** @type {import('stylelint').Rule} */ (rule); | ||
|
||
return { | ||
ruleName, | ||
rule, | ||
rule: ruleFunc, | ||
}; | ||
} | ||
|
||
module.exports = /** @type {typeof import('stylelint').createPlugin} */ (createPlugin); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters