extension: Disallow content script to import `ruffle-core`

Use the `@typescript-eslint/no-restricted-imports` rule in order to
prevent #10422 from regressing. Ideally we wouldn't need to specify
each dependency of `content.ts` (i.e. `utils.ts` and `common.ts`),
but I haven't found any better way.
This commit is contained in:
relrelb 2023-03-30 00:51:21 +03:00 committed by relrelb
parent d16a8726c9
commit 798588dd94
1 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,15 @@
env:
browser: true
webextensions: true
overrides:
- files:
- content.ts
- utils.ts
- common.ts
rules:
'@typescript-eslint/no-restricted-imports':
- error
- paths:
- name: ruffle-core
message: Content script must not include ruffle-core.
allowTypeImports: true