Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 0 additions & 62 deletions .eslintrc.json

This file was deleted.

76 changes: 76 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// eslint.config.js
import { defineConfig } from "eslint/config";
import tinymceEslintPlugin from "@tinymce/eslint-plugin";
import js from '@eslint/js';

export default defineConfig([
{
plugins: {
"@tinymce": tinymceEslintPlugin
},
extends: [ "@tinymce/standard" ],
files: [
"src/**/*.ts",
"src/**/*.tsx"
],
ignores: [
"src/demo/demo.ts",
"src/**/*.stories.*"
],
languageOptions: {
parserOptions: {
sourceType: "module",
project: [
"./tsconfig.json"
]
},
},
rules: {
"@tinymce/prefer-fun": "off"
}
},
{
files: [ "src/**/*.stories.*" ],
languageOptions: {
parserOptions: {
sourceType: "module",
project: [
"./tsconfig.storybook.json"
]
},
},
rules: {
"@tinymce/prefer-fun": "off",
"no-console": "off",
"@typescript-eslint/no-implied-eval": "off",
"@typescript-eslint/no-unsafe-argument": "off"
}
},
{
files: [
"**/*.js"
],
plugins: { js },
env: {
"es6": true,
"node": true,
"browser": true
},
extends: [ "js/recommended" ],
parser: "espree",
languageOptions: {
parserOptions: {
ecmaVersion: 2020,
sourceType: "module"
}
},
rules: {
indent: [ "error", 2, { "SwitchCase": 1 } ],
"no-shadow": "error",
"no-unused-vars": [ "error", { "argsIgnorePattern": "^_" } ],
"object-curly-spacing": [ "error", "always", { "arraysInObjects": false, "objectsInObjects": false } ],
quotes: [ "error", "single" ],
semi: "error"
}
}
]);
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"devDependencies": {
"@babel/core": "^7.20.2",
"@ephox/agar": "^8.0.1",
"@ephox/bedrock-client": "^14.1.1",
"@ephox/bedrock-server": "^14.1.4",
"@ephox/bedrock-client": "^14.0.0",
"@ephox/bedrock-server": "^14.0.0",
"@ephox/katamari": "^9.1.6",
"@ephox/sugar": "^9.3.1",
"@storybook/addon-actions": "^6.5.13",
Expand All @@ -56,7 +56,7 @@
"@storybook/manager-webpack5": "^6.5.16",
"@storybook/vue3": "^6.5.13",
"@tinymce/beehive-flow": "^0.19.0",
"@tinymce/eslint-plugin": "^2.3.1",
"@tinymce/eslint-plugin": "^3.0.0",
"@tinymce/miniature": "^6.0.0",
"@types/node": "^20.14.0",
"@vitejs/plugin-vue": "^5.0.5",
Expand Down
6 changes: 6 additions & 0 deletions src/main/ts/components/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ export const Editor = defineComponent({
cache = vueEditor.getContent();
}
getTinymce()?.remove(vueEditor);
// The Vue docs state you can either use the callback form or await it. Ref: https://vuejs.org/api/general.html#nexttick
// eslint-disable-next-line @typescript-eslint/no-floating-promises
nextTick(() => initWrapper());
}
});
Expand Down Expand Up @@ -151,7 +153,11 @@ export const Editor = defineComponent({
cache = vueEditor.getContent();
getTinymce()?.remove(vueEditor);
conf = { ...conf, ...init, ...defaultInitValues };

// The Vue docs state you can either use the callback form or await it. Ref: https://vuejs.org/api/general.html#nexttick
// eslint-disable-next-line @typescript-eslint/no-floating-promises
nextTick(() => initWrapper());

}
};
ctx.expose({
Expand Down
1 change: 0 additions & 1 deletion src/test/ts/browser/InitTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { cleanupGlobalTinymce, VALID_API_KEY } from '../alien/TestHelper';
import { Arr } from '@ephox/katamari';

describe('Editor Component Initialization Tests', () => {
// eslint-disable-next-line @typescript-eslint/require-await
const pFakeType = async (str: string, vmContext: any) => {
vmContext.editor.getBody().innerHTML = '<p>' + str + '</p>';
Keyboard.keystroke(Keys.space(), {}, SugarElement.fromDom(vmContext.editor.getBody()) as SugarElement<Node>);
Expand Down
2 changes: 2 additions & 0 deletions src/test/ts/browser/LoadTinyTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ describe('LoadTinyTest', () => {
await pRender({}, `
<editor
:init="init"
license-key="gpl"
tinymce-script-src="/project/node_modules/tinymce-7/tinymce.min.js"
></editor>
`);
Expand Down Expand Up @@ -79,6 +80,7 @@ describe('LoadTinyTest', () => {
:init="init"
api-key="${VALID_API_KEY}"
cloud-channel="8"
license-key="gpl"
></editor>
`);

Expand Down
Loading