diff --git a/.eslintrc.js b/.eslintrc.js index 98dd97f41..9c2f397af 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,16 +1,32 @@ module.exports = { - parser: '@typescript-eslint/parser', + root: true, + parser: "@typescript-eslint/parser", parserOptions: { ecmaVersion: 2020, - sourceType: 'module', + sourceType: "module", ecmaFeatures: { jsx: true, }, }, + env: { + browser: true, + es6: true, + }, + extends: [ + "eslint-config-keep", + "plugin:react/recommended", + "plugin:@typescript-eslint/recommended", + "plugin:prettier/recommended", + ], + plugins: ["react"], + rules: { + "react/prop-types": 0, + "react/display-name": 0, + "no-invalid-this": 0, + }, settings: { react: { - version: 'detect', + version: "detect", }, }, - extends: ['plugin:react/recommended', 'plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'], -}; +} diff --git a/.husky/pre-commit b/.husky/pre-commit index 9e04f93c0..3aebf258c 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -2,4 +2,3 @@ . "$(dirname "$0")/_/husky.sh" yarn run pre-commit - \ No newline at end of file diff --git a/.prettierignore b/.prettierignore index a068f4982..e69de29bb 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +0,0 @@ -src/stories \ No newline at end of file diff --git a/.prettierrc.js b/.prettierrc.js index 13c2be1aa..c8280797a 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,7 +1,3 @@ module.exports = { - semi: true, - trailingComma: 'all', - singleQuote: true, - printWidth: 120, - tabWidth: 2, -}; + ...require("@keep-network/prettier-config-keep"), +} diff --git a/package.json b/package.json index 144b3875e..6af3106bf 100644 --- a/package.json +++ b/package.json @@ -34,22 +34,6 @@ "storybook": "start-storybook -p 6006 -s public", "build-storybook": "build-storybook -s public" }, - "eslintConfig": { - "extends": [ - "react-app", - "react-app/jest" - ], - "overrides": [ - { - "files": [ - "**/*.stories.*" - ], - "rules": { - "import/no-anonymous-default-export": "off" - } - } - ] - }, "browserslist": { "production": [ ">0.2%", @@ -69,6 +53,7 @@ "devDependencies": { "@commitlint/cli": "^13.1.0", "@commitlint/config-conventional": "^13.1.0", + "@keep-network/prettier-config-keep": "github:keep-network/prettier-config-keep#d6ec02e", "@storybook/addon-actions": "^6.3.8", "@storybook/addon-essentials": "^6.3.8", "@storybook/addon-links": "^6.3.8", @@ -78,6 +63,7 @@ "@typescript-eslint/eslint-plugin": "^4.31.1", "@typescript-eslint/parser": "^4.31.1", "eslint": "^7.32.0", + "eslint-config-keep": "github:keep-network/eslint-config-keep#0c27ade", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-react": "^7.25.1", diff --git a/src/App.tsx b/src/App.tsx index 8dd51ade6..72cc9465f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,15 +1,15 @@ -import React from 'react'; -import { ChakraProvider, Heading } from '@chakra-ui/react'; -import theme from './theme'; +import React, { FC } from "react" +import { ChakraProvider, Heading } from "@chakra-ui/react" +import theme from "./theme" -function App() { +const App: FC = () => { return (
Threshold Token Dashboard
- ); + ) } -export default App; +export default App diff --git a/src/index.tsx b/src/index.tsx index e97802010..0ed01339d 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,10 +1,10 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from './App'; +import React from "react" +import ReactDOM from "react-dom" +import App from "./App" ReactDOM.render( , - document.getElementById('root'), -); + document.getElementById("root") +) diff --git a/src/theme.ts b/src/theme.ts index a2c51be48..93e84f2a6 100644 --- a/src/theme.ts +++ b/src/theme.ts @@ -1,4 +1,4 @@ -import { extendTheme } from '@chakra-ui/react'; +import { extendTheme } from "@chakra-ui/react" // TODO: Create theme extensions after discussing with design team // const colors = { @@ -9,6 +9,6 @@ import { extendTheme } from '@chakra-ui/react'; // }, // } -const theme = extendTheme({}); +const theme = extendTheme({}) -export default theme; +export default theme diff --git a/yarn.lock b/yarn.lock index 46590060a..60f5838fa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2483,6 +2483,14 @@ "@types/yargs" "^16.0.0" chalk "^4.0.0" +"@keep-network/prettier-config-keep@github:keep-network/prettier-config-keep": + version "0.0.1" + resolved "https://codeload.github.com/keep-network/prettier-config-keep/tar.gz/a1a333e7ac49928a0f6ed39421906dd1e46ab0f3" + +"@keep-network/prettier-config-keep@github:keep-network/prettier-config-keep#d6ec02e": + version "0.0.1" + resolved "https://codeload.github.com/keep-network/prettier-config-keep/tar.gz/d6ec02e80dd76edfba073ca58ef99aee39002c2c" + "@mdx-js/loader@^1.6.22": version "1.6.22" resolved "https://registry.yarnpkg.com/@mdx-js/loader/-/loader-1.6.22.tgz#d9e8fe7f8185ff13c9c8639c048b123e30d322c4" @@ -7135,6 +7143,28 @@ escodegen@^2.0.0: optionalDependencies: source-map "~0.6.1" +eslint-config-google@^0.13.0: + version "0.13.0" + resolved "https://registry.yarnpkg.com/eslint-config-google/-/eslint-config-google-0.13.0.tgz#e277d16d2cb25c1ffd3fd13fb0035ad7421382fe" + integrity sha512-ELgMdOIpn0CFdsQS+FuxO+Ttu4p+aLaXHv9wA9yVnzqlUGV7oN/eRRnJekk7TCur6Cu2FXX0fqfIXRBaM14lpQ== + +"eslint-config-keep@github:keep-network/eslint-config-keep#0c27ade": + version "0.3.0" + resolved "https://codeload.github.com/keep-network/eslint-config-keep/tar.gz/0c27ade54e725f980e971c3d91ea88bab76b2330" + dependencies: + "@keep-network/prettier-config-keep" "github:keep-network/prettier-config-keep" + eslint-config-google "^0.13.0" + eslint-config-prettier "^6.15.0" + eslint-plugin-no-only-tests "^2.3.1" + eslint-plugin-prettier "^3.1.2" + +eslint-config-prettier@^6.15.0: + version "6.15.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.15.0.tgz#7f93f6cb7d45a92f1537a70ecc06366e1ac6fed9" + integrity sha512-a1+kOYLR8wMGustcgAjdydMsQ2A/2ipRPwRKUmfYaSxc9ZPcrku080Ctl6zrZzZNs/U82MjSv+qKREkoq3bJaw== + dependencies: + get-stdin "^6.0.0" + eslint-config-prettier@^8.3.0: version "8.3.0" resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a" @@ -7216,7 +7246,12 @@ eslint-plugin-jsx-a11y@^6.3.1: jsx-ast-utils "^3.1.0" language-tags "^1.0.5" -eslint-plugin-prettier@^4.0.0: +eslint-plugin-no-only-tests@^2.3.1: + version "2.6.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-no-only-tests/-/eslint-plugin-no-only-tests-2.6.0.tgz#19f6c9620bda02b9b9221b436c5f070e42628d76" + integrity sha512-T9SmE/g6UV1uZo1oHAqOvL86XWl7Pl2EpRpnLI8g/bkJu+h7XBCB+1LnubRZ2CUQXj805vh4/CYZdnqtVaEo2Q== + +eslint-plugin-prettier@^3.1.2, eslint-plugin-prettier@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz#8b99d1e4b8b24a762472b4567992023619cb98e0" integrity sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ== @@ -8113,6 +8148,11 @@ get-package-type@^0.1.0: resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== +get-stdin@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" + integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== + get-stream@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"