Add lint rule

This commit is contained in:
Tom Moor committed 2026-08-24 18:52:30 -04:00
1 parent 28d38a59f6
commit 8e2fc0575e
5 files changed
+37

No files matched your search

+10
View File
@@ -78,6 +78,16 @@
"error",
{
"paths": [
{
"name": "@emoji-mart/data",
"message": "The emoji dataset is ~500KB; a static import pulls it into the initial bundle. Import the types only and load the data with loadEmojiIndex() from shared/utils/emoji, or loadEmojiData() from shared/editor/lib/emoji.",
"allowTypeImports": true
},
{
"name": "emoji-mart",
"message": "emoji-mart shares a chunk with the ~500KB emoji dataset. Load it with loadEmojiIndex() from shared/utils/emoji instead of importing it statically.",
"allowTypeImports": true
},
{
"name": "prosemirror-tables",
"importNames": [
+12
View File
@@ -16,6 +16,18 @@
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "@emoji-mart/data",
"message": "The emoji dataset is ~500KB; a static import pulls it into the initial bundle. Import the types only and load the data with loadEmojiIndex() from shared/utils/emoji, or loadEmojiData() from shared/editor/lib/emoji.",
"allowTypeImports": true
},
{
"name": "emoji-mart",
"message": "emoji-mart shares a chunk with the ~500KB emoji dataset. Load it with loadEmojiIndex() from shared/utils/emoji instead of importing it statically.",
"allowTypeImports": true
}
],
"patterns": [
{
"group": ["mime-types"],
+12
View File
@@ -16,6 +16,18 @@
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "@emoji-mart/data",
"message": "The emoji dataset is ~500KB; a static import pulls it into the initial bundle. Import the types only and load the data with loadEmojiIndex() from shared/utils/emoji, or loadEmojiData() from shared/editor/lib/emoji.",
"allowTypeImports": true
},
{
"name": "emoji-mart",
"message": "emoji-mart shares a chunk with the ~500KB emoji dataset. Load it with loadEmojiIndex() from shared/utils/emoji instead of importing it statically.",
"allowTypeImports": true
}
],
"patterns": [
{
"group": ["@shared/*"],
+2
View File
@@ -53,6 +53,8 @@ export function populateEmojiData(data: EmojiMartData): void {
* @returns the raw emoji dataset.
*/
export function loadEmojiData(): Promise<EmojiMartData> {
// This is the one sanctioned place the dataset is pulled in on the client.
// oxlint-disable-next-line no-restricted-imports
dataPromise ??= import("@emoji-mart/data").then(({ default: data }) => {
populateEmojiData(data as EmojiMartData);
return data as EmojiMartData;
+1
View File
@@ -190,6 +190,7 @@ export function loadEmojiIndex(): Promise<void> {
loading ??= (async () => {
const [data, emojiMart] = await Promise.all([
loadEmojiData(),
// oxlint-disable-next-line no-restricted-imports
import("emoji-mart"),
]);
await emojiMart.init({ data });