-
Notifications
You must be signed in to change notification settings - Fork 27.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Layer breakers here and there #15293
Comments
Note that the rule does not yet check for importing node-modules outside of |
I love this. |
Very cool 👍 |
This the list of bad node_module imports
|
I've fixed the issues from my world. @bpasero appears to have done the same. Here's the updated
🎆 |
Fixed
|
Remaining:
|
These are the remaining errors
|
I fixed the viewletService one (fyi @octref) |
Fixed my parts.. once
|
This is the correct full list:
|
@joaomoreno I'll look into these. We got distracted by the partial lists. How does one get the full list? |
@sandy081 So what do we do about |
The remaining |
All warnings resolved 👯♂️ Thanks everyone. |
This the configuration of our 3 new rules "layering": [
true,
{
"common": [],
"node": [
"common"
],
"browser": [
"common"
],
"electron-main": [
"common",
"node"
],
"electron-browser": [
"common",
"browser",
"node"
]
}
],
"import-patterns": [
true,
{
"target": "**/{node,electron-browser,electron-main,extensions}/**",
"restrictions": "**/*"
},
{
"target": "{**/**.test.ts,**/test/**}",
"restrictions": "{**/vs/**,assert,sinon}"
},
{
"target": "**/{common,browser,workbench}/**",
"restrictions": "**/vs/**"
}
],
"duplicate-imports": true |
We have a way of structuring our code in layers and target runtimes. That's why our code is organised into folders like
common
,browser
,node
,electron-main
, andelectron-browser
. The idea of target environments is to have easily reusable code. It also means, code from a lower layer isn't allowed to use code from a higher layer.We don't always stick to that rule and therefore I have added a tslint-rule. It's not yet enabled because there are still too many violations. This issue is a collection of all of them. If you are assigned make sure to move your code into the right folder.
To run the check yourself do this
layering
totrue
gulp tslint
After a minute or two, it will produce output like this
The text was updated successfully, but these errors were encountered: