menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

Theia

Eclipse Theia - Cloud & Desktop IDE

Channels
Team

Autoformat Fighting eslint Rules

January 27, 2020 at 4:44pm

Autoformat Fighting eslint Rules

January 27, 2020 at 4:44pm
Folks, since rebasing on https://github.com/eclipse-theia/theia/commit/1ca3ec37c079a6b316278cf292609653e57b8151 , I cannot edit the file callhierarchy-tree-widget.tsx anymore. The formatter (runs on save, even though I've turned that off int the preferences???) insists on formatting
this.editorManager.open(
new URI(uri), {
mode: keepFocus ? 'reveal' : 'activate',
selection: range
}
).then(editorWidget => {
but eslint wants
this.editorManager.open(
new URI(uri), {
mode: keepFocus ? 'reveal' : 'activate',
selection: range
}
).then(editorWidget => {
Can someone advise, please? ?

January 27, 2020 at 6:14pm
Ok, two solutions:
this.editorManager.open(
new URI(location.uri),
{
mode: keepFocus ? 'reveal' : 'activate',
selection: Range.create(location.range.start, location.range.end)
}
).then(editorWidget => {
Or we disable the indent rule because I don't know what VS Code formatter to use that wouldn't fight ESLint... That specific rule was automatically generated when I converted the tslint configs, but we can always remove it.
thoughts?
Edited
Also, we apparently would have to use prettier with eslint?
Edited

January 28, 2020 at 3:23am
prettier is not necessary, we should adjust eslint to follow typescript extension formatter
i really don't want another very opinionated tool
Edited
default formatter from typescript extension is good, if eslint disagree with it then just silent it
it would be good to enable auto formatting on save for VS Code and Theia that all code gets reformatted incrementally

January 28, 2020 at 12:46pm
just disable this eslint rule and use typescript extension formatting