Skip to content

Commit

Permalink
upgrade prettier configs
Browse files Browse the repository at this point in the history
  • Loading branch information
kamijin-fanta committed Oct 14, 2022
1 parent 92638d1 commit bb61ab8
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 27 deletions.
12 changes: 12 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.yarn
node_modules
/dist/

/packages/_react-icons_all
/packages/_react-icons_all-files

/packages/react-icons/build
/packages/react-icons/src/icons/*
!/packages/react-icons/src/icons/index.js

/packages/preview/.next
6 changes: 6 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
overrides:
- files:
- "*.tsx"
- "*.ts"
options:
parser: typescript
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
],
"license": "MIT",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "latest",
"@typescript-eslint/parser": "latest",
"@typescript-eslint/eslint-plugin": "^5.40.0",
"@typescript-eslint/parser": "^5.40.0",
"eslint": "^8.25.0",
"eslint-plugin-react": "latest",
"lerna": "^3.22.1",
Expand All @@ -17,6 +17,8 @@
"submodule": "git submodule update --init",
"submodule-deinit": "git submodule deinit --all",
"lint": "yarn eslint .",
"format": "prettier --write --ignore-unknown .",
"format:ci": "prettier --check --ignore-unknown .",
"version-up": "lerna version",
"version-snapshot": "lerna version --no-push --no-git-tag-version --yes --preid snapshot prepatch --force-publish",
"version": "yarn install && git add .",
Expand Down
15 changes: 0 additions & 15 deletions packages/preview/.prettierrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/preview/src/pages/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function SearchPage() {
const { q } = router.query;
const { query, setQuery } = React.useContext(Context);

if (!query && q) setQuery(q);
if (!query && q) setQuery(q as any);

return (
<Container title="🔍 Search">
Expand Down
20 changes: 15 additions & 5 deletions packages/preview/src/utils/search-context.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
/* eslint-disable @typescript-eslint/no-empty-function */
import React from "react";

export const Context = React.createContext({
interface ContextType {
query: string;
setQuery: (query: string) => void;
results: any;
setResults: (results: any) => void;
}

export const Context: React.Context<ContextType> = React.createContext({
query: "",
setQuery: () => {},
setQuery: () => {
// nop
},
results: {},
setResults: () => {}
} as any);
setResults: () => {
//nop
}
});

export const Provider = ({ children }) => {
const [query, setQuery] = React.useState("");
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4407,7 +4407,7 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/eslint-plugin@npm:^5.5.0, @typescript-eslint/eslint-plugin@npm:latest":
"@typescript-eslint/eslint-plugin@npm:^5.40.0, @typescript-eslint/eslint-plugin@npm:^5.5.0":
version: 5.40.0
resolution: "@typescript-eslint/eslint-plugin@npm:5.40.0"
dependencies:
Expand Down Expand Up @@ -4440,7 +4440,7 @@ __metadata:
languageName: node
linkType: hard

"@typescript-eslint/parser@npm:^5.5.0, @typescript-eslint/parser@npm:latest":
"@typescript-eslint/parser@npm:^5.40.0, @typescript-eslint/parser@npm:^5.5.0":
version: 5.40.0
resolution: "@typescript-eslint/parser@npm:5.40.0"
dependencies:
Expand Down Expand Up @@ -15980,8 +15980,8 @@ __metadata:
version: 0.0.0-use.local
resolution: "react-icons-root@workspace:."
dependencies:
"@typescript-eslint/eslint-plugin": latest
"@typescript-eslint/parser": latest
"@typescript-eslint/eslint-plugin": ^5.40.0
"@typescript-eslint/parser": ^5.40.0
eslint: ^8.25.0
eslint-plugin-react: latest
lerna: ^3.22.1
Expand Down

0 comments on commit bb61ab8

Please sign in to comment.