mirror of
https://github.com/denoland/deno.git
synced 2025-03-06 02:52:05 -05:00
23 lines
533 B
TypeScript
23 lines
533 B
TypeScript
![]() |
export default {
|
||
|
name: "test-plugin",
|
||
|
rules: {
|
||
|
"my-rule": {
|
||
|
create(context) {
|
||
|
return {
|
||
|
VariableDeclarator(node) {
|
||
|
if (node.init.type !== "Literal" || node.init.value !== "1") {
|
||
|
context.report({
|
||
|
node: node.init,
|
||
|
message: 'should be equal to string "1"',
|
||
|
fix(fixer) {
|
||
|
return fixer.replaceText(node.init, '"1"');
|
||
|
},
|
||
|
});
|
||
|
}
|
||
|
},
|
||
|
};
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
};
|