mirror of
https://github.com/bitwarden/browser
synced 2025-01-03 05:38:33 +01:00
Add eslint rule prohibiting Bitwarden-licensed imports in OSS code (#9801)
This commit is contained in:
parent
d7bf0fe536
commit
4a8b44b662
@ -324,6 +324,26 @@
|
||||
"rules": {
|
||||
"no-restricted-imports": ["error", { "patterns": ["@bitwarden/bit-common/*", "src/**/*"] }]
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": ["apps/**/*.ts"],
|
||||
"rules": {
|
||||
// Catches static imports
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
{
|
||||
"patterns": ["biwarden_license/**", "@bitwarden/bit-common/*", "@bitwarden/bit-web/*"]
|
||||
}
|
||||
],
|
||||
// Catches dynamic imports, e.g. in routing modules where modules are lazy-loaded
|
||||
"no-restricted-syntax": [
|
||||
"error",
|
||||
{
|
||||
"message": "Don't import Bitwarden licensed code into OSS code.",
|
||||
"selector": "ImportExpression > Literal.source[value=/.*(bitwarden_license|bit-common|bit-web).*/]"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user