@@ -78,9 +78,80 @@ ruleTester.run('no-namespace', require('rules/no-namespace'), {
78
78
{ code : 'import { a, b } from \'./foo\';' , parserOptions : { ecmaVersion : 2015 , sourceType : 'module' } } ,
79
79
{ code : 'import bar from \'bar\';' , parserOptions : { ecmaVersion : 2015 , sourceType : 'module' } } ,
80
80
{ code : 'import bar from \'./bar\';' , parserOptions : { ecmaVersion : 2015 , sourceType : 'module' } } ,
81
+ {
82
+ code : 'import * as foo from \'foo\';' ,
83
+ options : [ {
84
+ denyList : [ 'bar' ] ,
85
+ } ] ,
86
+ parserOptions : { ecmaVersion : 2015 , sourceType : 'module' } ,
87
+ } ,
88
+ {
89
+ code : 'import * as bar from \'foo\';' ,
90
+ options : [ {
91
+ denyList : [ 'bar' ] ,
92
+ } ] ,
93
+ parserOptions : { ecmaVersion : 2015 , sourceType : 'module' } ,
94
+ } ,
95
+ {
96
+ code : 'import * as foo from \'foo\';' ,
97
+ options : [ {
98
+ allowList : [ 'foo' ] ,
99
+ } ] ,
100
+ parserOptions : { ecmaVersion : 2015 , sourceType : 'module' } ,
101
+ } ,
102
+ {
103
+ code : 'import * as lib from \'some-lib\';' ,
104
+ options : [ {
105
+ allowList : [ 'some-lib' ] ,
106
+ } ] ,
107
+ parserOptions : { ecmaVersion : 2015 , sourceType : 'module' } ,
108
+ } ,
109
+ {
110
+ code : 'import * as scopedLib from \'@scoped/lib\';' ,
111
+ options : [ {
112
+ allowList : [ '@scoped/lib' ] ,
113
+ } ] ,
114
+ parserOptions : { ecmaVersion : 2015 , sourceType : 'module' } ,
115
+ } ,
81
116
] ,
82
117
83
118
invalid : [
119
+ test ( {
120
+ code : 'import * as foo from \'foo\';' ,
121
+ output : 'import * as foo from \'foo\';' ,
122
+ options : [ {
123
+ allowList : [ 'bar' ] ,
124
+ } ] ,
125
+ errors : [ {
126
+ line : 1 ,
127
+ column : 8 ,
128
+ message : ERROR_MESSAGE ,
129
+ } ] ,
130
+ } ) ,
131
+ test ( {
132
+ code : 'import * as bar from \'foo\';' ,
133
+ output : 'import * as bar from \'foo\';' ,
134
+ options : [ {
135
+ allowList : [ 'bar' ] ,
136
+ } ] ,
137
+ errors : [ {
138
+ line : 1 ,
139
+ column : 8 ,
140
+ message : ERROR_MESSAGE ,
141
+ } ] ,
142
+ } ) ,
143
+ test ( {
144
+ code : 'import * as foo from \'foo\';' ,
145
+ output : 'import * as foo from \'foo\';' ,
146
+ options : [ {
147
+ denyList : [ 'foo' ] ,
148
+ } ] ,
149
+ errors : [ {
150
+ line : 1 ,
151
+ column : 8 ,
152
+ message : ERROR_MESSAGE ,
153
+ } ] ,
154
+ } ) ,
84
155
test ( {
85
156
code : 'import * as foo from \'foo\';' ,
86
157
output : 'import * as foo from \'foo\';' ,
0 commit comments