Skip to content

Commit 1d85840

Browse files
INT-3364: Update dependencies (#472)
* Update dev dependencies * Fix no-floating-promises typescript-eslint error Added change to await nextTick promises. typescript-eslint rule: https://typescript-eslint.io/rules/no-floating-promises/ * Disable `@typescript-eslint/no-floating-promises` rule on `nextTick` calls `nextTick` cannot be awaited because it is called inside non-async functions. * Update tinymce/eslint * Update other dependencies --------- Co-authored-by: Ben Tran <[email protected]>
1 parent f172a7f commit 1d85840

File tree

7 files changed

+4732
-3156
lines changed

7 files changed

+4732
-3156
lines changed

.eslintrc.json

Lines changed: 0 additions & 62 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// eslint.config.js
2+
import { defineConfig } from "eslint/config";
3+
import tinymceEslintPlugin from "@tinymce/eslint-plugin";
4+
import js from '@eslint/js';
5+
6+
export default defineConfig([
7+
{
8+
plugins: {
9+
"@tinymce": tinymceEslintPlugin
10+
},
11+
extends: [ "@tinymce/standard" ],
12+
files: [
13+
"src/**/*.ts",
14+
"src/**/*.tsx"
15+
],
16+
ignores: [
17+
"src/demo/demo.ts",
18+
"src/**/*.stories.*"
19+
],
20+
languageOptions: {
21+
parserOptions: {
22+
sourceType: "module",
23+
project: [
24+
"./tsconfig.json"
25+
]
26+
},
27+
},
28+
rules: {
29+
"@tinymce/prefer-fun": "off"
30+
}
31+
},
32+
{
33+
files: [ "src/**/*.stories.*" ],
34+
languageOptions: {
35+
parserOptions: {
36+
sourceType: "module",
37+
project: [
38+
"./tsconfig.storybook.json"
39+
]
40+
},
41+
},
42+
rules: {
43+
"@tinymce/prefer-fun": "off",
44+
"no-console": "off",
45+
"@typescript-eslint/no-implied-eval": "off",
46+
"@typescript-eslint/no-unsafe-argument": "off"
47+
}
48+
},
49+
{
50+
files: [
51+
"**/*.js"
52+
],
53+
plugins: { js },
54+
env: {
55+
"es6": true,
56+
"node": true,
57+
"browser": true
58+
},
59+
extends: [ "js/recommended" ],
60+
parser: "espree",
61+
languageOptions: {
62+
parserOptions: {
63+
ecmaVersion: 2020,
64+
sourceType: "module"
65+
}
66+
},
67+
rules: {
68+
indent: [ "error", 2, { "SwitchCase": 1 } ],
69+
"no-shadow": "error",
70+
"no-unused-vars": [ "error", { "argsIgnorePattern": "^_" } ],
71+
"object-curly-spacing": [ "error", "always", { "arraysInObjects": false, "objectsInObjects": false } ],
72+
quotes: [ "error", "single" ],
73+
semi: "error"
74+
}
75+
}
76+
]);

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
"devDependencies": {
4545
"@babel/core": "^7.20.2",
4646
"@ephox/agar": "^8.0.1",
47-
"@ephox/bedrock-client": "^14.1.1",
48-
"@ephox/bedrock-server": "^14.1.4",
47+
"@ephox/bedrock-client": "^14.0.0",
48+
"@ephox/bedrock-server": "^14.0.0",
4949
"@ephox/katamari": "^9.1.6",
5050
"@ephox/sugar": "^9.3.1",
5151
"@storybook/addon-actions": "^6.5.13",
@@ -56,7 +56,7 @@
5656
"@storybook/manager-webpack5": "^6.5.16",
5757
"@storybook/vue3": "^6.5.13",
5858
"@tinymce/beehive-flow": "^0.19.0",
59-
"@tinymce/eslint-plugin": "^2.3.1",
59+
"@tinymce/eslint-plugin": "^3.0.0",
6060
"@tinymce/miniature": "^6.0.0",
6161
"@types/node": "^20.14.0",
6262
"@vitejs/plugin-vue": "^5.0.5",

src/main/ts/components/Editor.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ export const Editor = defineComponent({
107107
cache = vueEditor.getContent();
108108
}
109109
getTinymce()?.remove(vueEditor);
110+
// The Vue docs state you can either use the callback form or await it. Ref: https://vuejs.org/api/general.html#nexttick
111+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
110112
nextTick(() => initWrapper());
111113
}
112114
});
@@ -151,7 +153,11 @@ export const Editor = defineComponent({
151153
cache = vueEditor.getContent();
152154
getTinymce()?.remove(vueEditor);
153155
conf = { ...conf, ...init, ...defaultInitValues };
156+
157+
// The Vue docs state you can either use the callback form or await it. Ref: https://vuejs.org/api/general.html#nexttick
158+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
154159
nextTick(() => initWrapper());
160+
155161
}
156162
};
157163
ctx.expose({

src/test/ts/browser/InitTest.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { cleanupGlobalTinymce, VALID_API_KEY } from '../alien/TestHelper';
77
import { Arr } from '@ephox/katamari';
88

99
describe('Editor Component Initialization Tests', () => {
10-
// eslint-disable-next-line @typescript-eslint/require-await
1110
const pFakeType = async (str: string, vmContext: any) => {
1211
vmContext.editor.getBody().innerHTML = '<p>' + str + '</p>';
1312
Keyboard.keystroke(Keys.space(), {}, SugarElement.fromDom(vmContext.editor.getBody()) as SugarElement<Node>);

src/test/ts/browser/LoadTinyTest.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ describe('LoadTinyTest', () => {
3333
await pRender({}, `
3434
<editor
3535
:init="init"
36+
license-key="gpl"
3637
tinymce-script-src="/project/node_modules/tinymce-7/tinymce.min.js"
3738
></editor>
3839
`);
@@ -79,6 +80,7 @@ describe('LoadTinyTest', () => {
7980
:init="init"
8081
api-key="${VALID_API_KEY}"
8182
cloud-channel="8"
83+
license-key="gpl"
8284
></editor>
8385
`);
8486

0 commit comments

Comments
 (0)