Skip to content

Commit 17c3162

Browse files
committed
style: 🚨 修复 linter 警告
1 parent cf3a91b commit 17c3162

7 files changed

Lines changed: 20 additions & 19 deletions

File tree

ComicRead-AdGuard.user.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4148,11 +4148,11 @@ const setImgScale = val => {
41484148
setOption(draftOption => {
41494149
val = helper.clamp(0.1, val, 3);
41504150

4151-
// 如果当前最小图片宽度都大于视窗宽度,并且这次操作是在调小缩放值
4151+
// 如果当前最小图片宽度大于视窗宽度,并且这次操作是在调小缩放值
41524152
// 那就将这次操作改为:将缩放值修改为只要缩小一点就会立刻让图片变小的极限值
41534153
// 避免用户需要多次调小缩放值才能看到效果的情况
41544154
// https://github.com/hymbz/ComicReadScript/issues/285
4155-
if (minImgWidth() <= store.rootSize.width && val < draftOption.scrollMode.imgScale) {
4155+
if (minImgWidth() > store.rootSize.width && val < draftOption.scrollMode.imgScale) {
41564156
const maxImgScale = store.rootSize.width / minImgWidth();
41574157
if (val > maxImgScale) val = maxImgScale;
41584158
}
@@ -13502,7 +13502,7 @@ web.delegateEvents(["click"]);
1350213502
const resizeObserver = new ResizeObserver(() => {
1350313503
// 只在超出正常高度时才使用 css 限制,避免和其他脚本(如:EhAria2下载助手)冲突
1350413504
Reflect.deleteProperty(sidebarDom.dataset, 'long');
13505-
const lastNode = helper.querySelector('#gd5 p:last-child');
13505+
const lastNode = helper.querySelector('#gd5 p:last-of-type');
1350613506
if (lastNode.offsetTop + lastNode.offsetHeight > 352) sidebarDom.dataset.long = '';
1350713507
});
1350813508
resizeObserver.observe(sidebarDom);
@@ -14916,7 +14916,7 @@ const main = require('main');
1491614916

1491714917
// #[NoyAcg](https://noy1.top)
1491814918
// test: https://noy1.top/#/read/13349
14919-
14919+
1492014920
case 'noy1.top':
1492114921
{
1492214922
options = {
@@ -15270,9 +15270,9 @@ const main = require('main');
1527015270
{
1527115271
// #[Tachidesk](https://github.com/Suwayomi/Tachidesk-Sorayomi)
1527215272
// #[LANraragi](https://github.com/Difegue/LANraragi)
15273+
const Manga = require('components/Manga');
1527315274
const helper = require('helper');
1527415275
const request = require('request');
15275-
const Manga = require('components/Manga');
1527615276

1527715277
if (document.querySelector(`head > meta[content="A manga reader that runs tachiyomi's extensions"]`)) {
1527815278
const jump = (mangaId, chapterId) => {

ComicRead-jsDelivr.user.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4074,11 +4074,11 @@ const setImgScale = val => {
40744074
setOption(draftOption => {
40754075
val = helper.clamp(0.1, val, 3);
40764076

4077-
// 如果当前最小图片宽度都大于视窗宽度,并且这次操作是在调小缩放值
4077+
// 如果当前最小图片宽度大于视窗宽度,并且这次操作是在调小缩放值
40784078
// 那就将这次操作改为:将缩放值修改为只要缩小一点就会立刻让图片变小的极限值
40794079
// 避免用户需要多次调小缩放值才能看到效果的情况
40804080
// https://github.com/hymbz/ComicReadScript/issues/285
4081-
if (minImgWidth() <= store.rootSize.width && val < draftOption.scrollMode.imgScale) {
4081+
if (minImgWidth() > store.rootSize.width && val < draftOption.scrollMode.imgScale) {
40824082
const maxImgScale = store.rootSize.width / minImgWidth();
40834083
if (val > maxImgScale) val = maxImgScale;
40844084
}
@@ -13428,7 +13428,7 @@ web.delegateEvents(["click"]);
1342813428
const resizeObserver = new ResizeObserver(() => {
1342913429
// 只在超出正常高度时才使用 css 限制,避免和其他脚本(如:EhAria2下载助手)冲突
1343013430
Reflect.deleteProperty(sidebarDom.dataset, 'long');
13431-
const lastNode = helper.querySelector('#gd5 p:last-child');
13431+
const lastNode = helper.querySelector('#gd5 p:last-of-type');
1343213432
if (lastNode.offsetTop + lastNode.offsetHeight > 352) sidebarDom.dataset.long = '';
1343313433
});
1343413434
resizeObserver.observe(sidebarDom);
@@ -14842,7 +14842,7 @@ const main = require('main');
1484214842

1484314843
// #[NoyAcg](https://noy1.top)
1484414844
// test: https://noy1.top/#/read/13349
14845-
14845+
1484614846
case 'noy1.top':
1484714847
{
1484814848
options = {
@@ -15196,9 +15196,9 @@ const main = require('main');
1519615196
{
1519715197
// #[Tachidesk](https://github.com/Suwayomi/Tachidesk-Sorayomi)
1519815198
// #[LANraragi](https://github.com/Difegue/LANraragi)
15199+
const Manga = require('components/Manga');
1519915200
const helper = require('helper');
1520015201
const request = require('request');
15201-
const Manga = require('components/Manga');
1520215202

1520315203
if (document.querySelector(`head > meta[content="A manga reader that runs tachiyomi's extensions"]`)) {
1520415204
const jump = (mangaId, chapterId) => {

ComicRead.user.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4074,11 +4074,11 @@ const setImgScale = val => {
40744074
setOption(draftOption => {
40754075
val = helper.clamp(0.1, val, 3);
40764076

4077-
// 如果当前最小图片宽度都大于视窗宽度,并且这次操作是在调小缩放值
4077+
// 如果当前最小图片宽度大于视窗宽度,并且这次操作是在调小缩放值
40784078
// 那就将这次操作改为:将缩放值修改为只要缩小一点就会立刻让图片变小的极限值
40794079
// 避免用户需要多次调小缩放值才能看到效果的情况
40804080
// https://github.com/hymbz/ComicReadScript/issues/285
4081-
if (minImgWidth() <= store.rootSize.width && val < draftOption.scrollMode.imgScale) {
4081+
if (minImgWidth() > store.rootSize.width && val < draftOption.scrollMode.imgScale) {
40824082
const maxImgScale = store.rootSize.width / minImgWidth();
40834083
if (val > maxImgScale) val = maxImgScale;
40844084
}
@@ -13428,7 +13428,7 @@ web.delegateEvents(["click"]);
1342813428
const resizeObserver = new ResizeObserver(() => {
1342913429
// 只在超出正常高度时才使用 css 限制,避免和其他脚本(如:EhAria2下载助手)冲突
1343013430
Reflect.deleteProperty(sidebarDom.dataset, 'long');
13431-
const lastNode = helper.querySelector('#gd5 p:last-child');
13431+
const lastNode = helper.querySelector('#gd5 p:last-of-type');
1343213432
if (lastNode.offsetTop + lastNode.offsetHeight > 352) sidebarDom.dataset.long = '';
1343313433
});
1343413434
resizeObserver.observe(sidebarDom);
@@ -14842,7 +14842,7 @@ const main = require('main');
1484214842

1484314843
// #[NoyAcg](https://noy1.top)
1484414844
// test: https://noy1.top/#/read/13349
14845-
14845+
1484614846
case 'noy1.top':
1484714847
{
1484814848
options = {
@@ -15196,9 +15196,9 @@ const main = require('main');
1519615196
{
1519715197
// #[Tachidesk](https://github.com/Suwayomi/Tachidesk-Sorayomi)
1519815198
// #[LANraragi](https://github.com/Difegue/LANraragi)
15199+
const Manga = require('components/Manga');
1519915200
const helper = require('helper');
1520015201
const request = require('request');
15201-
const Manga = require('components/Manga');
1520215202

1520315203
if (document.querySelector(`head > meta[content="A manga reader that runs tachiyomi's extensions"]`)) {
1520415204
const jump = (mangaId, chapterId) => {

src/components/Manga/actions/scrollMode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ export const setImgScale = (val: number | ((oldVal: number) => number)) => {
3737
setOption((draftOption) => {
3838
val = clamp(0.1, val as number, 3);
3939

40-
// 如果当前最小图片宽度都大于视窗宽度,并且这次操作是在调小缩放值
40+
// 如果当前最小图片宽度大于视窗宽度,并且这次操作是在调小缩放值
4141
// 那就将这次操作改为:将缩放值修改为只要缩小一点就会立刻让图片变小的极限值
4242
// 避免用户需要多次调小缩放值才能看到效果的情况
4343
// https://github.com/hymbz/ComicReadScript/issues/285
4444
if (
45-
minImgWidth() <= store.rootSize.width &&
45+
minImgWidth() > store.rootSize.width &&
4646
val < draftOption.scrollMode.imgScale
4747
) {
4848
const maxImgScale = store.rootSize.width / minImgWidth();

src/pwa/src/fileParser/helper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { IterableElement } from 'type-fest';
2+
23
import { setState } from '../store';
34

45
export const imgExtension = new Set([

src/site/ehentai/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ import { tagLint } from './tagLint';
188188
const resizeObserver = new ResizeObserver(() => {
189189
// 只在超出正常高度时才使用 css 限制,避免和其他脚本(如:EhAria2下载助手)冲突
190190
Reflect.deleteProperty(sidebarDom.dataset, 'long');
191-
const lastNode = querySelector('#gd5 p:last-child')!;
191+
const lastNode = querySelector('#gd5 p:last-of-type')!;
192192
if (lastNode.offsetTop + lastNode.offsetHeight > 352)
193193
sidebarDom.dataset.long = '';
194194
});

src/site/selfhosted.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { setState } from 'components/Manga';
12
import { clamp, debounce, querySelector, range, sleep, wait } from 'helper';
23
import { request } from 'request';
34

45
import type { InitOptions } from '../userscript/main';
5-
import { setState } from 'components/Manga';
66

77
declare let options: InitOptions; // oxlint-disable-line no-unused-vars
88

0 commit comments

Comments
 (0)