We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07c28b5 commit 3db8a02Copy full SHA for 3db8a02
scripts/eslint-rules/no-production-logging.js
@@ -27,6 +27,9 @@ module.exports = function(context) {
27
['warning', 'warningWithoutStack'].includes(name);
28
29
return {
30
+ meta: {
31
+ fixable: 'code',
32
+ },
33
CallExpression: node => {
34
if (!isLoggerNode(node.callee.name)) {
35
return;
@@ -38,6 +41,12 @@ module.exports = function(context) {
38
41
data: {
39
42
identifier: node.callee.name,
40
43
},
44
+ fix: function(fixer) {
45
+ return [
46
+ fixer.insertTextBefore(node.parent, 'if (__DEV__) {'),
47
+ fixer.insertTextAfter(node.parent, '}'),
48
+ ];
49
50
});
51
}
52
0 commit comments