eslint-plugin-sitecore-jss
Version:
An ESLint plugin to enforce correct usage of Sitecore JSS components
29 lines • 1.2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const DEBUG = process.env.ESLINT_DEBUG === "true"; // Enable with ESLINT_DEBUG=true
function log(...args) {
if (DEBUG) {
console.log("🔍 [ESLint Debug]:", ...args);
}
}
function logType(type, label = "Type") {
var _a, _b, _c;
if (DEBUG) {
console.log(`🔍 [ESLint Debug] ${label}:`, {
symbol: (_a = type.symbol) === null || _a === void 0 ? void 0 : _a.escapedName,
flags: type.flags,
typeArguments: (_b = type.typeArguments) === null || _b === void 0 ? void 0 : _b.map((t) => {
var _a, _b;
return ({
symbol: (_a = t.symbol) === null || _a === void 0 ? void 0 : _a.escapedName,
flags: t.flags,
value: t.value,
isStringLiteral: (_b = t.isStringLiteral) === null || _b === void 0 ? void 0 : _b.call(t),
});
}),
isStringLiteral: (_c = type.isStringLiteral) === null || _c === void 0 ? void 0 : _c.call(type),
});
}
}
exports.default = { log, logType };
//# sourceMappingURL=logging.js.map