mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
[PM-22629] Forbid importing popup outside (#15168)
Adds an eslint rule forbidding non popup scripts from importing popups. Also added a webpack plugin that throws if it detects @angular inside background output.
This commit is contained in:
@@ -279,6 +279,31 @@ export default tseslint.config(
|
||||
]),
|
||||
},
|
||||
},
|
||||
// Browser background and content scripts are not allowed to import from the popup directory
|
||||
{
|
||||
files: ["apps/browser/src/**/*.ts"],
|
||||
rules: {
|
||||
"no-restricted-imports": buildNoRestrictedImports([
|
||||
"@angular",
|
||||
"bitwarden_license/**",
|
||||
"@bitwarden/bit-common/*",
|
||||
"@bitwarden/bit-web/*",
|
||||
|
||||
"**/popup/*",
|
||||
]),
|
||||
},
|
||||
},
|
||||
// This removes the previous rule forbidding imports from the popup directory
|
||||
{
|
||||
files: ["apps/browser/src/**/popup/**/*.ts"],
|
||||
rules: {
|
||||
"no-restricted-imports": buildNoRestrictedImports([
|
||||
"bitwarden_license/**",
|
||||
"@bitwarden/bit-common/*",
|
||||
"@bitwarden/bit-web/*",
|
||||
]),
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["libs/nx-plugin/**/*.ts", "libs/nx-plugin/**/*.js"],
|
||||
rules: {
|
||||
|
||||
Reference in New Issue
Block a user