File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ export default class DocumentWatcher {
145145 }
146146
147147 private async handleTextEditorChange ( editor ?: TextEditor ) {
148- if ( editor && editor . document ) {
148+ if ( editor ? .document ) {
149149 const newOptions = await resolveTextEditorOptions (
150150 ( this . doc = editor . document ) ,
151151 {
Original file line number Diff line number Diff line change @@ -11,8 +11,7 @@ const readFile = promisify(_readFile)
1111 * current vscode settings.
1212 */
1313export async function generateEditorConfig ( uri : Uri ) {
14- const workspaceUri =
15- workspace . workspaceFolders && workspace . workspaceFolders [ 0 ] . uri
14+ const workspaceUri = workspace . workspaceFolders ?. [ 0 ] . uri
1615 const currentUri = uri || workspaceUri
1716 if ( ! currentUri ) {
1817 window . showErrorMessage ( "Workspace doesn't contain any folders." )
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export class InsertFinalNewline extends PreSaveTransformation {
3030 return { edits : [ ] }
3131 }
3232
33- if ( window . activeTextEditor && window . activeTextEditor . document === doc ) {
33+ if ( window . activeTextEditor ? .document === doc ) {
3434 commands . executeCommand ( 'editor.action.insertFinalNewLine' )
3535 return {
3636 edits : [ ] ,
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export class TrimTrailingWhitespace extends PreSaveTransformation {
4040 return { edits : [ ] }
4141 }
4242
43- if ( window . activeTextEditor && window . activeTextEditor . document === doc ) {
43+ if ( window . activeTextEditor ? .document === doc ) {
4444 const trimReason =
4545 reason !== TextDocumentSaveReason . Manual ? 'auto-save' : null
4646 commands . executeCommand ( 'editor.action.trimTrailingWhitespace' , {
You can’t perform that action at this time.
0 commit comments