Skip to content

Commit

Permalink
Merge pull request #4 from invariant-labs/configure-eslint-and-prettier
Browse files Browse the repository at this point in the history
configure eslint and prettier
  • Loading branch information
zielvna authored Oct 4, 2024
2 parents 68578f5 + 01d05de commit 50715b4
Show file tree
Hide file tree
Showing 85 changed files with 6,651 additions and 8,447 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:
node-version: '18'
- name: install
run: npm i
- name: prettify
run: npm run prettify
- name: lint
run: npm run lint
- name: build
run: npm run build

Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.github
13 changes: 13 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"arrowParens": "avoid",
"bracketSpacing": true,
"quoteProps": "as-needed",
"semi": false,
"tabWidth": 2,
"trailingComma": "none",
"useTabs": false,
"singleQuote": true,
"jsxSingleQuote": true,
"printWidth": 100,
"bracketSameLine": true
}
67 changes: 32 additions & 35 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,46 +1,43 @@
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'

export default tseslint.config(
{ ignores: ["dist"] },
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ["**/*.{ts,tsx}"],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
globals: globals.browser
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
'react-hooks': reactHooks,
'react-refresh': reactRefresh
},
rules: {
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
indent: "off",
"@typescript-eslint/indent": "off",
"multiline-ternary": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/prefer-reduce-type-parameter": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/space-before-function-paren": "off",
"@typescript-eslint/prefer-nullish-coalescing": "off",
"@typescript-eslint/member-delimiter-style": "off",
"@typescript-eslint/no-explicit-any": "off",
"generator-star-spacing": ["error", { before: false, after: true }],
"yield-star-spacing": ["error", { before: false, after: true }],
"react-hooks/exhaustive-deps": "off",
"react-hooks/rules-of-hooks": "error",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-empty-object-type": "off",
"no-extra-boolean-cast": "off",
},
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
indent: 'off',
'@typescript-eslint/indent': 'off',
'multiline-ternary': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/prefer-reduce-type-parameter': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/member-delimiter-style': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'generator-star-spacing': ['error', { before: false, after: true }],
'yield-star-spacing': ['error', { before: false, after: true }],
'react-hooks/exhaustive-deps': 'off',
'react-hooks/rules-of-hooks': 'error',
'no-extra-boolean-cast': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-empty-object-type': 'off'
}
}
);
)
82 changes: 23 additions & 59 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
http-equiv="Cache-Control"
content="no-cache, no-store, must-revalidate"
/>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<script>
window.global = window;
window.global = window
</script>
<link rel="apple-touch-icon" sizes="192x192" href="/favicon-192x192.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
Expand All @@ -18,25 +15,18 @@
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Mukta:wght@200;300;400;500;600;700;800&display=swap"
rel="stylesheet"
/>
rel="stylesheet" />
<meta name="theme-color" content="#000000" />
<title>
Invariant: Best AMM DEX with Concentrated Liquidity on Alephium | High
Efficiency DeFi
Invariant: Best AMM DEX with Concentrated Liquidity on Alephium | High Efficiency DeFi
</title>
<meta
name="title"
content="Invariant - AMM DEX with Concentrated Liquidity on Alephium"
/>
<meta name="title" content="Invariant - AMM DEX with Concentrated Liquidity on Alephium" />
<meta
name="description"
content="Discover Invariant, the top AMM DEX on Alephium offering the highest capital efficiency with concentrated liquidity. Maximize your DeFi investments with advanced risk management tools."
/>
content="Discover Invariant, the top AMM DEX on Alephium offering the highest capital efficiency with concentrated liquidity. Maximize your DeFi investments with advanced risk management tools." />
<meta
name="keywords"
content="AMM DEX, concentrated liquidity, Alephium blockchain, DeFi exchange, crypto trading, capital efficiency, risk management, decentralized finance, Alephium DeFi, liquidity pools, yield farming"
/>
content="AMM DEX, concentrated liquidity, Alephium blockchain, DeFi exchange, crypto trading, capital efficiency, risk management, decentralized finance, Alephium DeFi, liquidity pools, yield farming" />
<meta name="author" content="Invariant" />
<meta name="robots" content="index, follow" />

Expand All @@ -45,45 +35,31 @@
<meta property="og:url" content="https://alph.invariant.app/" />
<meta
property="og:title"
content="Invariant - Unlock High Capital Efficiency with Concentrated Liquidity on Alephium"
/>
content="Invariant - Unlock High Capital Efficiency with Concentrated Liquidity on Alephium" />
<meta
property="og:description"
content="Join Invariant, the top AMM DEX on Alephium, and access cutting-edge DeFi solutions with concentrated liquidity for maximum capital efficiency and risk management."
/>
<meta
property="og:image"
content="https://alph.invariant.app/favicon-192x192.png"
/>
content="Join Invariant, the top AMM DEX on Alephium, and access cutting-edge DeFi solutions with concentrated liquidity for maximum capital efficiency and risk management." />
<meta property="og:image" content="https://alph.invariant.app/favicon-192x192.png" />

<!-- Twitter -->
<meta property="twitter:card" content="summary" />
<meta property="twitter:url" content="https://twitter.com/invariant_labs" />
<meta
property="twitter:title"
content="Invariant - AMM DEX provided concentrated liquidity"
/>
<meta property="twitter:title" content="Invariant - AMM DEX provided concentrated liquidity" />
<meta
property="twitter:description"
content="Discover Invariant, Alephium's most efficient AMM DEX. Concentrated liquidity ensures top-tier capital efficiency for all DeFi traders."
/>
<meta
property="twitter:image"
content="https://alph.invariant.app/favicon-192x192.png"
/>
content="Discover Invariant, Alephium's most efficient AMM DEX. Concentrated liquidity ensures top-tier capital efficiency for all DeFi traders." />
<meta property="twitter:image" content="https://alph.invariant.app/favicon-192x192.png" />

<!-- DublinCore -->
<link rel="schema.dcterms" href="https://purl.org/dc/terms/" />
<meta
name="DC.title"
lang="en"
content="Invariant - The Most Efficient AMM DEX on Alephium with Concentrated Liquidity"
/>
content="Invariant - The Most Efficient AMM DEX on Alephium with Concentrated Liquidity" />
<meta
name="DC.description"
lang="en"
content="Invariant offers top-tier capital efficiency and risk management on Alephium, making it the most advanced AMM DEX for DeFi investors."
/>
content="Invariant offers top-tier capital efficiency and risk management on Alephium, making it the most advanced AMM DEX for DeFi investors." />
<meta name="DC.publisher" content="Invariant" />
<meta name="DC.identifier" content="https://alph.invariant.app/" />
<meta name="DC.format" content="text/html" />
Expand All @@ -93,12 +69,8 @@
<meta itemprop="name" content="Invariant: Leading AMM DEX on Alephium" />
<meta
itemprop="description"
content="Invariant offers top-tier capital efficiency and risk management on Alephium, making it the most advanced AMM DEX for DeFi investors."
/>
<meta
itemprop="image"
content="https://alph.invariant.app/favicon-192x192.png"
/>
content="Invariant offers top-tier capital efficiency and risk management on Alephium, making it the most advanced AMM DEX for DeFi investors." />
<meta itemprop="image" content="https://alph.invariant.app/favicon-192x192.png" />

<!-- Canonical URL -->
<link rel="canonical" href="https://alph.invariant.app/" />
Expand Down Expand Up @@ -126,27 +98,19 @@
},
"foundingDate": "2022",
"areaServed": "Worldwide",
"knowsAbout": [
"Decentralized Finance",
"AMM",
"Concentrated Liquidity",
"Blockchain"
]
"knowsAbout": ["Decentralized Finance", "AMM", "Concentrated Liquidity", "Blockchain"]
}
</script>

<!-- Global Site Tag (gtag.js) - Google Analytics 4 -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=G-TEFDYYTWP3"
></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-TEFDYYTWP3"></script>
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer = window.dataLayer || []
function gtag() {
dataLayer.push(arguments);
dataLayer.push(arguments)
}
gtag("js", new Date());
gtag("config", "G-TEFDYYTWP3", { cookie_flags: "SameSite=None;Secure" });
gtag('js', new Date())
gtag('config', 'G-TEFDYYTWP3', { cookie_flags: 'SameSite=None;Secure' })
</script>

<style>
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
"preview": "vite preview",
"prettify": "prettier --check ."
},
"dependencies": {
"@alephium/web3": "^1.7.3",
Expand Down
32 changes: 16 additions & 16 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { Provider } from "react-redux";
import { store } from "./store";
import { RouterProvider } from "react-router-dom";
import { router } from "@pages/RouterPages";
import SnackbarProvider from "@components/Snackbar";
import { theme } from "@static/theme";
import { ThemeProvider } from "@mui/material/styles";
import Notifier from "@containers/Notifier";
import { filterConsoleMessages, messagesToHide } from "./hideErrors";
import { AlephiumWalletProvider } from "@alephium/web3-react";
import { web3 } from "@alephium/web3";
import { Provider } from 'react-redux'
import { store } from './store'
import { RouterProvider } from 'react-router-dom'
import { router } from '@pages/RouterPages'
import SnackbarProvider from '@components/Snackbar'
import { theme } from '@static/theme'
import { ThemeProvider } from '@mui/material/styles'
import Notifier from '@containers/Notifier'
import { filterConsoleMessages, messagesToHide } from './hideErrors'
import { AlephiumWalletProvider } from '@alephium/web3-react'
import { web3 } from '@alephium/web3'

filterConsoleMessages(messagesToHide);
filterConsoleMessages(messagesToHide)

web3.setCurrentNodeProvider("https://node.testnet.alephium.org");
web3.setCurrentNodeProvider('https://node.testnet.alephium.org')

function App() {
return (
<>
<AlephiumWalletProvider theme="retro" network="testnet" addressGroup={0}>
<AlephiumWalletProvider theme='retro' network='testnet' addressGroup={0}>
<Provider store={store}>
<ThemeProvider theme={theme}>
<SnackbarProvider maxSnack={99}>
Expand All @@ -30,7 +30,7 @@ function App() {
</Provider>
</AlephiumWalletProvider>
</>
);
)
}

export default App;
export default App
50 changes: 22 additions & 28 deletions src/components/EmptyPlaceholder/EmptyPlaceholder.tsx
Original file line number Diff line number Diff line change
@@ -1,47 +1,41 @@
import { Button, Grid, Typography } from "@mui/material";
import classNames from "classnames";
import React from "react";
import { useStyles } from "./style";
import icons from "@static/icons";
import { Button, Grid, Typography } from '@mui/material'
import classNames from 'classnames'
import React from 'react'
import { useStyles } from './style'
import icons from '@static/icons'

export interface IEmptyPlaceholder {
desc: string;
onAction?: () => void;
className?: string;
style?: React.CSSProperties;
withButton?: boolean;
buttonName?: string;
desc: string
onAction?: () => void
className?: string
style?: React.CSSProperties
withButton?: boolean
buttonName?: string
}

export const EmptyPlaceholder: React.FC<IEmptyPlaceholder> = ({
desc,
onAction,
withButton = true,
buttonName,
buttonName
}) => {
const { classes } = useStyles();
const { classes } = useStyles()

return (
<>
<Grid className={classNames(classes.blur, "blurLayer")} />
<Grid className={classNames(classes.container, "blurLayer")}>
<Grid className={classNames(classes.root, "blurInfo")}>
<img className={classes.img} src={icons.empty} alt="Not connected" />
<Grid className={classNames(classes.blur, 'blurLayer')} />
<Grid className={classNames(classes.container, 'blurLayer')}>
<Grid className={classNames(classes.root, 'blurInfo')}>
<img className={classes.img} src={icons.empty} alt='Not connected' />
<Typography className={classes.desc}>It's empty here...</Typography>
{desc?.length && (
<Typography className={classes.desc}>{desc}</Typography>
)}
{desc?.length && <Typography className={classes.desc}>{desc}</Typography>}
{withButton && (
<Button
className={classes.button}
onClick={onAction}
variant="contained"
>
{!!buttonName ? buttonName : "Add a position"}
<Button className={classes.button} onClick={onAction} variant='contained'>
{!!buttonName ? buttonName : 'Add a position'}
</Button>
)}
</Grid>
</Grid>
</>
);
};
)
}
Loading

0 comments on commit 50715b4

Please sign in to comment.