feat: separate prettier from eslint

This commit is contained in:
Rainer Killinger
2023-01-11 13:25:18 +01:00
committed by Thea Schöbl
parent 939fb6ef0f
commit a88d000ccd
381 changed files with 17952 additions and 38411 deletions

View File

@@ -1,23 +1,20 @@
/*
* Copyright (C) 2022 StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import glob from 'glob';
import {readFileSync} from 'fs';
import {
matchPropertyContent,
matchTagProperties,
} from '../src/app/util/ion-icon/icon-match';
import {matchPropertyContent, matchTagProperties} from '../src/app/util/ion-icon/icon-match';
const globPromise = (pattern: string) =>
new Promise<string[]>((resolve, reject) =>
@@ -27,9 +24,7 @@ const globPromise = (pattern: string) =>
/**
*
*/
export async function getUsedIconsHtml(
glob = 'src/**/*.html',
): Promise<Record<string, string[]>> {
export async function getUsedIconsHtml(glob = 'src/**/*.html'): Promise<Record<string, string[]>> {
return Object.fromEntries(
(await globPromise(glob))
.map(file => [
@@ -48,15 +43,10 @@ export async function getUsedIconsHtml(
/**
*
*/
export async function getUsedIconsTS(
glob = 'src/**/*.ts',
): Promise<Record<string, string[]>> {
export async function getUsedIconsTS(glob = 'src/**/*.ts'): Promise<Record<string, string[]>> {
return Object.fromEntries(
(await globPromise(glob))
.map(file => [
file,
readFileSync(file, 'utf8').match(/(?<=Icon`)[\w-]+(?=`)/g) || [],
])
.map(file => [file, readFileSync(file, 'utf8').match(/(?<=Icon`)[\w-]+(?=`)/g) || []])
.filter(([, values]) => values.length > 0),
);
}