Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(eslint-plugin): [no-explicit-any] Add an optional fixer #609

Merged
merged 10 commits into from Jun 28, 2019
4 changes: 4 additions & 0 deletions packages/eslint-plugin/src/rules/no-explicit-any.ts
Expand Up @@ -9,6 +9,7 @@ export default util.createRule({
category: 'Best Practices',
recommended: 'warn',
},
fixable: "code",
messages: {
unexpectedAny: 'Unexpected any. Specify a different type.',
},
Expand All @@ -21,6 +22,9 @@ export default util.createRule({
context.report({
node,
messageId: 'unexpectedAny',
fix(fixer) {
bradzacher marked this conversation as resolved.
Show resolved Hide resolved
return fixer.replaceText(node,"unknown");
}
});
},
};
Expand Down