I am writing custom eslint rules. The rules are flagging the correct spot in the code, but Visual Studio Code is not offering my quick fixes.
Here's the start of the code:
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Use design tokens",
category: "Design System",
recommended: false
},
fixable: "code"
},
And Here is, where I report the problem:
for (const m of matchedTokens) {
suggest.push({
desc: property.value.raw + " should be " + m,
fix(fixer) {
return fixer.replaceText(property.value, m);
}
})
}
context.report({
node: property,
message: 'Possible value for replacement of {{ key }} with design token',
data: {
key: property.key.name
},
suggest
})
How can I make suggestions work in the IDE? Is my expectation correct that these should show as quick fix in Visual Studio
code? Is there anything else I need to do to opt into fixes?