Repository navigation
Add ESLint recommended rules - #776
Conversation
| commandServerApi: () => commandServerApi, | ||
| getNodeAtLocation: () => getNodeAtLocation, | ||
| } as FactoryMap<Graph>); | ||
| graph.debug.init(); |
There was a problem hiding this comment.
Debug#init was empty, so removed it altogether, since it's not implementing anything.
There was a problem hiding this comment.
The way the graph works, accessing an attribute will cause the component to be instantiated, so it's possible this line was actually doing something
There was a problem hiding this comment.
I believe this is the only remaining issue on this PR
There was a problem hiding this comment.
Reverted this change. I'm not convinced this line is doing much in practice, but we can look into it later.
|
Might leave explicit-function-return-type for later, that one might get a bit gnarly. |
| @@ -1,41 +1,39 @@ | |||
| // @ts-nocheck | |||
| // From https://github.com/nodeca/js-yaml/issues/586#issuecomment-814310104 | |||
There was a problem hiding this comment.
Epic! Presumably you tried running this? I don't believe it is actually tested. Best test is prob to run the "Update snapshots" debug launch config in VSCode
There was a problem hiding this comment.
Huh, it seems like I may have accidentally made documentContents serialise as an inline string. I'll look into that.
There was a problem hiding this comment.
Oh wait, that might just be because I have hard tabs by default, so the YAML serialiser wants to serialise a tab character as "\t":
documentContents: "try {\n\tif (true) {\n\t const foo = \"hello\";\n\t}\n} catch (err) {\n\t\n}\n\ntry {\n\tconst bar = \"hello\";\n} catch (err) {\n\t\n}"There was a problem hiding this comment.
Yeah probably. Might be worth just changing your local setting temporarily so we don't have to wait on #731?
There was a problem hiding this comment.
Okay, ran update snapshots with the default soft tabs, got this diff:
diff --git i/src/test/suite/fixtures/recorded/actions/snippets/snipDuplicatedDuplicatedHelloWorld.yml w/src/test/suite/fixtures/recorded/actions/snippets/snipDuplicatedDuplicatedHelloWorld.yml
index 4fb1c39ee51b..82281ea1bd5a 100644
--- i/src/test/suite/fixtures/recorded/actions/snippets/snipDuplicatedDuplicatedHelloWorld.yml
+++ w/src/test/suite/fixtures/recorded/actions/snippets/snipDuplicatedDuplicatedHelloWorld.yml
@@ -19,11 +19,11 @@ initialState:
finalState:
documentContents: >-
This variable: 'hello_world' is duplicated here: 'hello_world', but '' is
unique!
selections:
- - anchor: {line: 0, character: 69}
- active: {line: 0, character: 69}
+ - anchor: {line: 0, character: 0}
+ active: {line: 0, character: 0}
thatMark:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 81}
fullTargets: [{type: primitive, mark: {type: cursor}, modifiers: [{type: toRawSelection}]}]
diff --git i/src/test/suite/fixtures/recorded/actions/snippets/snipSpaghetti.yml w/src/test/suite/fixtures/recorded/actions/snippets/snipSpaghetti.yml
index 3393f857b693..2b89cc984297 100644
--- i/src/test/suite/fixtures/recorded/actions/snippets/snipSpaghetti.yml
+++ w/src/test/suite/fixtures/recorded/actions/snippets/snipSpaghetti.yml
@@ -13,11 +13,11 @@ initialState:
active: {line: 0, character: 0}
marks: {}
finalState:
documentContents: My friend likes to eat spaghetti!
selections:
- - anchor: {line: 0, character: 10}
- active: {line: 0, character: 10}
+ - anchor: {line: 0, character: 0}
+ active: {line: 0, character: 0}
thatMark:
- anchor: {line: 0, character: 0}
active: {line: 0, character: 34}
fullTargets: [{type: primitive, mark: {type: cursor}, selectionType: token, position: contents, insideOutsideType: inside, modifier: {type: identity}}]
diff --git i/src/test/suite/fixtures/recorded/selectionTypes/changeShortPaintParen.yml w/src/test/suite/fixtures/recorded/selectionTypes/changeShortPaintParen.yml
index a29af962ed1e..4889696e754e 100644
--- i/src/test/suite/fixtures/recorded/selectionTypes/changeShortPaintParen.yml
+++ w/src/test/suite/fixtures/recorded/selectionTypes/changeShortPaintParen.yml
@@ -1,6 +1,5 @@
-
command:
spokenForm: change short paint paren
version: 2
targets:
- type: primitiveThe last one makes sense. What happened with the first two changes?
There was a problem hiding this comment.
Ok well it has nothing to do with what you've done in this PR, so I'd consider this a passing test from that perspective.
As for why it's doing that, idk that's weird. Are tests passing for you locally?
There was a problem hiding this comment.
Oddly enough they are passing locally after blowing away those changes. 🤔
There was a problem hiding this comment.
Strange. Possible that test fails nondeterministically. We retry all tests 5 times because VSCode tests are generally flakey for us, but when you do a snapshot update it will just use the first result so any failure will just become a snapshot update and not re-run
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
Part of #714
Adds the following ESLint rules:
eslint:recommendedtypescript-eslint/recommended@typescript-eslint/consistent-type-assertionsRan
yarn lint --fixthen fixed the unautofixable lints.Todo: