chore: Add eslint rule for object shorthand (#3955)
This commit is contained in:
@@ -8,7 +8,7 @@ import TurndownService from "turndown";
|
||||
export default function breaks(turndownService: TurndownService) {
|
||||
turndownService.addRule("breaks", {
|
||||
filter: ["br"],
|
||||
replacement: function () {
|
||||
replacement() {
|
||||
return "\n";
|
||||
},
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ const highlightRegExp = /brush: ([a-z0-9]+);/;
|
||||
*/
|
||||
export default function confluenceCodeBlock(turndownService: TurndownService) {
|
||||
turndownService.addRule("fencedConfluenceHighlightedCodeBlock", {
|
||||
filter: function (node) {
|
||||
filter(node) {
|
||||
const firstChild = node.firstChild;
|
||||
return (
|
||||
node.nodeName === "DIV" &&
|
||||
@@ -19,7 +19,7 @@ export default function confluenceCodeBlock(turndownService: TurndownService) {
|
||||
firstChild.className === "syntaxhighlighter-pre"
|
||||
);
|
||||
},
|
||||
replacement: function (content, node) {
|
||||
replacement(content, node) {
|
||||
const dataSyntaxhighlighterParams =
|
||||
// @ts-expect-error getAttribute exists
|
||||
node.firstChild?.getAttribute("data-syntaxhighlighter-params") ?? "";
|
||||
|
||||
@@ -7,7 +7,7 @@ import TurndownService from "turndown";
|
||||
*/
|
||||
export default function confluenceTaskList(turndownService: TurndownService) {
|
||||
turndownService.addRule("confluenceTaskList", {
|
||||
filter: function (node) {
|
||||
filter(node) {
|
||||
return (
|
||||
node.nodeName === "LI" &&
|
||||
node.parentNode?.nodeName === "UL" &&
|
||||
@@ -15,7 +15,7 @@ export default function confluenceTaskList(turndownService: TurndownService) {
|
||||
node.parentNode?.className.includes("inline-task-list")
|
||||
);
|
||||
},
|
||||
replacement: function (content, node) {
|
||||
replacement(content, node) {
|
||||
return (
|
||||
// @ts-expect-error className exists
|
||||
(node.className === "checked" ? "- [x]" : "- [ ]") + ` ${content} \n`
|
||||
|
||||
@@ -13,7 +13,7 @@ export function CannotUseWithout(
|
||||
registerDecorator({
|
||||
name: "cannotUseWithout",
|
||||
target: object.constructor,
|
||||
propertyName: propertyName,
|
||||
propertyName,
|
||||
constraints: [property],
|
||||
options: validationOptions,
|
||||
validator: {
|
||||
|
||||
Reference in New Issue
Block a user