dense-analysis / dense-analysis/ale

Organize typescript imports as a fixer.

Open
#3,177 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Vim Script
Stars
14k
Forks
1.5k
Avg merge
17h 49m
Merged PRs (30d)
1

Description

Hello!

I've been wondering if it's possible to use `ale#organize_imports#Execute` as a fixer so it's possible to organize imports and format code with a single command.

I've tried running it with ALEFixPost/Pre autocommands but it either messes up the imports or leaves some code unformatted.

Here's the fixer implementation I tried to use but I'm quite new to vimscript so I'm not sure if it's possible to wait until after it's finished to run other fixers.

```vimscript
function! ale#fixers#tsserver_organize_imports#Fix(buffer) abort
return {
\ 'command': ale#organize_imports#Execute(),
\ 'read_temporary_file': 1,
\}
endfunction
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.