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>
53 lines
1.1 KiB
JavaScript
53 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
const preprocessWarnings = require('./preprocessWarnings');
|
|
|
|
/**
|
|
* @type {import('stylelint').Formatter}
|
|
*/
|
|
module.exports = function tapFormatter(results) {
|
|
const lines = [`TAP version 13\n1..${results.length}`];
|
|
|
|
for (const [index, result] of results.entries()) {
|
|
preprocessWarnings(result);
|
|
|
|
lines.push(
|
|
`${result.errored ? 'not ok' : 'ok'} ${index + 1} - ${result.ignored ? 'ignored ' : ''}${
|
|
result.source
|
|
}`,
|
|
);
|
|
|
|
if (result.warnings.length > 0) {
|
|
lines.push('---', 'messages:');
|
|
|
|
for (const warning of result.warnings) {
|
|
lines.push(
|
|
` - message: "${warning.text}"`,
|
|
` severity: ${warning.severity}`,
|
|
` data:`,
|
|
` line: ${warning.line}`,
|
|
` column: ${warning.column}`,
|
|
);
|
|
|
|
if (typeof warning.endLine === 'number') {
|
|
lines.push(` endLine: ${warning.endLine}`);
|
|
}
|
|
|
|
if (typeof warning.endColumn === 'number') {
|
|
lines.push(` endColumn: ${warning.endColumn}`);
|
|
}
|
|
|
|
if (typeof warning.rule === 'string') {
|
|
lines.push(` ruleId: ${warning.rule}`);
|
|
}
|
|
}
|
|
|
|
lines.push('---');
|
|
}
|
|
}
|
|
|
|
lines.push('');
|
|
|
|
return lines.join('\n');
|
|
};
|