diff --git a/packages/linter/src/rules/NoIconFontIsUsed.ts b/packages/linter/src/rules/NoIconFontIsUsed.ts index c4a82f1e1..e55aa5654 100644 --- a/packages/linter/src/rules/NoIconFontIsUsed.ts +++ b/packages/linter/src/rules/NoIconFontIsUsed.ts @@ -22,17 +22,13 @@ const ICON_FONT_IDENTIFIERS = [ className: "icofont-", fontFamilies: ["IcoFont"], }, - { - className: "octicon-", - fontFamilies: ["Octicons"], - }, { className: "icn-", fontFamilies: ["icon"], }, { className: "icon-", - fontFamilies: ["icon"], + fontFamilies: ["icon", "icons", "icomoon"], }, ]; diff --git a/packages/linter/tests/local.test.ts b/packages/linter/tests/local.test.ts index a26177e9d..52507133e 100644 --- a/packages/linter/tests/local.test.ts +++ b/packages/linter/tests/local.test.ts @@ -253,7 +253,7 @@ describe(FastGoogleFontsDisplay.name, () => { }); describe(NoIconFontIsUsed.name, () => { - it(`${NoIconFontIsUsed.name} - icon font usage`, async () => { + it(`${NoIconFontIsUsed.name} - icon font found`, async () => { return assertWarn( runLocalTest( NoIconFontIsUsed, @@ -261,7 +261,7 @@ describe(NoIconFontIsUsed.name, () => { ) ); }); - it(`${NoIconFontIsUsed.name} - no icon font usage`, async () => { + it(`${NoIconFontIsUsed.name} - no icon font found`, async () => { return assertPass( runLocalTest( NoIconFontIsUsed, @@ -269,7 +269,7 @@ describe(NoIconFontIsUsed.name, () => { ) ); }); - it(`${NoIconFontIsUsed.name} - suspicious class names, but no icon font`, async () => { + it(`${NoIconFontIsUsed.name} - suspicious class names`, async () => { return assertPass( runLocalTest( NoIconFontIsUsed, @@ -277,7 +277,7 @@ describe(NoIconFontIsUsed.name, () => { ) ); }); - it(`${NoIconFontIsUsed.name} - usage of material icons icon font`, async () => { + it(`${NoIconFontIsUsed.name} - material icons icon font found`, async () => { return assertWarn( runLocalTest( NoIconFontIsUsed, @@ -285,6 +285,30 @@ describe(NoIconFontIsUsed.name, () => { ) ); }); + it(`${NoIconFontIsUsed.name} - icomoon icon font found`, async () => { + return assertWarn( + runLocalTest( + NoIconFontIsUsed, + `${__dirname}/local/NoIconFontIsUsed-5/source.html` + ) + ); + }); + it(`${NoIconFontIsUsed.name} - icofont icon font found`, async () => { + return assertWarn( + runLocalTest( + NoIconFontIsUsed, + `${__dirname}/local/NoIconFontIsUsed-6/source.html` + ) + ); + }); + it(`${NoIconFontIsUsed.name} - nerd font icon font found`, async () => { + return assertWarn( + runLocalTest( + NoIconFontIsUsed, + `${__dirname}/local/NoIconFontIsUsed-7/source.html` + ) + ); + }); }); describe(FontsArePreloaded.name, () => { diff --git a/packages/linter/tests/local/NoIconFontIsUsed-1/fontawesome/webfonts/fa-solid-900.eot b/packages/linter/tests/local/NoIconFontIsUsed-1/fontawesome/webfonts/fa-solid-900.eot deleted file mode 100644 index 064f1b086..000000000 Binary files a/packages/linter/tests/local/NoIconFontIsUsed-1/fontawesome/webfonts/fa-solid-900.eot and /dev/null differ diff --git a/packages/linter/tests/local/NoIconFontIsUsed-1/fontawesome/webfonts/fa-solid-900.svg b/packages/linter/tests/local/NoIconFontIsUsed-1/fontawesome/webfonts/fa-solid-900.svg deleted file mode 100644 index 23a6b9aee..000000000 --- a/packages/linter/tests/local/NoIconFontIsUsed-1/fontawesome/webfonts/fa-solid-900.svg +++ /dev/null @@ -1,5028 +0,0 @@ - - - diff --git a/packages/linter/tests/local/NoIconFontIsUsed-1/fontawesome/webfonts/fa-solid-900.ttf b/packages/linter/tests/local/NoIconFontIsUsed-1/fontawesome/webfonts/fa-solid-900.ttf deleted file mode 100644 index e4a88b77a..000000000 Binary files a/packages/linter/tests/local/NoIconFontIsUsed-1/fontawesome/webfonts/fa-solid-900.ttf and /dev/null differ diff --git a/packages/linter/tests/local/NoIconFontIsUsed-1/fontawesome/webfonts/fa-solid-900.woff b/packages/linter/tests/local/NoIconFontIsUsed-1/fontawesome/webfonts/fa-solid-900.woff deleted file mode 100644 index 7a14a11eb..000000000 Binary files a/packages/linter/tests/local/NoIconFontIsUsed-1/fontawesome/webfonts/fa-solid-900.woff and /dev/null differ diff --git a/packages/linter/tests/local/NoIconFontIsUsed-1/fontawesome/webfonts/fa-solid-900.woff2 b/packages/linter/tests/local/NoIconFontIsUsed-1/fontawesome/webfonts/fa-solid-900.woff2 deleted file mode 100644 index 9a4633d9c..000000000 Binary files a/packages/linter/tests/local/NoIconFontIsUsed-1/fontawesome/webfonts/fa-solid-900.woff2 and /dev/null differ diff --git a/packages/linter/tests/local/NoIconFontIsUsed-5/source.html b/packages/linter/tests/local/NoIconFontIsUsed-5/source.html new file mode 100644 index 000000000..60b693437 --- /dev/null +++ b/packages/linter/tests/local/NoIconFontIsUsed-5/source.html @@ -0,0 +1,57 @@ + + +
+ + +