diff --git a/package-lock.json b/package-lock.json index b49a1620c1..1e6ca024b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8020,9 +8020,9 @@ } }, "node_modules/eslint-plugin-import": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.0.tgz", - "integrity": "sha512-QPOO5NO6Odv5lpoTkddtutccQjysJuFxoPS7fAHO+9m9udNHvTCPSAMW9zGAYj8lAIdr40I8yPCdUYrncXtrwg==", + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", + "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", "dependencies": { "array-includes": "^3.1.7", "array.prototype.findlastindex": "^1.2.3", @@ -8040,7 +8040,7 @@ "object.groupby": "^1.0.1", "object.values": "^1.1.7", "semver": "^6.3.1", - "tsconfig-paths": "^3.14.2" + "tsconfig-paths": "^3.15.0" }, "engines": { "node": ">=4" @@ -15999,9 +15999,9 @@ } }, "node_modules/tsconfig-paths": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", - "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.2", @@ -17535,8 +17535,9 @@ "css-loader": "^6.8.1", "eslint": "^8.54.0", "eslint-config-prettier": "^9.0.0", + "eslint-import-resolver-typescript": "^3.6.1", "eslint-import-resolver-webpack": "^0.13.8", - "eslint-plugin-import": "^2.29.0", + "eslint-plugin-import": "^2.29.1", "eslint-plugin-jsx-a11y": "^6.8.0", "eslint-plugin-prettier": "^5.0.1", "highlight.js": "^9.18.1", diff --git a/packages/quill/.eslintrc.json b/packages/quill/.eslintrc.json index eb26103990..a686396b13 100644 --- a/packages/quill/.eslintrc.json +++ b/packages/quill/.eslintrc.json @@ -1,5 +1,9 @@ { - "extends": ["eslint:recommended", "plugin:prettier/recommended"], + "extends": [ + "eslint:recommended", + "plugin:prettier/recommended", + "plugin:import/recommended" + ], "env": { "browser": true, "commonjs": true, @@ -9,15 +13,19 @@ "settings": { "import/resolver": { "webpack": { - "config": "webpack.config.ts" - } + "env": "development" + }, + "typescript": true } }, "ignorePatterns": ["*.js", "*.d.ts"], "overrides": [ { "files": ["**/*.ts"], - "extends": ["plugin:@typescript-eslint/recommended"], + "extends": [ + "plugin:@typescript-eslint/recommended", + "plugin:import/typescript" + ], "excludedFiles": "*.d.ts", "plugins": ["@typescript-eslint"], "rules": { @@ -25,7 +33,8 @@ "@typescript-eslint/ban-ts-comment": "off", "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/ban-types": "off", - "@typescript-eslint/no-explicit-any": "off" + "@typescript-eslint/no-explicit-any": "off", + "import/no-named-as-default-member": "off" } } ] diff --git a/packages/quill/package.json b/packages/quill/package.json index cd25a5a235..5ac18f36cb 100644 --- a/packages/quill/package.json +++ b/packages/quill/package.json @@ -29,8 +29,9 @@ "css-loader": "^6.8.1", "eslint": "^8.54.0", "eslint-config-prettier": "^9.0.0", + "eslint-import-resolver-typescript": "^3.6.1", "eslint-import-resolver-webpack": "^0.13.8", - "eslint-plugin-import": "^2.29.0", + "eslint-plugin-import": "^2.29.1", "eslint-plugin-jsx-a11y": "^6.8.0", "eslint-plugin-prettier": "^5.0.1", "highlight.js": "^9.18.1", diff --git a/packages/quill/src/blots/scroll.ts b/packages/quill/src/blots/scroll.ts index 91968fb7e6..4695d8c3a4 100644 --- a/packages/quill/src/blots/scroll.ts +++ b/packages/quill/src/blots/scroll.ts @@ -3,10 +3,9 @@ import type { Blot, Parent, EmbedBlot, ParentBlot, Registry } from 'parchment'; import Delta, { AttributeMap, Op } from 'quill-delta'; import Emitter from '../core/emitter'; import type { EmitterSource } from '../core/emitter'; -import Block, { BlockEmbed } from './block'; +import Block, { BlockEmbed, bubbleFormats } from './block'; import Break from './break'; import Container from './container'; -import { bubbleFormats } from './block'; type RenderBlock = | { diff --git a/packages/quill/src/core/emitter.ts b/packages/quill/src/core/emitter.ts index 07d563ebe6..d151f484e1 100644 --- a/packages/quill/src/core/emitter.ts +++ b/packages/quill/src/core/emitter.ts @@ -1,4 +1,4 @@ -import EventEmitter from 'eventemitter3'; +import { EventEmitter } from 'eventemitter3'; import instances from './instances'; import logger from './logger'; diff --git a/packages/quill/test/unit/modules/toolbar.spec.ts b/packages/quill/test/unit/modules/toolbar.spec.ts index bdae05f9f9..99ef6ae00e 100644 --- a/packages/quill/test/unit/modules/toolbar.spec.ts +++ b/packages/quill/test/unit/modules/toolbar.spec.ts @@ -1,9 +1,8 @@ import { describe, expect, test } from 'vitest'; import Quill from '../../../src/core/quill'; -import { addControls } from '../../../src/modules/toolbar'; +import Toolbar, { addControls } from '../../../src/modules/toolbar'; import { normalizeHTML } from '../__helpers__/utils'; import SnowTheme from '../../../src/themes/snow'; -import Toolbar from '../../../src/modules/toolbar'; import Clipboard from '../../../src/modules/clipboard'; import Keyboard from '../../../src/modules/keyboard'; import History from '../../../src/modules/history'; diff --git a/packages/quill/webpack.config.ts b/packages/quill/webpack.config.ts index 5c9a0d1435..b9d3997f75 100644 --- a/packages/quill/webpack.config.ts +++ b/packages/quill/webpack.config.ts @@ -1,11 +1,10 @@ -import path from 'path'; import { BannerPlugin, DefinePlugin } from 'webpack'; import type { Configuration } from 'webpack'; import common from './webpack.common'; import { merge } from 'webpack-merge'; import 'webpack-dev-server'; import { readFileSync } from 'fs'; -import { join } from 'path'; +import { join, resolve } from 'path'; const pkg = JSON.parse(readFileSync(join(__dirname, 'package.json'), 'utf8')); @@ -30,7 +29,7 @@ export default (env: Record) => plugins: [bannerPack, constantPack], devServer: { static: { - directory: path.resolve(__dirname, './dist'), + directory: resolve(__dirname, './dist'), }, hot: false, allowedHosts: 'all', diff --git a/tsconfig.json b/tsconfig.json index 3ba16e62c6..87860003ec 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,4 +1,10 @@ { + "ts-node": { + "compilerOptions": { + "esModuleInterop": true, + "module": "commonjs" + } + }, "compilerOptions": { "allowSyntheticDefaultImports": true, "target": "ES2020", @@ -9,7 +15,6 @@ "noEmit": true, "strictNullChecks": true, "noImplicitAny": true, - "verbatimModuleSyntax": true, "noUnusedLocals": true }, "include": ["./**/*"]