Skip to content

Commit b1012d3

Browse files
authoredNov 20, 2020
Allow unassigned stylesheet imports (#502)
1 parent 6fa99cd commit b1012d3

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed
 

Diff for: ‎config/plugins.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,11 @@ module.exports = {
238238
allow: [
239239
'@babel/polyfill',
240240
'**/register',
241-
'**/register/**'
241+
'**/register/**',
242+
'**/*.css',
243+
'**/*.scss',
244+
'**/*.sass',
245+
'**/*.less'
242246
]
243247
}
244248
],

Diff for: ‎test/lint-text.js

+14
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,20 @@ test('enable rules based on nodeVersion in override', async t => {
252252
t.true(hasRule(results, 'promise/prefer-await-to-then'));
253253
});
254254

255+
test('allow unassigned stylesheet imports', t => {
256+
let {results} = fn.lintText('import \'stylesheet.css\'');
257+
t.false(hasRule(results, 'import/no-unassigned-import'));
258+
259+
({results} = fn.lintText('import \'stylesheet.scss\''));
260+
t.false(hasRule(results, 'import/no-unassigned-import'));
261+
262+
({results} = fn.lintText('import \'stylesheet.sass\''));
263+
t.false(hasRule(results, 'import/no-unassigned-import'));
264+
265+
({results} = fn.lintText('import \'stylesheet.less\''));
266+
t.false(hasRule(results, 'import/no-unassigned-import'));
267+
});
268+
255269
test('find configurations close to linted file', t => {
256270
let {results} = fn.lintText('console.log(\'semicolon\');\n', {filename: 'fixtures/nested-configs/child/semicolon.js'});
257271
t.true(hasRule(results, 'semi'));

0 commit comments

Comments
 (0)
Please sign in to comment.