Skip to content

Commit

Permalink
Merge pull request #330 from kamiazya/upgrade-eslint-and-prettier
Browse files Browse the repository at this point in the history
chaos: upgrade eslint and prettier
  • Loading branch information
kamiazya authored Jul 28, 2021
2 parents 641f8d3 + 160bc14 commit 8fecaea
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 42 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@
"airbnb",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"prettier",
"plugin:react-hooks/recommended",
"plugin:jest/recommended"
],
"rules": {
"no-use-before-define": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-use-before-define": "warn",
"prettier/prettier": "error",
"import/extensions": "off",
"import/no-unresolved": "off",
Expand Down
18 changes: 11 additions & 7 deletions component-libraries/aws/src/components/groups/VPC.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,21 @@ function resolveColor(type?: Type): string | undefined {
}
}

function useStyle(
type?: Type,
): { fontcolor: string | undefined; bgcolor: string | undefined; color: string | undefined; icon: string } {
return useMemo(() => {
return {
function useStyle(type?: Type): {
fontcolor: string | undefined;
bgcolor: string | undefined;
color: string | undefined;
icon: string;
} {
return useMemo(
() => ({
color: resolveColor(type),
fontcolor: resolveFontcolor(type),
bgcolor: resolveBgcolor(type),
icon: resolveImage(type),
};
}, [type]);
}),
[type],
);
}

export const VPC: FC<Props> = ({ type, ip, children }) => {
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@
"@testing-library/react-hooks": "^3.4.1",
"@types/fs-extra": "^9.0.1",
"@types/jest": "^26.0.13",
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"eslint": "^7.8.1",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^24.0.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.0",
"@typescript-eslint/eslint-plugin": "^4.28.5",
"@typescript-eslint/parser": "^4.28.5",
"eslint": "^7.31.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jest": "^24.4.0",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",
"fs-extra": "^9.0.0",
"jest": "^26.4.2",
"jest-graphviz": "^0.3.1",
"lerna": "^3.22.1",
"prettier": "^2.1.1",
"prettier": "^2.3.2",
"react-test-renderer": "^16.13.1",
"ts-jest": "^26.3.0",
"ts-node": "^9.0.0",
Expand Down
37 changes: 15 additions & 22 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3459,7 +3459,7 @@
dependencies:
"@types/yargs-parser" "*"

"@typescript-eslint/eslint-plugin@^4.0.1":
"@typescript-eslint/eslint-plugin@^4.28.5":
version "4.28.5"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.28.5.tgz#8197f1473e7da8218c6a37ff308d695707835684"
integrity sha512-m31cPEnbuCqXtEZQJOXAHsHvtoDi9OVaeL5wZnO2KZTnkvELk+u6J6jHg+NzvWQxk+87Zjbc4lJS4NHmgImz6Q==
Expand All @@ -3484,7 +3484,7 @@
eslint-scope "^5.1.1"
eslint-utils "^3.0.0"

"@typescript-eslint/parser@^4.0.1":
"@typescript-eslint/parser@^4.28.5":
version "4.28.5"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.28.5.tgz#9c971668f86d1b5c552266c47788a87488a47d1c"
integrity sha512-NPCOGhTnkXGMqTznqgVbA5LqVsnw+i3+XA1UKLnAb+MG1Y1rP4ZSK9GX0kJBmAZTMIktf+dTwXToT6kFwyimbw==
Expand Down Expand Up @@ -6434,7 +6434,7 @@ eslint-config-airbnb-base@^14.2.1:
object.assign "^4.1.2"
object.entries "^1.1.2"

eslint-config-airbnb@^18.2.0:
eslint-config-airbnb@^18.2.1:
version "18.2.1"
resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-18.2.1.tgz#b7fe2b42f9f8173e825b73c8014b592e449c98d9"
integrity sha512-glZNDEZ36VdlZWoxn/bUR1r/sdFKPd1mHPbqUtkctgNG4yT2DLLtJ3D+yCV+jzZCc2V1nBVkmdknOJBZ5Hc0fg==
Expand All @@ -6443,12 +6443,10 @@ eslint-config-airbnb@^18.2.0:
object.assign "^4.1.2"
object.entries "^1.1.2"

eslint-config-prettier@^6.11.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"
integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==

eslint-import-resolver-node@^0.3.4:
version "0.3.4"
Expand All @@ -6466,7 +6464,7 @@ eslint-module-utils@^2.6.1:
debug "^3.2.7"
pkg-dir "^2.0.0"

eslint-plugin-import@^2.22.0:
eslint-plugin-import@^2.23.4:
version "2.23.4"
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.23.4.tgz#8dceb1ed6b73e46e50ec9a5bb2411b645e7d3d97"
integrity sha512-6/wP8zZRsnQFiR3iaPFgh5ImVRM1WN5NUWfTIRqwOdeiGJlBcSk82o1FEVq8yXmy4lkIzTo7YhHCIxlU/2HyEQ==
Expand All @@ -6487,14 +6485,14 @@ eslint-plugin-import@^2.22.0:
resolve "^1.20.0"
tsconfig-paths "^3.9.0"

eslint-plugin-jest@^24.0.0:
eslint-plugin-jest@^24.4.0:
version "24.4.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.4.0.tgz#fa4b614dbd46a98b652d830377971f097bda9262"
integrity sha512-8qnt/hgtZ94E9dA6viqfViKBfkJwFHXgJmTWlMGDgunw1XJEGqm3eiPjDsTanM3/u/3Az82nyQM9GX7PM/QGmg==
dependencies:
"@typescript-eslint/experimental-utils" "^4.0.1"

eslint-plugin-jsx-a11y@^6.3.1:
eslint-plugin-jsx-a11y@^6.4.1:
version "6.4.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.4.1.tgz#a2d84caa49756942f42f1ffab9002436391718fd"
integrity sha512-0rGPJBbwHoGNPU73/QCLP/vveMlM1b1Z9PponxO87jfr6tuH5ligXbDT6nHSSzBC8ovX2Z+BQu7Bk5D/Xgq9zg==
Expand All @@ -6511,19 +6509,19 @@ eslint-plugin-jsx-a11y@^6.3.1:
jsx-ast-utils "^3.1.0"
language-tags "^1.0.5"

eslint-plugin-prettier@^3.1.4:
eslint-plugin-prettier@^3.4.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.4.0.tgz#cdbad3bf1dbd2b177e9825737fe63b476a08f0c7"
integrity sha512-UDK6rJT6INSfcOo545jiaOwB701uAIt2/dR7WnFQoGCVl1/EMqdANBmwUaqqQ45aXprsTGzSa39LI1PyuRBxxw==
dependencies:
prettier-linter-helpers "^1.0.0"

eslint-plugin-react-hooks@^4.1.0:
eslint-plugin-react-hooks@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.2.0.tgz#8c229c268d468956334c943bb45fc860280f5556"
integrity sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ==

eslint-plugin-react@^7.20.6:
eslint-plugin-react@^7.24.0:
version "7.24.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.24.0.tgz#eadedfa351a6f36b490aa17f4fa9b14e842b9eb4"
integrity sha512-KJJIx2SYx7PBx3ONe/mEeMz4YE0Lcr7feJTCMyyKb/341NcjuAgim3Acgan89GfPv7nxXK2+0slu0CWXYM4x+Q==
Expand Down Expand Up @@ -6573,7 +6571,7 @@ eslint-visitor-keys@^2.0.0:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303"
integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==

eslint@^7.8.1:
eslint@^7.31.0:
version "7.31.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.31.0.tgz#f972b539424bf2604907a970860732c5d99d3aca"
integrity sha512-vafgJpSh2ia8tnTkNUkwxGmnumgckLh5aAbLa1xRmIn9+owi8qBNGKL+B881kNKNTy7FFqTEkpNkUvmw0n6PkA==
Expand Down Expand Up @@ -7373,11 +7371,6 @@ get-stdin@^4.0.1:
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"
integrity sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=

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, get-stream@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
Expand Down Expand Up @@ -12061,7 +12054,7 @@ prettier-linter-helpers@^1.0.0:
dependencies:
fast-diff "^1.1.2"

prettier@^2.1.1:
prettier@^2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.2.tgz#ef280a05ec253712e486233db5c6f23441e7342d"
integrity sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==
Expand Down

0 comments on commit 8fecaea

Please sign in to comment.