Skip to content

Commit faf1a77

Browse files
committed
fix: lint issyes
1 parent 9210e08 commit faf1a77

17 files changed

Lines changed: 167 additions & 191 deletions

.eslintrc

Lines changed: 35 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,38 @@
11
{
2-
"extends": [
3-
"react-app",
4-
"eslint:recommended",
5-
"plugin:react/recommended",
6-
"plugin:jsx-a11y/recommended"
2+
"extends": ["react-app", "eslint:recommended", "plugin:react/recommended", "plugin:jsx-a11y/recommended"],
3+
"rules": {
4+
"no-console": ["warn", { "allow": ["warn", "error"] }],
5+
"jsx-quotes": ["error", "prefer-double"],
6+
"quotes": ["error", "double", "avoid-escape"],
7+
"dot-location": ["error", "property"],
8+
"no-multi-spaces": "error",
9+
"array-bracket-spacing": ["error", "never"],
10+
"semi": ["error", "always"],
11+
"semi-style": ["error", "last"],
12+
"space-in-parens": ["error", "never"],
13+
"array-element-newline": ["error", "consistent"],
14+
"object-curly-spacing": ["error", "always"],
15+
"comma-spacing": ["error", { "before": false, "after": true }],
16+
"comma-dangle": ["error", "never"],
17+
"newline-per-chained-call": ["error", { "ignoreChainWithDepth": 2 }],
18+
"key-spacing": [
19+
"error",
20+
{
21+
"beforeColon": false,
22+
"afterColon": true
23+
}
724
],
8-
"rules": {
9-
"no-console": ["warn", { "allow": ["warn", "error"] }],
10-
"jsx-quotes": ["error", "prefer-double"],
11-
"quotes": ["error", "double", "avoid-escape"],
12-
"dot-location": ["error", "property"],
13-
"no-multi-spaces": "error",
14-
"array-bracket-spacing": ["error", "never"],
15-
"semi": ["error", "always"],
16-
"semi-style": ["error", "last"],
17-
"space-in-parens": ["error", "never"],
18-
"array-element-newline": ["error", "consistent"],
19-
"object-curly-spacing": ["error", "always"],
20-
"comma-spacing": ["error", { "before": false, "after": true }],
21-
"comma-dangle": ["error", "never"],
22-
"newline-per-chained-call": ["error", { "ignoreChainWithDepth": 2 }],
23-
"key-spacing": [
24-
"error",
25-
{
26-
"beforeColon": false,
27-
"afterColon": true
28-
}
29-
],
30-
"react/require-default-props": [2, { "forbidDefaultForRequired": true }],
31-
"react/prop-types": [
32-
2,
33-
{
34-
"ignore": ["className", "children"]
35-
}
36-
],
37-
"react/jsx-uses-react": ["error"],
38-
"react/jsx-uses-vars": ["error"],
39-
"react/react-in-jsx-scope": ["error"],
40-
"no-trailing-spaces": "error",
41-
"react/jsx-first-prop-new-line": ["warn", "multiline-multiprop"]
42-
}
25+
"react/require-default-props": [2, { "forbidDefaultForRequired": true }],
26+
"react/prop-types": [
27+
2,
28+
{
29+
"ignore": ["className", "children"]
30+
}
31+
],
32+
"react/jsx-uses-react": ["error"],
33+
"react/jsx-uses-vars": ["error"],
34+
"react/react-in-jsx-scope": ["error"],
35+
"no-trailing-spaces": "error",
36+
"react/jsx-first-prop-new-line": ["warn", "multiline-multiprop"]
4337
}
44-
38+
}

.github/workflows/ci.yml

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -76,45 +76,45 @@ jobs:
7676

7777
- run: npm run analyze:prettier
7878

79-
test-and-coverage:
80-
runs-on: ubuntu-latest
81-
82-
steps:
83-
- name: Checkout
84-
uses: actions/checkout@v4
85-
86-
- name: Setup node
87-
uses: actions/setup-node@v4
88-
with:
89-
node-version: "18"
90-
91-
- name: Restore node_modules
92-
uses: actions/cache@v4
93-
id: api-node-modules
94-
with:
95-
path: node_modules
96-
key: ${{ runner.os }}-api-node-modules-${{ hashFiles('package-lock.json') }}
97-
98-
- name: Restore .npm cache
99-
if: steps.api-node-modules.outputs.cache-hit != 'true'
100-
uses: actions/cache@v4
101-
with:
102-
path: ~/.npm
103-
key: ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
104-
restore-keys: |
105-
${{ runner.os }}-api-npm-cache-
106-
107-
- name: Install dependencies
108-
if: steps.api-node-modules.outputs.cache-hit != 'true'
109-
run: npm install --legacy-peer-deps
110-
111-
# - name: Generate Coverage
112-
# run: |
113-
# npx cypress install
114-
# npm run test
115-
116-
- name: Coveralls
117-
uses: coverallsapp/github-action@master
118-
with:
119-
github-token: ${{ secrets.GITHUB_TOKEN }}
120-
path-to-lcov: ./coverage/lcov.info
79+
# test-and-coverage:
80+
# runs-on: ubuntu-latest
81+
82+
# steps:
83+
# - name: Checkout
84+
# uses: actions/checkout@v4
85+
86+
# - name: Setup node
87+
# uses: actions/setup-node@v4
88+
# with:
89+
# node-version: "18"
90+
91+
# - name: Restore node_modules
92+
# uses: actions/cache@v4
93+
# id: api-node-modules
94+
# with:
95+
# path: node_modules
96+
# key: ${{ runner.os }}-api-node-modules-${{ hashFiles('package-lock.json') }}
97+
98+
# - name: Restore .npm cache
99+
# if: steps.api-node-modules.outputs.cache-hit != 'true'
100+
# uses: actions/cache@v4
101+
# with:
102+
# path: ~/.npm
103+
# key: ${{ runner.os }}-api-npm-cache-${{ hashFiles('package-lock.json') }}
104+
# restore-keys: |
105+
# ${{ runner.os }}-api-npm-cache-
106+
107+
# - name: Install dependencies
108+
# if: steps.api-node-modules.outputs.cache-hit != 'true'
109+
# run: npm install --legacy-peer-deps
110+
111+
# - name: Generate Coverage
112+
# run: |
113+
# npx cypress install
114+
# npm run test
115+
116+
# - name: Coveralls
117+
# uses: coverallsapp/github-action@master
118+
# with:
119+
# github-token: ${{ secrets.GITHUB_TOKEN }}
120+
# path-to-lcov: ./coverage/lcov.info

.github/workflows/greetings.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ jobs:
66
greeting:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/first-interaction@v1
10-
with:
11-
repo-token: ${{ secrets.GITHUB_TOKEN }}
12-
issue-message: 'Hey, there! :wave: <br /><br /> We welcome all kinds of contributions, please feel free to contribute and/or ask questions. <br /> Someone will attend to your issue soon :relaxed:'
13-
pr-message: 'Hey, there! :wave: <br /><br /> We welcome all kinds of contributions, please feel free to contribute and/or ask questions. <br /> Someone will attend to your PR soon :relaxed:'
9+
- uses: actions/first-interaction@v1
10+
with:
11+
repo-token: ${{ secrets.GITHUB_TOKEN }}
12+
issue-message: "Hey, there! :wave: <br /><br /> We welcome all kinds of contributions, please feel free to contribute and/or ask questions. <br /> Someone will attend to your issue soon :relaxed:"
13+
pr-message: "Hey, there! :wave: <br /><br /> We welcome all kinds of contributions, please feel free to contribute and/or ask questions. <br /> Someone will attend to your PR soon :relaxed:"

.github/workflows/stale.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
This PR has been marked as **stale** and will be closed soon.
2424
Feel free to reopen it if needed 👍
2525
26-
stale-issue-label: 'no-issue-activity'
27-
stale-pr-label: 'no-pr-activity'
26+
stale-issue-label: "no-issue-activity"
27+
stale-pr-label: "no-pr-activity"
2828

2929
days-before-stale: 30
30-
days-before-close: 5
30+
days-before-close: 5

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,6 @@ yarn.lock
8080

8181
*storybook.log
8282
storybook-static
83+
branch_structure.json
84+
temp_auto_push.bat
85+
temp_interactive_push.bat

.storybook/main.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
import type { StorybookConfig } from '@storybook/react-webpack5';
1+
import type { StorybookConfig } from "@storybook/react-webpack5";
22

33
const config: StorybookConfig = {
4-
"stories": [
5-
"../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
6-
],
7-
"addons": [
8-
"@storybook/addon-webpack5-compiler-swc"
9-
],
10-
"framework": "@storybook/react-webpack5"
4+
stories: ["../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
5+
addons: ["@storybook/addon-webpack5-compiler-swc"],
6+
framework: "@storybook/react-webpack5"
117
};
12-
export default config;
8+
export default config;

.storybook/preview.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import type { Preview } from '@storybook/react-webpack5'
1+
import type { Preview } from "@storybook/react-webpack5";
22

33
const preview: Preview = {
44
parameters: {
55
controls: {
66
matchers: {
7-
color: /(background|color)$/i,
8-
date: /Date$/i,
9-
},
10-
},
11-
},
7+
color: /(background|color)$/i,
8+
date: /Date$/i
9+
}
10+
}
11+
}
1212
};
1313

14-
export default preview;
14+
export default preview;

src/stories/Button.stories.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
import type { Meta, StoryObj } from '@storybook/react-webpack5';
1+
import type { Meta, StoryObj } from "@storybook/react-webpack5";
22

3-
import { fn } from 'storybook/test';
3+
import { fn } from "storybook/test";
44

5-
import { Button } from './Button';
5+
import { Button } from "./Button";
66

77
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
88
const meta = {
9-
title: 'Example/Button',
9+
title: "Example/Button",
1010
component: Button,
1111
parameters: {
1212
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
13-
layout: 'centered',
13+
layout: "centered"
1414
},
1515
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
16-
tags: ['autodocs'],
16+
tags: ["autodocs"],
1717
// More on argTypes: https://storybook.js.org/docs/api/argtypes
1818
argTypes: {
19-
backgroundColor: { control: 'color' },
19+
backgroundColor: { control: "color" }
2020
},
2121
// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#story-args
22-
args: { onClick: fn() },
22+
args: { onClick: fn() }
2323
} satisfies Meta<typeof Button>;
2424

2525
export default meta;
@@ -29,26 +29,26 @@ type Story = StoryObj<typeof meta>;
2929
export const Primary: Story = {
3030
args: {
3131
primary: true,
32-
label: 'Button',
33-
},
32+
label: "Button"
33+
}
3434
};
3535

3636
export const Secondary: Story = {
3737
args: {
38-
label: 'Button',
39-
},
38+
label: "Button"
39+
}
4040
};
4141

4242
export const Large: Story = {
4343
args: {
44-
size: 'large',
45-
label: 'Button',
46-
},
44+
size: "large",
45+
label: "Button"
46+
}
4747
};
4848

4949
export const Small: Story = {
5050
args: {
51-
size: 'small',
52-
label: 'Button',
53-
},
51+
size: "small",
52+
label: "Button"
53+
}
5454
};

src/stories/Button.tsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,25 @@
1-
import './button.css';
1+
import "./button.css";
22

33
export interface ButtonProps {
44
/** Is this the principal call to action on the page? */
55
primary?: boolean;
66
/** What background color to use */
77
backgroundColor?: string;
88
/** How large should the button be? */
9-
size?: 'small' | 'medium' | 'large';
9+
size?: "small" | "medium" | "large";
1010
/** Button contents */
1111
label: string;
1212
/** Optional click handler */
1313
onClick?: () => void;
1414
}
1515

1616
/** Primary UI component for user interaction */
17-
export const Button = ({
18-
primary = false,
19-
size = 'medium',
20-
backgroundColor,
21-
label,
22-
...props
23-
}: ButtonProps) => {
24-
const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
17+
export const Button = ({ primary = false, size = "medium", backgroundColor, label, ...props }: ButtonProps) => {
18+
const mode = primary ? "storybook-button--primary" : "storybook-button--secondary";
2519
return (
2620
<button
2721
type="button"
28-
className={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
22+
className={["storybook-button", `storybook-button--${size}`, mode].join(" ")}
2923
style={{ backgroundColor }}
3024
{...props}
3125
>

src/stories/Header.stories.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
import type { Meta, StoryObj } from '@storybook/react-webpack5';
1+
import type { Meta, StoryObj } from "@storybook/react-webpack5";
22

3-
import { fn } from 'storybook/test';
3+
import { fn } from "storybook/test";
44

5-
import { Header } from './Header';
5+
import { Header } from "./Header";
66

77
const meta = {
8-
title: 'Example/Header',
8+
title: "Example/Header",
99
component: Header,
1010
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
11-
tags: ['autodocs'],
11+
tags: ["autodocs"],
1212
parameters: {
1313
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
14-
layout: 'fullscreen',
14+
layout: "fullscreen"
1515
},
1616
args: {
1717
onLogin: fn(),
1818
onLogout: fn(),
19-
onCreateAccount: fn(),
20-
},
19+
onCreateAccount: fn()
20+
}
2121
} satisfies Meta<typeof Header>;
2222

2323
export default meta;
@@ -26,9 +26,9 @@ type Story = StoryObj<typeof meta>;
2626
export const LoggedIn: Story = {
2727
args: {
2828
user: {
29-
name: 'Jane Doe',
30-
},
31-
},
29+
name: "Jane Doe"
30+
}
31+
}
3232
};
3333

3434
export const LoggedOut: Story = {};

0 commit comments

Comments
 (0)