pasika 0.10.159 → 0.10.160
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eslint/pasika/index.js +23 -0
- package/package.json +1 -1
|
@@ -9942,6 +9942,8 @@ var applyUsageRule = {
|
|
|
9942
9942
|
// eslint/rules/tailwind/at-rule-spacing.ts
|
|
9943
9943
|
var EMPTY_LINE = /\n[ \t]*\n/u;
|
|
9944
9944
|
var LINE_BREAK = /\r\n|\n|\r/u;
|
|
9945
|
+
var GROUP_COMMENT_BETWEEN = /^(?<before>[ \t\r\n]*)(?<group>\/\*\s*Group:[^\r\n]*\*\/)(?<after>[ \t\r\n]*)$/u;
|
|
9946
|
+
var LINE_END_INDENT = /(?:\r\n|\n|\r)(?<indent>[ \t]*)$/u;
|
|
9945
9947
|
var atRuleSpacingRule = {
|
|
9946
9948
|
meta: {
|
|
9947
9949
|
schema: [],
|
|
@@ -9965,6 +9967,27 @@ var atRuleSpacingRule = {
|
|
|
9965
9967
|
const start = previous.loc.end.offset;
|
|
9966
9968
|
const end = current.loc.start.offset;
|
|
9967
9969
|
const between = source.slice(start, end);
|
|
9970
|
+
const groupMatch = GROUP_COMMENT_BETWEEN.exec(between);
|
|
9971
|
+
if (groupMatch?.groups) {
|
|
9972
|
+
const { before, group, after } = groupMatch.groups;
|
|
9973
|
+
if (before === void 0 || group === void 0 || after === void 0) continue;
|
|
9974
|
+
const hasBlankBefore = EMPTY_LINE.test(before.replace(/\r\n|\r/gu, "\n"));
|
|
9975
|
+
const hasBlankAfter = EMPTY_LINE.test(after.replace(/\r\n|\r/gu, "\n"));
|
|
9976
|
+
if (hasBlankBefore && !hasBlankAfter) continue;
|
|
9977
|
+
const groupIndent = LINE_END_INDENT.exec(before)?.groups?.indent ?? "";
|
|
9978
|
+
const nextIndent = LINE_END_INDENT.exec(after)?.groups?.indent ?? "";
|
|
9979
|
+
context.report({
|
|
9980
|
+
node: current,
|
|
9981
|
+
message: "A CSS consumer group comment must immediately precede its @ rule, with a blank line before the comment.",
|
|
9982
|
+
fix(fixer) {
|
|
9983
|
+
return fixer.replaceTextRange(
|
|
9984
|
+
[start, end],
|
|
9985
|
+
`${newline}${newline}${groupIndent}${group}${newline}${nextIndent}`
|
|
9986
|
+
);
|
|
9987
|
+
}
|
|
9988
|
+
});
|
|
9989
|
+
continue;
|
|
9990
|
+
}
|
|
9968
9991
|
if (EMPTY_LINE.test(between.replace(/\r\n|\r/gu, "\n"))) continue;
|
|
9969
9992
|
context.report({
|
|
9970
9993
|
node: current,
|