Skip to content

Commit

Permalink
fix: fix warn
Browse files Browse the repository at this point in the history
  • Loading branch information
wkylin committed Jan 15, 2025
1 parent 750ca1e commit 129cecf
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}
],
"semi": "off",
"no-use-before-define": "off",
"no-use-before-define": "warn",
"comma-dangle": "off",
"space-before-function-paren": "off",
"multiline-ternary": "off",
Expand All @@ -54,8 +54,8 @@
"array-callback-return": "off",
"no-shadow": "off",
"no-inner-declarations": "off",
"no-unused-expressions": "off",
"no-unused-vars": "off",
"no-unused-expressions": "warn",
"no-unused-vars": "warn",
"no-plusplus": "off"
}
}
3 changes: 1 addition & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const plugins = [
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-transform-runtime'],
['@babel/plugin-transform-modules-commonjs'],
[require('babel-plugin-await-add-trycatch')],
]

module.exports = {
Expand All @@ -12,7 +11,7 @@ module.exports = {
[
'@babel/preset-react',
{
runtime: 'automatic',
runtime: 'automatic', // classic
},
],
'@babel/typescript',
Expand Down
4 changes: 2 additions & 2 deletions src/components/hooks/useScrollIntoView/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useRef, useState } from 'react'
import React, { useEffect, useRef, useState } from 'react'

Check warning on line 1 in src/components/hooks/useScrollIntoView/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unused import

Unused imported default binding React

Check failure on line 1 in src/components/hooks/useScrollIntoView/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

ESLint

ESLint: Install the 'eslint' package

const useScrollIntoView = ({ offset = 0 }) => {
const targetRef = useRef < T > null
const targetRef = useRef(null)
const [isScrolled, setIsScrolled] = useState(false)

const scrollIntoView = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/stateless/TextClip/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const TextClips = () => {
<span className="elementor-headline-plain-text elementor-headline-text-wrapper">Trending</span>
<span
className="elementor-headline-dynamic-wrapper elementor-headline-text-wrapper"
style="width: 20.9824px; overflow: hidden;"
style={{ width: '20.9824px', overflow: 'hidden' }}
>
<span className="elementor-headline-dynamic-text elementor-headline-text-inactive">Bootstrap</span>
<span className="elementor-headline-dynamic-text elementor-headline-text-active">React</span>
Expand Down
7 changes: 6 additions & 1 deletion src/pages/home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ import SparklesCore from '@stateless/Sparkles'
import firstImage from '@assets/images/88-300x160.jpg'
import secondImage from '@assets/images/2-300x160.jpg'

import { oneApiChat, prettyObject, randomNum, getDirection } from '@utils/aidFn'
import {
oneApiChat,
prettyObject,
// randomNum,
getDirection,
} from '@utils/aidFn'
import { fireConfetti } from '@utils/confetti'
import styles from './index.module.less'

Expand Down
12 changes: 7 additions & 5 deletions src/pages/home/index.module.less
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,10 @@
transform: rotate(6deg);
}

// backdrop-filter
// object-fit: cover;
// object-position: 0 0;
// isolation: isolate;
// z-index: 1;
/* shift + alt +a
backdrop-filter
object-fit: cover;
object-position: 0 0;
isolation: isolate;
z-index: 1;
*/
4 changes: 2 additions & 2 deletions src/pages/postmessage/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const PostMessage = () => {
height="600px"
title="my-iframe"
loading="lazy"
allowfullscreen
allowFullScreen
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerPolicy="no-referrer-when-downgrade"
sandbox="allow-scripts allow-same-origin"
Expand All @@ -59,7 +59,7 @@ const PostMessage = () => {
allow="accelerometer *; bluetooth *; camera *; encrypted-media *; display-capture *; geolocation *; gyroscope *; microphone *; midi *; clipboard-read *; clipboard-write *; web-share *; serial *; xr-spatial-tracking *"
allowtransparency="true"
allowPaymentRequest="true"
allowfullscreen="true"
allowFullScreen
class="result-iframe"
loading="lazy"
/> */}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/reactGantt/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useRef, useEffect } from 'react'
import React, { useRef } from 'react'

Check warning on line 1 in src/pages/reactGantt/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unused import

Unused import specifier useRef

Check failure on line 1 in src/pages/reactGantt/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

ESLint

ESLint: Install the 'eslint' package
import { Gantt, Willow } from 'wx-react-gantt'
import FixTabPanel from '@stateless/FixTabPanel'
import 'wx-react-gantt/dist/gantt.css'
Expand Down
4 changes: 2 additions & 2 deletions src/pages/video/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ const MyVideo = () => {
togglePause,

Check warning on line 41 in src/pages/video/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unused local symbol

Unused constant togglePause
increaseVolume,

Check warning on line 42 in src/pages/video/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unused local symbol

Unused constant increaseVolume
decreaseVolume,

Check warning on line 43 in src/pages/video/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unused local symbol

Unused constant decreaseVolume
mute,
// mute,
unmute,

Check warning on line 45 in src/pages/video/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unused local symbol

Unused constant unmute
toggleMute,

Check warning on line 46 in src/pages/video/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unused local symbol

Unused constant toggleMute
forward,

Check warning on line 47 in src/pages/video/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unused local symbol

Unused constant forward
back,
// back,
toggleFullscreen,

Check warning on line 49 in src/pages/video/index.jsx

View workflow job for this annotation

GitHub Actions / Qodana for JS

Unused local symbol

Unused constant toggleFullscreen
} = useVideo(videoRef)

Expand Down
3 changes: 2 additions & 1 deletion src/utils/aidFn.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@ export const getFileType = (data, fileName) => {
try {
JSON.parse(data)
return 'application/json'
} catch (e) {
} catch (event) {
console.log('event', event)
return 'text/plain'
}
} else if (data instanceof Uint8Array || data instanceof ArrayBuffer) {
Expand Down

0 comments on commit 129cecf

Please sign in to comment.