diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 3be3c796..c7ad2612 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -29,6 +29,7 @@ module.exports = { 'react/no-deprecated': 'off', 'no-console': 'off', 'no-trailing-spaces': 'error', + 'ckeditor5-rules/prevent-license-key-leak': 'error', 'ckeditor5-rules/allow-imports-only-from-main-package-entry-point': 'off', 'ckeditor5-rules/license-header': [ 'error', { headerLines: [ '/**', diff --git a/demos/cdn-multiroot-react/MultiRootEditorRichDemo.tsx b/demos/cdn-multiroot-react/MultiRootEditorRichDemo.tsx index 8efbafe0..d2184369 100644 --- a/demos/cdn-multiroot-react/MultiRootEditorRichDemo.tsx +++ b/demos/cdn-multiroot-react/MultiRootEditorRichDemo.tsx @@ -128,6 +128,7 @@ const MultiRootEditorRichDemo = withCKCloud( ( props: EditorDemoProps ): JSX.Ele const removeRoot = ( rootName: string ) => { setData( previousData => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const { [ rootName! ]: _, ...newData } = previousData; return { ...newData }; diff --git a/demos/npm-multiroot-react/MultiRootEditorRichDemo.tsx b/demos/npm-multiroot-react/MultiRootEditorRichDemo.tsx index cc229b4d..99a7d519 100644 --- a/demos/npm-multiroot-react/MultiRootEditorRichDemo.tsx +++ b/demos/npm-multiroot-react/MultiRootEditorRichDemo.tsx @@ -115,6 +115,7 @@ export default function MultiRootEditorRichDemo( props: EditorDemoProps ): JSX.E const removeRoot = ( rootName: string ) => { setData( previousData => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const { [ rootName! ]: _, ...newData } = previousData; return { ...newData }; diff --git a/package.json b/package.json index 82b3eb7e..f2a7a991 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "ckeditor5-premium-features": "^42.0.0", "coveralls": "^3.1.1", "eslint": "^7.19.0", - "eslint-config-ckeditor5": "^5.3.2", + "eslint-config-ckeditor5": "^7.1.0", "eslint-plugin-react": "^7.32.2", "husky": "^8.0.2", "lint-staged": "^10.2.11", diff --git a/src/useMultiRootEditor.tsx b/src/useMultiRootEditor.tsx index f372e581..17acd621 100644 --- a/src/useMultiRootEditor.tsx +++ b/src/useMultiRootEditor.tsx @@ -248,12 +248,14 @@ const useMultiRootEditor = ( props: MultiRootHookProps ): MultiRootHookReturns = if ( !props.disableTwoWayDataBinding ) { setData( previousData => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const { [ rootName! ]: _, ...newData } = previousData; return { ...newData }; } ); setAttributes( previousAttributes => { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const { [ rootName! ]: _, ...newAttributes } = previousAttributes; return { ...newAttributes }; diff --git a/tests/_utils/editor.ts b/tests/_utils/editor.ts index 8c062b60..54d97df9 100644 --- a/tests/_utils/editor.ts +++ b/tests/_utils/editor.ts @@ -111,7 +111,7 @@ export default class MockEditor { function createDocument() { return { - on( _, __ ) {}, + on() {}, off() {}, getRootNames() { return [ 'main' ]; diff --git a/yarn.lock b/yarn.lock index ab799d2e..d9a8e611 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4990,21 +4990,21 @@ escodegen@^2.1.0: optionalDependencies: source-map "~0.6.1" -eslint-config-ckeditor5@^5.3.2: - version "5.3.2" - resolved "https://registry.yarnpkg.com/eslint-config-ckeditor5/-/eslint-config-ckeditor5-5.3.2.tgz#1369f295ec294731d825b1fdafb18d6fa0793382" - integrity sha512-40zDbEf9zKnZNoIOhN+mMIuqRtYs4caL3ILRj/yVkiwR/bHWDoOQzhTJGnU1ZToiQ6y9W/Kv0WaZcNfSiVXkZA== +eslint-config-ckeditor5@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-ckeditor5/-/eslint-config-ckeditor5-7.1.0.tgz#4ad506ed16ecc454e89f1d2db5e627af9d06955a" + integrity sha512-Ki8V5JG10NZw4EK1qBLPL8292WoAFuLHAW1Iwbk8wn3m6oVIjLr+KRMFB+wzk7J5yQeRbJOh7WHF5iVZrotjlw== dependencies: "@typescript-eslint/eslint-plugin" "^5.26.0" "@typescript-eslint/parser" "^5.26.0" - eslint-plugin-ckeditor5-rules "^5.3.2" + eslint-plugin-ckeditor5-rules "^7.1.0" eslint-plugin-mocha "^7.0.0" typescript "^4.7.2" -eslint-plugin-ckeditor5-rules@^5.3.2: - version "5.3.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-ckeditor5-rules/-/eslint-plugin-ckeditor5-rules-5.3.2.tgz#a6bce9b72e992054fa53134387c7ed55cad2e69e" - integrity sha512-GmaRT93JljrD8FH2LQvlwOVBwqM5q1/VWnlwRlnA8JWZy5EuOUInZKfN7y7Tt9j70cm5qqQNjMfTsnkp6oi6yw== +eslint-plugin-ckeditor5-rules@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-ckeditor5-rules/-/eslint-plugin-ckeditor5-rules-7.1.0.tgz#50b5885d3dca65e318edadac49db9a2d7fba25da" + integrity sha512-nhGy4+dA7OVsUTtkkP/Y5iFdVpjczKRxc1As0YxoHm0xhQPx6tb5UoOeMRzT47gm5PVG808Tyz9/zWALgUGCXw== dependencies: "@es-joy/jsdoccomment" "^0.40.1" "@typescript-eslint/parser" "^5.52.0" @@ -7880,7 +7880,7 @@ raw-loader@^4.0.1: loader-utils "^2.0.0" schema-utils "^3.0.0" -react-dom@^18.0.0, "react18-dom@npm:react-dom@^18.0.0": +react-dom@^18.0.0: version "18.3.1" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4" integrity sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw== @@ -7922,7 +7922,15 @@ react-refresh@^0.14.2: object-assign "^4.1.1" prop-types "^15.6.2" -"react18@npm:react@^18.0.0", react@^18.0.0: +"react18-dom@npm:react-dom@^18.0.0": + version "18.3.1" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4" + integrity sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw== + dependencies: + loose-envify "^1.1.0" + scheduler "^0.23.2" + +"react18@npm:react@^18.0.0": version "18.3.1" resolved "https://registry.yarnpkg.com/react/-/react-18.3.1.tgz#49ab892009c53933625bd16b2533fc754cab2891" integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ== @@ -7941,6 +7949,13 @@ react-refresh@^0.14.2: resolved "https://registry.yarnpkg.com/react/-/react-19.0.0-beta-26f2496093-20240514.tgz#3a0d63746b3f9ebd461a0731191bd08047fb1dbb" integrity sha512-ZsU/WjNZ6GfzMWsq2DcGjElpV9it8JmETHm9mAJuOJNhuJcWJxt8ltCJabONFRpDFq1A/DP0d0KFj9CTJVM4VA== +react@^18.0.0: + version "18.3.1" + resolved "https://registry.yarnpkg.com/react/-/react-18.3.1.tgz#49ab892009c53933625bd16b2533fc754cab2891" + integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ== + dependencies: + loose-envify "^1.1.0" + read-cache@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/read-cache/-/read-cache-1.0.0.tgz#e664ef31161166c9751cdbe8dbcf86b5fb58f774" @@ -8733,7 +8748,7 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -8747,6 +8762,13 @@ strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1, strip-ansi@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -9551,7 +9573,16 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@7.0.0, wrap-ansi@^6.2.0, wrap-ansi@^7.0.0, wrap-ansi@^8.0.1, wrap-ansi@^8.1.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@7.0.0, wrap-ansi@^6.2.0, wrap-ansi@^7.0.0, wrap-ansi@^8.0.1, wrap-ansi@^8.1.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==