Files
formipay/node_modules/markdownlint/lib/md004.js
dwindown e8fbfb14c1 fix: prevent asset conflicts between React and Grid.js versions
Add coexistence checks to all enqueue methods to prevent loading
both React and Grid.js assets simultaneously.

Changes:
- ReactAdmin.php: Only enqueue React assets when ?react=1
- Init.php: Skip Grid.js when React active on admin pages
- Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0
- Customer.php, Product.php, License.php: Add coexistence checks

Now the toggle between Classic and React versions works correctly.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 17:02:14 +07:00

77 lines
2.1 KiB
JavaScript

// @ts-check
"use strict";
const { addErrorDetailIf, listItemMarkerRe, unorderedListStyleFor } =
require("../helpers");
const { flattenedLists } = require("./cache");
const expectedStyleToMarker = {
"dash": "-",
"plus": "+",
"asterisk": "*"
};
const differentItemStyle = {
"dash": "plus",
"plus": "asterisk",
"asterisk": "dash"
};
const validStyles = Object.keys(expectedStyleToMarker);
module.exports = {
"names": [ "MD004", "ul-style" ],
"description": "Unordered list style",
"tags": [ "bullet", "ul" ],
"function": function MD004(params, onError) {
const style = String(params.config.style || "consistent");
let expectedStyle = style;
const nestingStyles = [];
flattenedLists().forEach((list) => {
if (list.unordered) {
if (expectedStyle === "consistent") {
expectedStyle = unorderedListStyleFor(list.items[0]);
}
list.items.forEach((item) => {
const itemStyle = unorderedListStyleFor(item);
if (style === "sublist") {
const nesting = list.nesting;
if (!nestingStyles[nesting]) {
nestingStyles[nesting] =
(itemStyle === nestingStyles[nesting - 1]) ?
differentItemStyle[itemStyle] :
itemStyle;
}
expectedStyle = nestingStyles[nesting];
}
if (!validStyles.includes(expectedStyle)) {
expectedStyle = validStyles[0];
}
let range = null;
let fixInfo = null;
const match = item.line.match(listItemMarkerRe);
if (match) {
const column = match.index + 1;
const length = match[0].length;
range = [ column, length ];
fixInfo = {
"editColumn": match[1].length + 1,
"deleteCount": 1,
"insertText": expectedStyleToMarker[expectedStyle]
};
}
addErrorDetailIf(
onError,
item.lineNumber,
expectedStyle,
itemStyle,
null,
null,
range,
fixInfo
);
});
}
});
}
};