aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-04-18 20:52:31 +0300
committereug-vs <eug-vs@keemail.me>2020-04-18 20:52:31 +0300
commit8e4a483fb7d1ebdfc950c1cc456ae2d4bd558147 (patch)
tree4197a0884bac28a1747efac1815ec5c0005cfda8
parent9272b0af3d7b2fba4738a341a1f2776243e0e515 (diff)
downloadreact-benzin-8e4a483fb7d1ebdfc950c1cc456ae2d4bd558147.tar.gz
style: fix remaining errors
-rw-r--r--.eslintrc.json4
-rw-r--r--src/lib/Markdown/Section.tsx2
-rw-r--r--src/lib/Markdown/SyntacticSpan.tsx3
3 files changed, 6 insertions, 3 deletions
diff --git a/.eslintrc.json b/.eslintrc.json
index a755820..5e44a20 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -13,9 +13,11 @@
"quotes": ["error", "single"],
"react/prop-types": 0,
"react/no-children-prop": 0,
+ "react/no-danger": 0,
"arrow-body-style": 0,
"no-cond-assign": 0,
"arrow-parens": [2, "as-needed"],
- "no-multiple-empty-lines": [2, { "max": 2, "maxEOF": 1 } ]
+ "no-multiple-empty-lines": [2, { "max": 2, "maxEOF": 1 } ],
+ "max-len": ["error", { "code": 120 }]
}
}
diff --git a/src/lib/Markdown/Section.tsx b/src/lib/Markdown/Section.tsx
index f554062..fc208b1 100644
--- a/src/lib/Markdown/Section.tsx
+++ b/src/lib/Markdown/Section.tsx
@@ -11,7 +11,7 @@ interface PropTypes extends ParserPropTypes {
const getHeaderLevel = (header: string): number => {
if (!header) return 0;
let level = 0;
- while (header[level] === '#') level++;
+ while (header[level] === '#') level += 1;
return level;
};
diff --git a/src/lib/Markdown/SyntacticSpan.tsx b/src/lib/Markdown/SyntacticSpan.tsx
index bdce3f7..11cc024 100644
--- a/src/lib/Markdown/SyntacticSpan.tsx
+++ b/src/lib/Markdown/SyntacticSpan.tsx
@@ -28,6 +28,7 @@ const regex: Record<string, RegexPair> = {
local: /!?\[(.*\]?.*)\]\((.+?)\)/,
},
rawLink: {
+ // eslint-disable-next-line max-len
global: /((?:(?:[A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www\.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)(?:(?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[.!/\\\w]*))?)/,
local: /&^/,
},
@@ -68,7 +69,7 @@ const SyntacticSpan: React.FC<PropTypes> = ({ span }) => {
const matchEmoji = span.match(regex.emoji.local);
if (matchEmoji) {
- const emoji = emojiList.find(emoji => emoji.name === matchEmoji[1]);
+ const emoji = emojiList.find(e => e.name === matchEmoji[1]);
return <span>{emoji ? emoji.char : span}</span>;
}