feat: Migrate ESLint to flat config and resolve initial linting errors
Migrated the ESLint configuration to the new flat config format () and addressed several initial linting errors. Key changes include: - Updated ESLint configuration to treat as warnings instead of errors. - Fixed errors in by declaring and . - Corrected error in by using instead of an out-of-scope . - Resolved error in by replacing the undefined directive with the component. - Addressed errors in by replacing with and with . - Fixed errors in by importing necessary modules (, , ) and adding missing props (, , , , ).
This commit is contained in:
@@ -1,51 +1,50 @@
|
||||
import type { key_str } from "./ae_utils";
|
||||
import type { key_str } from './ae_utils';
|
||||
|
||||
// Updated 2024-06-19
|
||||
export function file_extension_icon(
|
||||
extension: string) {
|
||||
// console.log('*** file_extension_icon() ***');
|
||||
let file_icons: key_str = {
|
||||
'file': 'file',
|
||||
'3gp': 'file-video',
|
||||
'7z': 'file-archive',
|
||||
'aac': 'file-audio',
|
||||
'ac3': 'file-audio',
|
||||
'aif': 'file-audio',
|
||||
'aiff': 'file-audio',
|
||||
'avi': 'file-video',
|
||||
'bmp': 'file-image',
|
||||
'csv': 'file-csv',
|
||||
'doc': 'file-word',
|
||||
'docx': 'file-word',
|
||||
'eps': 'file-image',
|
||||
'flac': 'file-audio',
|
||||
'gif': 'file-image',
|
||||
'htm': 'file-code',
|
||||
'html': 'file-code',
|
||||
'jpeg': 'file-image',
|
||||
'jpg': 'file-image',
|
||||
'key': 'file-powerpoint',
|
||||
'mkv': 'file-video',
|
||||
'mov': 'file-video',
|
||||
'mp3': 'file-audio',
|
||||
'mp4': 'file-video',
|
||||
'odp': 'file-powerpoint',
|
||||
'pdf': 'file-pdf',
|
||||
'png': 'file-image',
|
||||
'ppt': 'file-powerpoint',
|
||||
'pptx': 'file-powerpoint',
|
||||
'txt': 'file-alt',
|
||||
'wav': 'file-audio',
|
||||
'webp': 'file-image',
|
||||
'xls': 'file-excel',
|
||||
'xlsx': 'file-excel',
|
||||
'zip': 'file-archive'
|
||||
};
|
||||
export function file_extension_icon(extension: string) {
|
||||
// console.log('*** file_extension_icon() ***');
|
||||
const file_icons: key_str = {
|
||||
file: 'file',
|
||||
'3gp': 'file-video',
|
||||
'7z': 'file-archive',
|
||||
aac: 'file-audio',
|
||||
ac3: 'file-audio',
|
||||
aif: 'file-audio',
|
||||
aiff: 'file-audio',
|
||||
avi: 'file-video',
|
||||
bmp: 'file-image',
|
||||
csv: 'file-csv',
|
||||
doc: 'file-word',
|
||||
docx: 'file-word',
|
||||
eps: 'file-image',
|
||||
flac: 'file-audio',
|
||||
gif: 'file-image',
|
||||
htm: 'file-code',
|
||||
html: 'file-code',
|
||||
jpeg: 'file-image',
|
||||
jpg: 'file-image',
|
||||
key: 'file-powerpoint',
|
||||
mkv: 'file-video',
|
||||
mov: 'file-video',
|
||||
mp3: 'file-audio',
|
||||
mp4: 'file-video',
|
||||
odp: 'file-powerpoint',
|
||||
pdf: 'file-pdf',
|
||||
png: 'file-image',
|
||||
ppt: 'file-powerpoint',
|
||||
pptx: 'file-powerpoint',
|
||||
txt: 'file-alt',
|
||||
wav: 'file-audio',
|
||||
webp: 'file-image',
|
||||
xls: 'file-excel',
|
||||
xlsx: 'file-excel',
|
||||
zip: 'file-archive'
|
||||
};
|
||||
|
||||
if (file_icons[extension]) {
|
||||
return file_icons[extension];
|
||||
} else {
|
||||
// return null;
|
||||
return file_icons['file'];
|
||||
}
|
||||
if (file_icons[extension]) {
|
||||
return file_icons[extension];
|
||||
} else {
|
||||
// return null;
|
||||
return file_icons['file'];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user