Ban ts-pattern normal import
This commit is contained in:
parent
27e81b20db
commit
accfc15125
|
@ -334,5 +334,6 @@ export const commonRendererPlugins = [
|
||||||
banImportPlugin(builtinModuleRegex, "Cannot import node inbuilt modules in browser code. You need to use a native.ts file"),
|
banImportPlugin(builtinModuleRegex, "Cannot import node inbuilt modules in browser code. You need to use a native.ts file"),
|
||||||
banImportPlugin(/^react$/, "Cannot import from react. React and hooks should be imported from @webpack/common"),
|
banImportPlugin(/^react$/, "Cannot import from react. React and hooks should be imported from @webpack/common"),
|
||||||
banImportPlugin(/^electron(\/.*)?$/, "Cannot import electron in browser code. You need to use a native.ts file"),
|
banImportPlugin(/^electron(\/.*)?$/, "Cannot import electron in browser code. You need to use a native.ts file"),
|
||||||
|
banImportPlugin(/^ts-pattern$/, "Cannot import from ts-pattern. match and P should be imported from @webpack/common"),
|
||||||
...commonOpts.plugins
|
...commonOpts.plugins
|
||||||
];
|
];
|
||||||
|
|
|
@ -73,7 +73,8 @@ function MenuItem(guildId: string, id?: string, type?: MenuItemParentType) {
|
||||||
action={() => {
|
action={() => {
|
||||||
const guild = GuildStore.getGuild(guildId);
|
const guild = GuildStore.getGuild(guildId);
|
||||||
|
|
||||||
const { permissions, header }: { permissions: RoleOrUserPermission[], header: string; } = match(type)
|
const { permissions, header } = match(type)
|
||||||
|
.returnType<{ permissions: RoleOrUserPermission[], header: string; }>()
|
||||||
.with(MenuItemParentType.User, () => {
|
.with(MenuItemParentType.User, () => {
|
||||||
const member = GuildMemberStore.getMember(guildId, id!);
|
const member = GuildMemberStore.getMember(guildId, id!);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue