Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/services/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,10 @@ export class LintVisitor implements nodes.IVisitor {
// Unknown propery & When using a vendor-prefixed gradient, make sure to use them all.
/////////////////////////////////////////////////////////////

const isExportBlock = node.getSelectors().matches(":export");
const selectors = node.getSelectors();
const isICSSBlock = selectors.matches(':export') || (selectors.startsWith(':import(') && selectors.endsWith(')'));

if (!isExportBlock) {
if (!isICSSBlock) {
const propertiesBySuffix = new NodesByRootMap();
let containsUnknowns = false;

Expand Down
1 change: 1 addition & 0 deletions src/test/css/lint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ suite('CSS - Lint', () => {
assertRuleSet('selector { box-shadow: none }'); // no error
assertRuleSet('selector { box-property: "rest is missing" }', Rules.UnknownProperty);
assertRuleSet(':export { prop: "some" }'); // no error for properties inside :export
assertRuleSet(':import("something.scss") { __customProperty: customProperty; }'); // no error for properties inside :import
assertRuleSet2('selector { foo: "some"; bar: 0px }', [], undefined, new LintConfigurationSettings({ validProperties: ['foo', 'bar'] }));
assertRuleSet2('selector { foo: "some"; }', [], undefined, new LintConfigurationSettings({ validProperties: ['foo', null] }));
assertRuleSet2('selector { bar: "some"; }', [Rules.UnknownProperty], undefined, new LintConfigurationSettings({ validProperties: ['foo'] }));
Expand Down