Skip to content
This repository was archived by the owner on Jan 20, 2022. It is now read-only.

Commit ce9bcce

Browse files
committed
chore: Compatability with React 17
lint
1 parent 0606c93 commit ce9bcce

File tree

5 files changed

+349
-375
lines changed

5 files changed

+349
-375
lines changed

package.json

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"license": "BSD-3-Clause",
88
"scripts": {
99
"test": "echo \"Error: no test specified\" && exit 1",
10-
"lint": "tsc --noEmit && eslint '*/**/*.{js,ts,tsx}' --quiet --fix",
10+
"lint": "tsc --noEmit && eslint '*/**/*.{js,ts,tsx}' --quiet",
1111
"start": "webpack-serve --config example/webpack.config.js",
1212
"build": "tsc",
1313
"prepublish": "yarn build"
@@ -20,7 +20,7 @@
2020
"copy-to-clipboard": "^3.0.8",
2121
"lodash": "^4.17.11",
2222
"markdown-it-container": "^3.0.0",
23-
"outline-icons": "^1.21.0-3",
23+
"outline-icons": "^1.21.0",
2424
"prismjs": "^1.19.0",
2525
"prosemirror-commands": "^1.1.4",
2626
"prosemirror-dropcursor": "^1.3.2",
@@ -45,9 +45,9 @@
4545
"typescript": "3.7.5"
4646
},
4747
"peerDependencies": {
48-
"react": "^16.8.6",
49-
"react-dom": "^16.8.6",
50-
"styled-components": "^5.1.0"
48+
"react": "^16.0.0 || ^17.0.0",
49+
"react-dom": "^16.0.0 ^17.0.0",
50+
"styled-components": "^5.0.0"
5151
},
5252
"devDependencies": {
5353
"@types/lodash": "^4.14.149",
@@ -67,20 +67,22 @@
6767
"@types/react-dom": "^16.9.5",
6868
"@types/refractor": "^2.8.0",
6969
"@types/styled-components": "^4.4.2",
70-
"@typescript-eslint/eslint-plugin": "^2.17.0",
71-
"@typescript-eslint/parser": "^2.17.0",
72-
"eslint": "^6.8.0",
73-
"eslint-config-prettier": "^6.9.0",
74-
"eslint-config-react-app": "^2.1.0",
75-
"eslint-plugin-import": "^2.9.0",
76-
"eslint-plugin-jsx-a11y": "^6.0.3",
77-
"eslint-plugin-prettier": "^3.1.2",
78-
"eslint-plugin-react": "^7.7.0",
70+
"@typescript-eslint/eslint-plugin": "^4.0.0",
71+
"@typescript-eslint/parser": "^4.0.0",
72+
"eslint": "^7.13.0",
73+
"eslint-config-prettier": "^6.15.0",
74+
"eslint-config-react-app": "^6.0.0",
75+
"eslint-plugin-flowtype": "^5.2.0",
76+
"eslint-plugin-import": "^2.22.0",
77+
"eslint-plugin-jsx-a11y": "^6.4.1",
78+
"eslint-plugin-prettier": "^3.1.4",
79+
"eslint-plugin-react": "^7.21.5",
80+
"eslint-plugin-react-hooks": "^4.0.8",
7981
"prettier": "^1.19.1",
80-
"react": "^16.8.6",
81-
"react-dom": "^16.8.6",
82+
"react": "^17.0.0",
83+
"react-dom": "^17.0.0",
8284
"source-map-loader": "^0.2.4",
83-
"styled-components": "^5.1.0",
85+
"styled-components": "^5.2.1",
8486
"ts-loader": "^6.2.1",
8587
"webpack": "^4.29.6",
8688
"webpack-cli": "^3.2.3",
@@ -104,4 +106,4 @@
104106
"url": "https://github.com/outline/rich-markdown-editor/issues"
105107
},
106108
"homepage": "https://github.com/outline/rich-markdown-editor#readme"
107-
}
109+
}

src/index.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,27 +1269,28 @@ const StyledEditor = styled("div")<{
12691269
scrollbar-color: transparent transparent;
12701270
12711271
&:hover {
1272-
scrollbar-color: ${props => props.theme.scrollbarThumb} ${props => props.theme.scrollbarBackground};
1272+
scrollbar-color: ${props => props.theme.scrollbarThumb}
1273+
${props => props.theme.scrollbarBackground};
12731274
}
12741275
12751276
& ::-webkit-scrollbar {
1276-
height: 14px;
1277-
background-color: transparent;
1277+
height: 14px;
1278+
background-color: transparent;
12781279
}
12791280
12801281
&:hover ::-webkit-scrollbar {
1281-
background-color: ${props => props.theme.scrollbarBackground};
1282+
background-color: ${props => props.theme.scrollbarBackground};
12821283
}
12831284
12841285
& ::-webkit-scrollbar-thumb {
1285-
background-color: transparent;
1286-
border: 3px solid transparent;
1287-
border-radius: 7px;
1286+
background-color: transparent;
1287+
border: 3px solid transparent;
1288+
border-radius: 7px;
12881289
}
12891290
12901291
&:hover ::-webkit-scrollbar-thumb {
1291-
background-color: ${props => props.theme.scrollbarThumb};
1292-
border-color: ${props => props.theme.scrollbarBackground};
1292+
background-color: ${props => props.theme.scrollbarThumb};
1293+
border-color: ${props => props.theme.scrollbarBackground};
12931294
}
12941295
}
12951296

src/lib/markInputRule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function getMarksBetween(start: number, end: number, state: EditorState) {
2222
export default function(
2323
regexp: RegExp,
2424
markType: MarkType,
25-
getAttrs?: (match) => {}
25+
getAttrs?: (match) => Record<string, unknown>
2626
): InputRule {
2727
return new InputRule(
2828
regexp,

src/lib/markdown/serializer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/camelcase, @typescript-eslint/no-use-before-define */
1+
/* eslint-disable @typescript-eslint/no-use-before-define */
22
// https://raw.githubusercontent.com/ProseMirror/prosemirror-markdown/master/src/to_markdown.js
33
// forked for table support
44

0 commit comments

Comments
 (0)