Skip to content

Commit

Permalink
fix: delete stylints custom message override
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyOGo committed Feb 25, 2021
1 parent 9b4864f commit dc6efc1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,21 @@ const ruleFunction: StylelintRuleFunction = (
options: SecondaryOptions,
context: StylelintContext = {}
) => (root: Root, result: Result) => {
// fix #142
// @see https://github.com/stylelint/stylelint/pull/672/files#diff-78f1c80ffb2836008dd194b3b0ca28f9b46e4897b606f0b3d25a29e57a8d3e61R74
// @see https://stylelint.io/user-guide/configure#message
/* eslint-disable @typescript-eslint/no-explicit-any */
if (
result &&
(result as any).stylelint &&
(result as any).stylelint.customMessages &&
(result as any).stylelint.customMessages[ruleName]
) {
// eslint-disable-next-line no-param-reassign
delete (result as any).stylelint.customMessages[ruleName];
}
/* eslint-enable @typescript-eslint/no-explicit-any */

// validate stylelint plugin options
const hasValidOptions = utils.validateOptions(
result,
Expand Down

0 comments on commit dc6efc1

Please sign in to comment.