From 3080575a17003d1e3ec293a6884bec1fe7ed3b02 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Fri, 30 Jun 2023 16:23:05 +0100 Subject: [PATCH] Fixed tests --- .../eslint-npm-8.39.0-d92bace04d.patch | 15 +++ package.json | 4 +- .../NoteEditor/CodeMirror/CodeMirror.test.ts | 2 - ...rkdownCommands.bulletedVsChecklist.test.ts | 3 +- .../CodeMirror/markdownCommands.test.ts | 2 - .../markdownCommands.toggleList.test.ts | 2 - .../CodeMirror/markdownMathParser.test.ts | 3 - .../MdToHtml/createEventHandlingAttrs.test.ts | 2 - yarn.lock | 96 +++---------------- 9 files changed, 34 insertions(+), 95 deletions(-) create mode 100644 .yarn/patches/eslint-npm-8.39.0-d92bace04d.patch diff --git a/.yarn/patches/eslint-npm-8.39.0-d92bace04d.patch b/.yarn/patches/eslint-npm-8.39.0-d92bace04d.patch new file mode 100644 index 0000000000..a7945e1e78 --- /dev/null +++ b/.yarn/patches/eslint-npm-8.39.0-d92bace04d.patch @@ -0,0 +1,15 @@ +diff --git a/lib/rules/multiline-comment-style.js b/lib/rules/multiline-comment-style.js +index 9cb7f3473e5a124e2eedb12685650f047afa84b6..124e062955e1b51cbdddd0920c22446dc97dd261 100644 +--- a/lib/rules/multiline-comment-style.js ++++ b/lib/rules/multiline-comment-style.js +@@ -377,6 +377,10 @@ module.exports = { + commentLines = commentLines.slice(1, commentLines.length - 1); + } + ++ // We have to allow this because it's always a top comment and ++ // it has to be in a jsdoc block ++ if (commentLines.join('').trim().startsWith('@jest-environment')) return; ++ + const tokenAfter = sourceCode.getTokenAfter(firstComment, { includeComments: true }); + + if (tokenAfter && firstComment.loc.end.line === tokenAfter.loc.start.line) { diff --git a/package.json b/package.json index ca17308d9a..eb08c05355 100644 --- a/package.json +++ b/package.json @@ -96,6 +96,8 @@ "packageManager": "yarn@3.5.0", "resolutions": { "react-native-camera@4.2.1": "patch:react-native-camera@npm%3A4.2.1#./.yarn/patches/react-native-camera-npm-4.2.1-24b2600a7e.patch", - "react-native-vosk@0.1.12": "patch:react-native-vosk@npm%3A0.1.12#./.yarn/patches/react-native-vosk-npm-0.1.12-76b1caaae8.patch" + "react-native-vosk@0.1.12": "patch:react-native-vosk@npm%3A0.1.12#./.yarn/patches/react-native-vosk-npm-0.1.12-76b1caaae8.patch", + "eslint@8.39.0": "patch:eslint@npm%3A8.39.0#./.yarn/patches/eslint-npm-8.39.0-d92bace04d.patch", + "eslint@^8.13.0": "patch:eslint@npm%3A8.39.0#./.yarn/patches/eslint-npm-8.39.0-d92bace04d.patch" } } diff --git a/packages/app-mobile/components/NoteEditor/CodeMirror/CodeMirror.test.ts b/packages/app-mobile/components/NoteEditor/CodeMirror/CodeMirror.test.ts index d5262a1049..96f79593f6 100644 --- a/packages/app-mobile/components/NoteEditor/CodeMirror/CodeMirror.test.ts +++ b/packages/app-mobile/components/NoteEditor/CodeMirror/CodeMirror.test.ts @@ -1,8 +1,6 @@ -/* eslint-disable multiline-comment-style */ /** * @jest-environment jsdom */ -/* eslint-enable multiline-comment-style */ import { EditorSettings } from '../types'; import { initCodeMirror } from './CodeMirror'; diff --git a/packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.bulletedVsChecklist.test.ts b/packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.bulletedVsChecklist.test.ts index 493b71352a..dcd90b2dc2 100644 --- a/packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.bulletedVsChecklist.test.ts +++ b/packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.bulletedVsChecklist.test.ts @@ -1,8 +1,7 @@ -/* eslint-disable multiline-comment-style */ /** * @jest-environment jsdom */ -/* eslint-enable multiline-comment-style */ + import { EditorSelection } from '@codemirror/state'; import { ListType } from '../types'; import createEditor from './testUtil/createEditor'; diff --git a/packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.test.ts b/packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.test.ts index 20497a2ccd..341ef6c40d 100644 --- a/packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.test.ts +++ b/packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.test.ts @@ -1,8 +1,6 @@ -/* eslint-disable multiline-comment-style */ /** * @jest-environment jsdom */ -/* eslint-enable multiline-comment-style */ import { EditorSelection } from '@codemirror/state'; import { diff --git a/packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.toggleList.test.ts b/packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.toggleList.test.ts index e5bc530ef0..aa87c8fb42 100644 --- a/packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.toggleList.test.ts +++ b/packages/app-mobile/components/NoteEditor/CodeMirror/markdownCommands.toggleList.test.ts @@ -1,8 +1,6 @@ -/* eslint-disable multiline-comment-style */ /** * @jest-environment jsdom */ -/* eslint-enable multiline-comment-style */ import { EditorSelection, EditorState } from '@codemirror/state'; import { diff --git a/packages/app-mobile/components/NoteEditor/CodeMirror/markdownMathParser.test.ts b/packages/app-mobile/components/NoteEditor/CodeMirror/markdownMathParser.test.ts index 1f1658b42f..af74ce7aba 100644 --- a/packages/app-mobile/components/NoteEditor/CodeMirror/markdownMathParser.test.ts +++ b/packages/app-mobile/components/NoteEditor/CodeMirror/markdownMathParser.test.ts @@ -1,9 +1,6 @@ -/* eslint-disable multiline-comment-style */ /** * @jest-environment jsdom */ -/* eslint-enable multiline-comment-style */ - import { syntaxTree } from '@codemirror/language'; import { SyntaxNode } from '@lezer/common'; import { EditorSelection, EditorState } from '@codemirror/state'; diff --git a/packages/renderer/MdToHtml/createEventHandlingAttrs.test.ts b/packages/renderer/MdToHtml/createEventHandlingAttrs.test.ts index 3e15e36897..1ba9637bec 100644 --- a/packages/renderer/MdToHtml/createEventHandlingAttrs.test.ts +++ b/packages/renderer/MdToHtml/createEventHandlingAttrs.test.ts @@ -1,8 +1,6 @@ -/* eslint-disable multiline-comment-style */ /** * @jest-environment jsdom */ -/* eslint-enable multiline-comment-style */ import { createEventHandlingListeners, Options } from './createEventHandlingAttrs'; import { describe, beforeAll, it, jest, expect } from '@jest/globals'; diff --git a/yarn.lock b/yarn.lock index fda86b805f..64f5b9361c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3604,23 +3604,6 @@ __metadata: languageName: node linkType: hard -"@eslint/eslintrc@npm:^1.3.3": - version: 1.3.3 - resolution: "@eslint/eslintrc@npm:1.3.3" - dependencies: - ajv: ^6.12.4 - debug: ^4.3.2 - espree: ^9.4.0 - globals: ^13.15.0 - ignore: ^5.2.0 - import-fresh: ^3.2.1 - js-yaml: ^4.1.0 - minimatch: ^3.1.2 - strip-json-comments: ^3.1.1 - checksum: f03e9d6727efd3e0719da2051ea80c0c73d20e28c171121527dbb868cd34232ca9c1d0525a66e517a404afea26624b1e47895b6a92474678418c2f50c9566694 - languageName: node - linkType: hard - "@eslint/eslintrc@npm:^2.0.2": version: 2.0.3 resolution: "@eslint/eslintrc@npm:2.0.3" @@ -3858,17 +3841,6 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/config-array@npm:^0.11.6": - version: 0.11.7 - resolution: "@humanwhocodes/config-array@npm:0.11.7" - dependencies: - "@humanwhocodes/object-schema": ^1.2.1 - debug: ^4.1.1 - minimatch: ^3.0.5 - checksum: cf506dc45d9488af7fbf108ea6ac2151ba1a25e6d2b94b9b4fc36d2c1e4099b89ff560296dbfa13947e44604d4ca4a90d97a4fb167370bf8dd01a6ca2b6d83ac - languageName: node - linkType: hard - "@humanwhocodes/config-array@npm:^0.11.8": version: 0.11.8 resolution: "@humanwhocodes/config-array@npm:0.11.8" @@ -15808,16 +15780,6 @@ __metadata: languageName: node linkType: hard -"eslint-scope@npm:^7.1.1": - version: 7.1.1 - resolution: "eslint-scope@npm:7.1.1" - dependencies: - esrecurse: ^4.3.0 - estraverse: ^5.2.0 - checksum: 9f6e974ab2db641ca8ab13508c405b7b859e72afe9f254e8131ff154d2f40c99ad4545ce326fd9fde3212ff29707102562a4834f1c48617b35d98c71a97fbf3e - languageName: node - linkType: hard - "eslint-scope@npm:^7.2.0": version: 7.2.0 resolution: "eslint-scope@npm:7.2.0" @@ -15926,12 +15888,15 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^8.13.0": - version: 8.27.0 - resolution: "eslint@npm:8.27.0" +"eslint@patch:eslint@npm%3A8.39.0#./.yarn/patches/eslint-npm-8.39.0-d92bace04d.patch::locator=root%40workspace%3A.": + version: 8.39.0 + resolution: "eslint@patch:eslint@npm%3A8.39.0#./.yarn/patches/eslint-npm-8.39.0-d92bace04d.patch::version=8.39.0&hash=a7bcf0&locator=root%40workspace%3A." dependencies: - "@eslint/eslintrc": ^1.3.3 - "@humanwhocodes/config-array": ^0.11.6 + "@eslint-community/eslint-utils": ^4.2.0 + "@eslint-community/regexpp": ^4.4.0 + "@eslint/eslintrc": ^2.0.2 + "@eslint/js": 8.39.0 + "@humanwhocodes/config-array": ^0.11.8 "@humanwhocodes/module-importer": ^1.0.1 "@nodelib/fs.walk": ^1.2.8 ajv: ^6.10.0 @@ -15940,17 +15905,16 @@ __metadata: debug: ^4.3.2 doctrine: ^3.0.0 escape-string-regexp: ^4.0.0 - eslint-scope: ^7.1.1 - eslint-utils: ^3.0.0 - eslint-visitor-keys: ^3.3.0 - espree: ^9.4.0 - esquery: ^1.4.0 + eslint-scope: ^7.2.0 + eslint-visitor-keys: ^3.4.0 + espree: ^9.5.1 + esquery: ^1.4.2 esutils: ^2.0.2 fast-deep-equal: ^3.1.3 file-entry-cache: ^6.0.1 find-up: ^5.0.0 glob-parent: ^6.0.2 - globals: ^13.15.0 + globals: ^13.19.0 grapheme-splitter: ^1.0.4 ignore: ^5.2.0 import-fresh: ^3.0.0 @@ -15965,13 +15929,12 @@ __metadata: minimatch: ^3.1.2 natural-compare: ^1.4.0 optionator: ^0.9.1 - regexpp: ^3.2.0 strip-ansi: ^6.0.1 strip-json-comments: ^3.1.0 text-table: ^0.2.0 bin: eslint: bin/eslint.js - checksum: 153b022d309e1b647a73b1bb0fa98912add699b06e279084155f23c6f2b5fc5abd05411fc1ba81608a24bbfaf044ca079544c16fffa6fc987b8f676c9960a2c4 + checksum: 4880c67fc762d644853ef71a108b9d37f3a0ca1fc9c5c87382e2be526520b8cc5eb3c6465d08100ab3e23b464b29d95a1b36183783f730444e14240875975c29 languageName: node linkType: hard @@ -15982,17 +15945,6 @@ __metadata: languageName: node linkType: hard -"espree@npm:^9.4.0": - version: 9.4.1 - resolution: "espree@npm:9.4.1" - dependencies: - acorn: ^8.8.0 - acorn-jsx: ^5.3.2 - eslint-visitor-keys: ^3.3.0 - checksum: 4d266b0cf81c7dfe69e542c7df0f246e78d29f5b04dda36e514eb4c7af117ee6cfbd3280e560571ed82ff6c9c3f0003c05b82583fc7a94006db7497c4fe4270e - languageName: node - linkType: hard - "espree@npm:^9.5.1, espree@npm:^9.5.2": version: 9.5.2 resolution: "espree@npm:9.5.2" @@ -16014,15 +15966,6 @@ __metadata: languageName: node linkType: hard -"esquery@npm:^1.4.0": - version: 1.4.0 - resolution: "esquery@npm:1.4.0" - dependencies: - estraverse: ^5.1.0 - checksum: a0807e17abd7fbe5fbd4fab673038d6d8a50675cdae6b04fbaa520c34581be0c5fa24582990e8acd8854f671dd291c78bb2efb9e0ed5b62f33bac4f9cf820210 - languageName: node - linkType: hard - "esquery@npm:^1.4.2": version: 1.5.0 resolution: "esquery@npm:1.5.0" @@ -18001,15 +17944,6 @@ __metadata: languageName: node linkType: hard -"globals@npm:^13.15.0": - version: 13.17.0 - resolution: "globals@npm:13.17.0" - dependencies: - type-fest: ^0.20.2 - checksum: fbaf4112e59b92c9f5575e85ce65e9e17c0b82711196ec5f58beb08599bbd92fd72703d6dfc9b080381fd35b644e1b11dcf25b38cc2341ec21df942594cbc8ce - languageName: node - linkType: hard - "globals@npm:^13.19.0": version: 13.19.0 resolution: "globals@npm:13.19.0" @@ -28959,7 +28893,7 @@ __metadata: languageName: node linkType: hard -"regexpp@npm:^3.0.0, regexpp@npm:^3.2.0": +"regexpp@npm:^3.0.0": version: 3.2.0 resolution: "regexpp@npm:3.2.0" checksum: a78dc5c7158ad9ddcfe01aa9144f46e192ddbfa7b263895a70a5c6c73edd9ce85faf7c0430e59ac38839e1734e275b9c3de5c57ee3ab6edc0e0b1bdebefccef8