Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fb0a374

Browse files
committed
Nicer messages
1 parent d84332c commit fb0a374

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

scripts/eslint-rules/__tests__/no-production-logging-test.internal.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,31 @@ ruleTester.run('no-production-logging', rule, {
4343
code: 'warningWithoutStack(test)',
4444
errors: [
4545
{
46-
message: 'Wrap warningWithoutStack in a `if (__DEV__)` check',
46+
message: `We don't emit warnings in production builds. Wrap warningWithoutStack() in an "if (__DEV__) {}" check`,
4747
},
4848
],
4949
},
5050
{
5151
code: 'if (potato) { warningWithoutStack(test) }',
5252
errors: [
5353
{
54-
message: 'Wrap warningWithoutStack in a `if (__DEV__)` check',
54+
message: `We don't emit warnings in production builds. Wrap warningWithoutStack() in an "if (__DEV__) {}" check`,
5555
},
5656
],
5757
},
5858
{
5959
code: 'warning(test)',
6060
errors: [
6161
{
62-
message: 'Wrap warning in a `if (__DEV__)` check',
62+
message: `We don't emit warnings in production builds. Wrap warning() in an "if (__DEV__) {}" check`,
6363
},
6464
],
6565
},
6666
{
6767
code: 'if (__DEV__ || potato && true) { warning(test) }',
6868
errors: [
6969
{
70-
message: 'Wrap warning in a `if (__DEV__)` check',
70+
message: `We don't emit warnings in production builds. Wrap warning() in an "if (__DEV__) {}" check`,
7171
},
7272
],
7373
},

scripts/eslint-rules/no-production-logging.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module.exports = function(context) {
4343
function report(node) {
4444
context.report({
4545
node: node,
46-
message: 'Wrap {{identifier}} in a `if (__DEV__)` check',
46+
message: `We don't emit warnings in production builds. Wrap {{identifier}}() in an "if (__DEV__) {}" check`,
4747
data: {
4848
identifier: node.callee.name,
4949
},

0 commit comments

Comments
 (0)