Skip to content

Commit 31b377e

Browse files
committed
fix linters
1 parent fcd137b commit 31b377e

35 files changed

+210
-186
lines changed

.eslintrc.cjs

Lines changed: 0 additions & 26 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import js from '@eslint/js'
2+
import eslintConfigPrettier from 'eslint-config-prettier'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
7+
export default [
8+
{
9+
ignores: ['dist', 'build'],
10+
},
11+
js.configs.recommended,
12+
...tseslint.configs.recommended,
13+
eslintConfigPrettier,
14+
{
15+
files: ['**/*.{ts,tsx,js,jsx}'],
16+
languageOptions: {
17+
parser: tseslint.parser,
18+
parserOptions: {
19+
ecmaVersion: 'latest',
20+
sourceType: 'module',
21+
ecmaFeatures: {
22+
jsx: true,
23+
},
24+
},
25+
},
26+
plugins: {
27+
'react-hooks': reactHooks,
28+
'react-refresh': reactRefresh,
29+
},
30+
rules: {
31+
'@typescript-eslint/no-explicit-any': 'off',
32+
'react-hooks/rules-of-hooks': 'error',
33+
'react-hooks/exhaustive-deps': [
34+
'warn',
35+
{
36+
additionalHooks: '(useTheme)',
37+
},
38+
],
39+
'react-refresh/only-export-components': [
40+
'warn',
41+
{ allowConstantExport: true },
42+
],
43+
},
44+
},
45+
]

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
"deploy": "gh-pages -d build",
1313
"build:pages": "tsc && vite build --base '/dashboard/'",
1414
"deploy:pages": "pnpm run build:pages && gh-pages -d build",
15-
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
16-
"preview": "vite preview",
17-
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css}\""
15+
"lint": "pnpm run lint:prettier && pnpm run lint:eslint",
16+
"lint:eslint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
17+
"lint:prettier": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css}\"",
18+
"lint:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css}\"",
19+
"preview": "vite preview"
1820
},
1921
"dependencies": {
2022
"@polkadot-api/descriptors": "file:.papi/descriptors",

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const App = () => {
2222
<ThemeProvider defaultTheme={settings?.themeMode as Theme}>
2323
<AccountContextProvider>
2424
<TooltipProvider>
25-
<div className="flex min-h-screen w-full flex-col bg-muted/40">
25+
<div className="bg-muted/40 flex min-h-screen w-full flex-col">
2626
<Navigation
2727
lightClientLoaded={lightClientLoaded}
2828
setLightClientLoaded={setLightClientLoaded}

src/Resources.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const getLink = ({
2626
export const getLinks = (title: string, arrays: GetLinksType[]) => (
2727
<div className="divide-y divide-dashed">
2828
<div>
29-
<h4 className="my-4 font-extrabold text-primary">{title}</h4>
29+
<h4 className="text-primary my-4 font-extrabold">{title}</h4>
3030
{arrays.map((arr) => (
3131
<p className="text-[#999] underline">{getLink(arr)}</p>
3232
))}
@@ -41,15 +41,15 @@ export const Resources = () => {
4141
<DialogTrigger asChild>
4242
<a
4343
href="#"
44-
className="flex items-center gap-4 px-2.5 py-2 text-muted-foreground transition-colors hover:text-foreground"
44+
className="text-muted-foreground hover:text-foreground flex items-center gap-4 px-2.5 py-2 transition-colors"
4545
>
4646
<NotebookText className="h-5 w-5" />
4747
<span className="left">Resources</span>
4848
</a>
4949
</DialogTrigger>
5050
<DialogContent className="sm:max-w-[425px]">
5151
<DialogHeader>
52-
<DialogTitle className="font-bold text-primary">
52+
<DialogTitle className="text-primary font-bold">
5353
Resources
5454
</DialogTitle>
5555
<DialogDescription>

src/components/ThemedComponents.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const ThemedLink: React.FC<{
88
className?: string
99
}> = ({ children, to, target = '_parent', className }) => (
1010
<Link
11-
className={`font-bold text-primary ${className}`}
11+
className={`text-primary font-bold ${className}`}
1212
to={to}
1313
target={target}
1414
>

src/components/ui/accordion.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ const AccordionContent = React.forwardRef<
4444
>(({ className, children, ...props }, ref) => (
4545
<AccordionPrimitive.Content
4646
ref={ref}
47-
className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
47+
className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm transition-all"
4848
{...props}
4949
>
50-
<div className={cn('pb-4 pt-0', className)}>{children}</div>
50+
<div className={cn('pt-0 pb-4', className)}>{children}</div>
5151
</AccordionPrimitive.Content>
5252
))
5353

src/components/ui/badge.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ const badgeVariants = cva(
2525
)
2626

2727
export interface BadgeProps
28-
extends React.HTMLAttributes<HTMLDivElement>,
28+
extends
29+
React.HTMLAttributes<HTMLDivElement>,
2930
VariantProps<typeof badgeVariants> {}
3031

3132
function Badge({ className, variant, ...props }: BadgeProps) {

src/components/ui/button.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ const buttonVariants = cva(
3535
)
3636

3737
export interface ButtonProps
38-
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
38+
extends
39+
React.ButtonHTMLAttributes<HTMLButtonElement>,
3940
VariantProps<typeof buttonVariants> {
4041
asChild?: boolean
4142
}

src/components/ui/card.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const Card = React.forwardRef<
99
<div
1010
ref={ref}
1111
className={cn(
12-
'rounded-lg border bg-card text-card-foreground shadow-xs',
12+
'bg-card text-card-foreground rounded-lg border shadow-xs',
1313
className,
1414
)}
1515
{...props}
@@ -36,7 +36,7 @@ const CardTitle = React.forwardRef<
3636
<h3
3737
ref={ref}
3838
className={cn(
39-
'text-2xl font-semibold leading-none tracking-tight',
39+
'text-2xl leading-none font-semibold tracking-tight',
4040
className,
4141
)}
4242
{...props}
@@ -50,7 +50,7 @@ const CardDescription = React.forwardRef<
5050
>(({ className, ...props }, ref) => (
5151
<p
5252
ref={ref}
53-
className={cn('text-sm text-muted-foreground', className)}
53+
className={cn('text-muted-foreground text-sm', className)}
5454
{...props}
5555
/>
5656
))

0 commit comments

Comments
 (0)