refactor: 优化eslint配置,提升代码质量 (#1341)
* feat: 统一并标准化eslint * lint: napcat.webui * lint: napcat.webui * lint: napcat.core * build: fix * lint: napcat.webui * refactor: 重构eslint * Update README.md
This commit is contained in:
651 files changed
+37978
-37584
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import Quill from 'quill'
|
||||
import Quill from 'quill';
|
||||
|
||||
// eslint-disable-next-line
|
||||
const Embed = Quill.import('blots/embed') as any
|
||||
@@ -7,24 +7,24 @@ export interface ImageValue {
|
||||
src: string
|
||||
}
|
||||
class ImageBlot extends Embed {
|
||||
static blotName = 'image'
|
||||
static tagName = 'img'
|
||||
static classNames: string[] = ['max-w-48', 'max-h-48', 'align-bottom']
|
||||
static blotName = 'image';
|
||||
static tagName = 'img';
|
||||
static classNames: string[] = ['max-w-48', 'max-h-48', 'align-bottom'];
|
||||
|
||||
static create(value: ImageValue) {
|
||||
let node = super.create()
|
||||
node.setAttribute('alt', value.alt)
|
||||
node.setAttribute('src', value.src)
|
||||
node.classList.add(...ImageBlot.classNames)
|
||||
return node
|
||||
static create (value: ImageValue) {
|
||||
const node = super.create();
|
||||
node.setAttribute('alt', value.alt);
|
||||
node.setAttribute('src', value.src);
|
||||
node.classList.add(...ImageBlot.classNames);
|
||||
return node;
|
||||
}
|
||||
|
||||
static value(node: HTMLImageElement): ImageValue {
|
||||
static value (node: HTMLImageElement): ImageValue {
|
||||
return {
|
||||
alt: node.getAttribute('alt') ?? '',
|
||||
src: node.getAttribute('src') ?? ''
|
||||
}
|
||||
src: node.getAttribute('src') ?? '',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export default ImageBlot
|
||||
export default ImageBlot;
|
||||
Reference in new issue
Block a user