I use tslint with default config tslint:recommended
and I want to adapt as less rules as possible.
Certain rules enforce that imports should be alphabetized:
src/core/task/TaskMockDecorator.ts[2, 1]: Import sources within a group must be alphabetized.
src/core/task/taskRunner.ts[1, 16]: Named imports must be alphabetized.
I don't want to sort the imports alphabetically by myself. Before I disable that linting: Can WebStorm / PhpStorm do that for me?
In WebStorm and Rider there is default keymap action to Optimize Imports, under CTRL+ALT+O, I suppose that it exist in PhpStorm as well.
According to webstorm: https://www.jetbrains.com/help/webstorm/tslint.html
With WebStorm, you can fix some of the issues reported by TSLint > automatically.
To fix a specific error, place the cursor at the highlighted code, press ⌥⏎, and then choose TSLint: fix current error from the pop-up menu. To fix all the issues detected in the file, choose TSLint: fix current file.
As of TSLint 4.0, the ordered-imports rule features automatic fixing of violations. You can run it through the CLI with the --fix
flag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With