noInvalidPositionAtImportRule
诊断类别:lint/correctness/noInvalidPositionAtImportRule
¥Diagnostic Category: lint/correctness/noInvalidPositionAtImportRule
自从:v1.8.0
¥Since: v1.8.0
来源:
¥Sources:
禁止在无效位置使用 @import
at-rules。
¥Disallow the use of @import
at-rules in invalid positions.
任何 @import
规则都必须位于样式表中所有其他有效的 at 规则和样式规则之前(忽略 @charset
和 @layer
),否则 @import
规则无效。
¥Any @import
rules must precede all other valid at-rules and style rules in a stylesheet (ignoring @charset
and @layer
), or else the @import
rule is invalid.
¥Examples
¥Invalid
code-block.css:2:2 lint/correctness/noInvalidPositionAtImportRule ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This @import is in the wrong position.
1 │ a {}
> 2 │ @import ‘foo.css’;
│ ^^^^^^^^^^^^^^^^^
3 │
ℹ Any @import rules must precede all other valid at-rules and style rules in a stylesheet (ignoring @charset and @layer), or else the @import rule is invalid.
ℹ Consider moving import position.
¥Valid
¥Related links