You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we have a organization format that is not enforced by the linter. It would be nice to have a linter rule that marked out-of-place imports as warnings within an IDE and organized imports when the linter was run with the --fix flag.
import{Foo}from'@some/3rd/party';// line breakimport{Bar}from'./../bar';// line break// line break// project code
Rule details:
Group 3rd party at top of file with no preceding line break
3rd party import is
a relative URL containing node_modules
an @ path import not found in tsconfig
path beginning with ~
Enforce single line break
Group internal imports (defined by relative links or paths found in tsconfig)
Local import is determined by:
relative URL
exclude relative URLs containing node_modules in the path
path beginning with @ that matches a path in tsconfig.paths
Enforce 2 line breaks
Note: ordering within groups still enforced by TSLint.
Currently we have a organization format that is not enforced by the linter. It would be nice to have a linter rule that marked out-of-place imports as warnings within an IDE and organized imports when the linter was run with the
--fix
flag.Rule details:
node_modules
@
path import not found intsconfig
~
node_modules
in the path@
that matches a path intsconfig.paths
Note: ordering within groups still enforced by TSLint.
Resources
It looks like Shopify created something like this: https://github.com/shopify-graveyard/tslint-config-shopify/pull/48/files
See https://blog.angularindepth.com/bending-tslint-to-your-needs-6ae0a51e633 for inspiration
The text was updated successfully, but these errors were encountered: