mirror of
https://github.com/outline/outline.git
synced 2026-11-21 21:44:30 +03:00
Add lint rule
This commit is contained in:
5 files changed
+37
No files matched your search
@@ -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": [
|
||||
|
||||
@@ -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"],
|
||||
|
||||
@@ -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/*"],
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 });
|
||||
|
||||
Reference in new issue
Block a user