You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think I found an issue where eslint and prettier conflict and produce invalid TypeScript.
Using gts 3.0.1.
Test case:
functionrun(){warnLoudlyIfItSeemsSketch(doubleCheckTheSketch,flagsFlagsFlagsFlags,reticulatePlaceholderSplines,foo,bar,baz,qux);}// satisfy "declared but not used"run();
Note that the last line of the function has junk whitespace.
After gts fix:
$ git diff
diff --git a/test.ts b/test.ts
index b79d7554..3961fa05 100644
--- a/test.ts+++ b/test.ts@@ -1,6 +1,13 @@
function run() {
- warnLoudlyIfItSeemsSketch(doubleCheckTheSketch, flagsFlagsFlagsFlags, reticulatePlaceholderSplines, foo, bar, baz, qux);-+ warnLoudlyIfItSeemsSketch(+ doubleCheckTheSketch,+ flagsFlagsFlagsFlags,+ reticulatePlaceholderSplines,+ foo,+ bar,+ baz,+ qux+
}
// satisfy "declared but not used"
$
This is missing the final );, and thus invalid TypeScript. As far as I can tell this requires a combination of:
A very long line that gts wants to flatten out, and
Junk whitespace on the line after the long one.
Other info:
gts check output:
$ ./node_modules/gts/build/src/cli.js check test.ts
version: 12
/tmp/example/test.ts
2:29 error Replace `doubleCheckTheSketch,·flagsFlagsFlagsFlags,·reticulatePlaceholderSplines,·foo,·bar,·baz,·qux);` with `⏎····doubleCheckTheSketch,⏎····flagsFlagsFlagsFlags,⏎····reticulatePlaceholderSplines,⏎····foo,⏎····bar,⏎····baz,⏎····qux` prettier/prettier
3:1 error Trailing spaces not allowed no-trailing-spaces
3:3 error Replace `·` with `);` prettier/prettier
✖ 3 problems (3 errors, 0 warnings)
3 errors and 0 warnings potentially fixable with the `--fix` option.
$
Hello! Thanks for
gts
, it is super handy.I think I found an issue where
eslint
andprettier
conflict and produce invalid TypeScript.Using gts 3.0.1.
Test case:
Note that the last line of the function has junk whitespace.
After
gts fix
:This is missing the final
);
, and thus invalid TypeScript. As far as I can tell this requires a combination of:gts
wants to flatten out, andOther info:
gts check
output:gts fix
output:(An
eslint
fluent colleague tells me that this stacktrace is more or less to be expected)The text was updated successfully, but these errors were encountered: