File tree 1 file changed +10
-6
lines changed
packages/eslint-plugin/lib/rules 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -54,23 +54,27 @@ module.exports = {
54
54
const [ deprecatedImports ] = context . options
55
55
56
56
if ( ! deprecatedImports ) {
57
- throw new Error ( 'No deprecated imports provided' )
57
+ throw context . report ( {
58
+ message : 'No deprecated imports provided' ,
59
+ } )
58
60
}
59
61
60
62
if ( ! Array . isArray ( deprecatedImports ) ) {
61
- throw new Error ( 'Deprecated imports accepts an array of options ' )
63
+ throw context . report ( {
64
+ message : 'Rule accepts an array of import definitions' ,
65
+ } )
62
66
}
63
67
64
68
const emptyImport = deprecatedImports . find (
65
69
( importToCheck ) => ! importToCheck . source
66
70
)
67
71
68
72
if ( emptyImport ) {
69
- throw new Error (
70
- `No source provided for deprecated import ${ JSON . stringify (
73
+ throw context . report ( {
74
+ message : `No source provided for deprecated import ${ JSON . stringify (
71
75
emptyImport
72
- ) } `
73
- )
76
+ ) } `,
77
+ } )
74
78
}
75
79
76
80
const deprecatedImportsWithArraySource = deprecatedImports . map (
You can’t perform that action at this time.
0 commit comments