Skip to content

Commit

Permalink
Allow unassigned stylesheet imports (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
araujogui committed Nov 20, 2020
1 parent 6fa99cd commit b1012d3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
6 changes: 5 additions & 1 deletion config/plugins.js
Expand Up @@ -238,7 +238,11 @@ module.exports = {
allow: [
'@babel/polyfill',
'**/register',
'**/register/**'
'**/register/**',
'**/*.css',
'**/*.scss',
'**/*.sass',
'**/*.less'
]
}
],
Expand Down
14 changes: 14 additions & 0 deletions test/lint-text.js
Expand Up @@ -252,6 +252,20 @@ test('enable rules based on nodeVersion in override', async t => {
t.true(hasRule(results, 'promise/prefer-await-to-then'));
});

test('allow unassigned stylesheet imports', t => {
let {results} = fn.lintText('import \'stylesheet.css\'');
t.false(hasRule(results, 'import/no-unassigned-import'));

({results} = fn.lintText('import \'stylesheet.scss\''));
t.false(hasRule(results, 'import/no-unassigned-import'));

({results} = fn.lintText('import \'stylesheet.sass\''));
t.false(hasRule(results, 'import/no-unassigned-import'));

({results} = fn.lintText('import \'stylesheet.less\''));
t.false(hasRule(results, 'import/no-unassigned-import'));
});

test('find configurations close to linted file', t => {
let {results} = fn.lintText('console.log(\'semicolon\');\n', {filename: 'fixtures/nested-configs/child/semicolon.js'});
t.true(hasRule(results, 'semi'));
Expand Down

0 comments on commit b1012d3

Please sign in to comment.