Skip to content

Commit 38a5f0a

Browse files
committed
chore: update-eslint-and-prettier
1 parent 2210d55 commit 38a5f0a

File tree

19 files changed

+1260
-398
lines changed

19 files changed

+1260
-398
lines changed

.eslintrc.json

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,16 @@
1818
"plugin:react-hooks/recommended",
1919
"plugin:import/recommended",
2020
"plugin:import/react",
21-
"plugin:security/recommended",
2221
"plugin:@typescript-eslint/recommended",
2322
"plugin:prettier/recommended",
24-
"prettier"
23+
"prettier",
24+
"plugin:security/recommended-legacy"
2525
],
2626
"globals": {
2727
"Atomics": "readonly",
2828
"SharedArrayBuffer": "readonly"
2929
},
30-
"plugins": [
31-
"react",
32-
"react-hooks",
33-
"security",
34-
"import"
35-
],
30+
"plugins": ["react", "react-hooks", "security", "import"],
3631
"ignorePatterns": ["src/assets"],
3732
"settings": {
3833
"react": {
@@ -41,20 +36,12 @@
4136
"import/resolver": {
4237
"parcel": {
4338
"rootDir": "src",
44-
"extensions": [
45-
".js",
46-
".jsx",
47-
".ts",
48-
".tsx",
49-
".svg",
50-
".png",
51-
".jpeg"
52-
]
39+
"extensions": [".js", ".jsx", ".ts", ".tsx", ".svg", ".png", ".jpeg"]
5340
}
5441
}
5542
},
5643
"rules": {
57-
"max-len": ["warn", {"code": 80}],
44+
"max-len": ["warn", { "code": 80 }],
5845
"react/prop-types": 0,
5946
"no-unused-vars": "off",
6047
"@typescript-eslint/no-unused-vars": [
@@ -67,12 +54,7 @@
6754
"no-console": [
6855
"error",
6956
{
70-
"allow": [
71-
"warn",
72-
"error",
73-
"info",
74-
"debug"
75-
]
57+
"allow": ["warn", "error", "info", "debug"]
7658
}
7759
],
7860
"@typescript-eslint/no-explicit-any": ["off"],
File renamed without changes.

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@
3535
"@typescript-eslint/eslint-plugin": "^5.9.1",
3636
"@typescript-eslint/parser": "^5.9.1",
3737
"babel-plugin-styled-components": "^2.0.2",
38-
"eslint": "^7",
39-
"eslint-config-prettier": "^8.3.0",
38+
"eslint": "^8",
39+
"eslint-config-prettier": "^10.1.1",
4040
"eslint-import-resolver-parcel": "^1.10.6",
41-
"eslint-plugin-import": "^2.25.3",
42-
"eslint-plugin-prettier": "^4.0.0",
43-
"eslint-plugin-react": "^7.27.1",
44-
"eslint-plugin-react-hooks": "^4.3.0",
45-
"eslint-plugin-security": "^1.4.0",
41+
"eslint-plugin-import": "^2.31.0",
42+
"eslint-plugin-prettier": "^5.2.3",
43+
"eslint-plugin-react": "^7.37.4",
44+
"eslint-plugin-react-hooks": "^5.2.0",
45+
"eslint-plugin-security": "^3.0.1",
4646
"husky": "^7.0.0",
4747
"lint-staged": "^12.1.2",
4848
"parcel": "^2.13.3",
49-
"prettier": "^2.5.1",
49+
"prettier": "^3.5.3",
5050
"prettier-plugin-tailwindcss": "^0.6.11",
5151
"process": "^0.11.10",
5252
"styled-components": "^5.3.3",

src/examples/input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const Input: React.FC = () => {
1515
const [radioValue, setRadioValue] = useState("bitcoin");
1616

1717
const changeRadioValue: React.ChangeEventHandler<HTMLInputElement> = (
18-
event
18+
event,
1919
) => setRadioValue(event.target.value);
2020

2121
return (

src/hooks/pagination/use-pagination.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const usePagination = (
33
numPages: number,
44
callback: (newPage: number) => void,
55
onCloseOnLastPage?: () => void,
6-
numNeighbors = 2
6+
numNeighbors = 2,
77
) => {
88
const incrementPage = () => {
99
if (currentPage === numPages && onCloseOnLastPage) {
@@ -31,14 +31,14 @@ const usePagination = (
3131
1,
3232
currentPage -
3333
numNeighbors -
34-
Math.max(0, numNeighbors - (numPages - currentPage))
34+
Math.max(0, numNeighbors - (numPages - currentPage)),
3535
);
3636
const rightBoundary = Math.min(
3737
numPages,
38-
currentPage + numNeighbors + Math.max(0, numNeighbors - currentPage + 1)
38+
currentPage + numNeighbors + Math.max(0, numNeighbors - currentPage + 1),
3939
);
4040
return [...Array(rightBoundary - leftBoundary + 1).keys()].map(
41-
(i) => i + leftBoundary
41+
(i) => i + leftBoundary,
4242
);
4343
};
4444

src/hooks/useElementSize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface Size {
99

1010
export function useElementSize<T extends HTMLElement = HTMLDivElement>(): [
1111
(node: T | null) => void,
12-
Size
12+
Size,
1313
] {
1414
// Mutable values like 'ref.current' aren't valid dependencies
1515
// because mutating them doesn't re-render the component.

src/hooks/useResizeObserver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useLayoutEffect } from "react";
22

33
export function useResizeObserver<T extends HTMLElement>(
44
element: T | null,
5-
callback: (target: T, entry: ResizeObserverEntry) => void
5+
callback: (target: T, entry: ResizeObserverEntry) => void,
66
) {
77
useLayoutEffect(() => {
88
if (!element) {

src/lib/breadcrumb.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const Breadcrumb: React.FC<BreadcrumbProps> = ({
6464
</Element>
6565
<Separator>{"/"}</Separator>
6666
</React.Fragment>
67-
)
67+
),
6868
)}
6969
</Wrapper>
7070
);

src/lib/dropdown/cascader/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const Wrapper = styled(DropdownContainer)`
1818
${mobileStyle(
1919
() => css`
2020
width: 240px;
21-
`
21+
`,
2222
)}
2323
border-radius: 3px;
2424
`;
@@ -37,7 +37,7 @@ const Container = styled.div<{ path: ILayer[]; isOpen: boolean }>`
3737
${mobileStyle(
3838
() => css`
3939
overflow: auto;
40-
`
40+
`,
4141
)}
4242
`}
4343
`;
@@ -72,7 +72,7 @@ const Cascader: React.FC<ICascader> = ({
7272

7373
const label = useMemo(
7474
() => (value ? findLabelByValue(items, value) : undefined),
75-
[items, value]
75+
[items, value],
7676
);
7777

7878
return (
@@ -132,7 +132,7 @@ const Cascader: React.FC<ICascader> = ({
132132
*/
133133
function findLabelByValue(
134134
nodes: IItem[],
135-
targetValue: string | number
135+
targetValue: string | number,
136136
): string | undefined {
137137
for (const node of nodes) {
138138
if (node.value == targetValue) {

src/lib/dropdown/cascader/selector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const Wrapper = styled.div`
1313
${mobileStyle(
1414
() => css`
1515
justify-content: center;
16-
`
16+
`,
1717
)}
1818
justify-content: end;
1919
align-items: center;

0 commit comments

Comments
 (0)