chore: Add eslint rule for object shorthand (#3955)

This commit is contained in:
Tom Moor
2022-08-11 13:18:14 +01:00
committed by GitHub
parent 7eaa8eb961
commit 1d242d44b1
17 changed files with 19 additions and 18 deletions

View File

@@ -8,7 +8,7 @@ import TurndownService from "turndown";
export default function breaks(turndownService: TurndownService) {
turndownService.addRule("breaks", {
filter: ["br"],
replacement: function () {
replacement() {
return "\n";
},
});

View File

@@ -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") ?? "";

View File

@@ -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`

View File

@@ -13,7 +13,7 @@ export function CannotUseWithout(
registerDecorator({
name: "cannotUseWithout",
target: object.constructor,
propertyName: propertyName,
propertyName,
constraints: [property],
options: validationOptions,
validator: {