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.
warning
1 parent 95de4c1 commit 1f98aeeCopy full SHA for 1f98aee
src/Warning.js
@@ -10,12 +10,19 @@
10
*/
11
class Warning extends Error {
12
constructor (warning) {
13
- super()
+ super(warning)
14
15
const { text, line, column } = warning
16
17
- this.name = 'LoaderWarning'
18
- this.message = `\n(${line}:${column}) ${text}\n`
+ this.name = 'Warning'
+
19
+ this.message = `${this.name}\n\n`
20
21
+ if (typeof line !== 'undefined') {
22
+ this.message += `(${line}:${column}) `
23
+ }
24
25
+ this.message += `${text}`
26
27
this.stack = false
28
}
test/__snapshots__/Warnings.test.js.snap
@@ -1,7 +1,7 @@
1
// Jest Snapshot v1, https://goo.gl/fbAQLP
2
3
exports[`Warnings Plugins 1`] = `
4
-"
5
-(1:5) <Message>
6
+"Warning
+(1:5) <Message>"
7
`;
0 commit comments