-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: configure eslint and fix all eslint issues
- Loading branch information
Showing
12 changed files
with
615 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
commonjs: true, | ||
es2021: true, | ||
}, | ||
extends: 'airbnb-base', | ||
overrides: [ | ||
], | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
}, | ||
env: { | ||
browser: true, | ||
commonjs: true, | ||
es2021: true, | ||
}, | ||
extends: ['airbnb-base', 'airbnb-typescript/base'], | ||
root: true, | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
project: './tsconfig.json', | ||
}, | ||
ignorePatterns: ['gh-pages/'], | ||
rules: { | ||
indent: ['error', 4], | ||
'@typescript-eslint/indent': ['error', 4], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"root": true, | ||
"extends": [ | ||
"airbnb", | ||
"airbnb-typescript", | ||
"next/core-web-vitals", | ||
"plugin:tailwindcss/recommended" | ||
], | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
}, | ||
"rules": { | ||
"indent": ["error", 4], | ||
"react/jsx-indent": [2, 4], | ||
"react/jsx-indent-props": [2, 4], | ||
"@typescript-eslint/indent": [ "error", 4] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import './globals.css' | ||
import { Inter } from 'next/font/google' | ||
import './globals.css'; | ||
import { Inter } from 'next/font/google'; | ||
|
||
const inter = Inter({ subsets: ['latin'] }) | ||
const inter = Inter({ subsets: ['latin'] }); | ||
|
||
export const metadata = { | ||
title: 'IFRC GO Icons', | ||
description: 'React Icons library for IFRC GO project', | ||
} | ||
}; | ||
|
||
export default function RootLayout({ | ||
children, | ||
children, | ||
}: { | ||
children: React.ReactNode | ||
children: React.ReactNode | ||
}) { | ||
return ( | ||
<html lang="en"> | ||
<body className={inter.className}>{children}</body> | ||
</html> | ||
) | ||
return ( | ||
<html lang="en"> | ||
<body className={inter.className}>{children}</body> | ||
</html> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import { useEffect, useState } from 'react' | ||
import { useEffect, useState } from 'react'; | ||
|
||
// eslint-disable-next-line import/prefer-default-export | ||
export function useDebounce<T>(value: T, delay?: number): T { | ||
const [debouncedValue, setDebouncedValue] = useState<T>(value) | ||
const [debouncedValue, setDebouncedValue] = useState<T>(value); | ||
|
||
useEffect(() => { | ||
const timer = setTimeout(() => setDebouncedValue(value), delay || 500) | ||
const timer = setTimeout(() => setDebouncedValue(value), delay || 500); | ||
|
||
return () => { | ||
clearTimeout(timer) | ||
} | ||
}, [value, delay]) | ||
clearTimeout(timer); | ||
}; | ||
}, [value, delay]); | ||
|
||
return debouncedValue | ||
return debouncedValue; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
plugins: [ | ||
{ | ||
name: 'preset-default', | ||
}, | ||
{ | ||
name: 'removeDimensions', | ||
}, | ||
], | ||
}; |
Oops, something went wrong.