Enforce "Import Destructuring Spacing" in tslint
See original GitHub issueMotivation
Right now there is no consistent way to handle spaces in destructured imports, this introduces some noise in commits as right now we have no spaces, but angular CLI as well as some formatters actually add spaces.
Also ts-lint only validates the case with spaces
Solution
- Add spaces across the codebase
- Add TS-lint rule
- Document the configuration for the websorm and VSCode
Editor configuration
Intellij/Webstorm
Settings -> Code Style -> TypeScript -> Spaces Tab -> Check “ES6 import/export braces”
see also https://github.com/mgechev/codelyzer/issues/40 https://stackoverflow.com/questions/41447602/tslint-remove-missing-whitespace-rule-on-import
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
TSLint core rules - Palantir Open Source
trailing-comma - Requires or disallows trailing commas in array and object literals, destructuring assignments, function typings, named imports and exports and ...
Read more >TSLINT: Remove Missing Whitespace rule on Import
However, I am new to linting and I am not sure where to find the right rule to disable. I still want some...
Read more >Codelyzer core rules
import -destructuring-spacing - Ensures imports are consistent and tidy. TS Only. no-host-metadata-property - Disallows usage of the host metadata property. TS ...
Read more >object-curly-spacing - ESLint - Pluggable JavaScript Linter
Rule Details This rule enforces consistent spacing inside braces of object literals, destructuring assignments, and import/export specifiers.
Read more >angular-tslint-rules - npm
Shared TSLint & codelyzer rules to enforce a consistent code style for Angular development. ... Put one space between the import statement keywords....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh didn’t see this until now lol
Added to contributing md, assume vs code does that