Skip to content

Commit

Permalink
adds component list to explicit-function-return-type allowedNames
Browse files Browse the repository at this point in the history
  • Loading branch information
tibuurcio committed Jan 19, 2024
1 parent b2108ae commit 8aa713f
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 18 deletions.
78 changes: 76 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,86 @@ module.exports = {
plugins: ['react', 'react-hooks'],
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-function-return-type': [
'warn',
{
allowedNames: [
'Button',
'FloatButton',
'Icon',
'Rate',
'Form',
'TreeSelect',
'Select',
'Mentions',
'Radio',
'ColorPicker',
'Slider',
'Cascader',
'DatePicker',
'Checkbox',
'Input',
'InputNumber',
'Switch',
'Upload',
'AutoComplete',
'TimePicker',
'Transfer',
'Collapse',
'Timeline',
'Calendar',
'Segmented',
'Tabs',
'Tag',
'Tour',
'Carousel',
'Tooltip',
'Statistic',
'Tree',
'Image',
'QRCode',
'Badge',
'Card',
'Avatar',
'Descriptions',
'Table',
'Empty',
'Popover',
'List',
'Progress',
'Result',
'Spin',
'Skeleton',
'Watermark',
'Popconfirm',
'Drawer',
'Modal',
'Notification',
'Alert',
'Message',
'LoadingModal',
'Flex',
'Space',
'Layout',
'Grid',
'Divider',
'Steps',
'Anchor',
'Dropdown',
'Breadcrumb',
'Pagination',
'Menu',
'ConfigProvider',
'Affix',
'App',
],
},
],
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/no-use-before-define': ['error', { allowNamedExports: true }],
'react/react-in-jsx-scope': 'off',
'import/no-duplicates': 'off'
'import/no-duplicates': 'off',
},
globals: {
React: true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"build-storybook": "storybook build",
"tokens-to-css": "npx style-dictionary build --config ./style-dictionary.json",
"prepare": "husky install",
"lint": "eslint --ext .ts,.tsx \"src/**/*.{ts,tsx}\""
"lint": "eslint --ext .ts,.tsx \"src/**/*.{ts,tsx}\" --quiet"
},
"lint-staged": {
"*.{ts,tsx}": [
Expand Down
6 changes: 1 addition & 5 deletions src/components/data-display/Tag/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@ import { Tag as AntTag, type TagProps as AntTagProps } from 'antd'
export interface ITagProps extends AntTagProps {}

export const Tag = (props: ITagProps) => {
return (
<>
<AntTag {...props} />
</>
)
return <AntTag {...props} />
}
17 changes: 7 additions & 10 deletions src/components/data-entry/Checkbox/Checkbox.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@ const meta: Meta<typeof Checkbox> = {
component: props => {
const [checked, setChecked] = useState<boolean>(props.checked ?? props.defaultChecked ?? false)
return (
<>
{' '}
<Checkbox
{...props}
checked={checked}
onChange={e => {
setChecked(!checked)
}}
/>{' '}
</>
<Checkbox
{...props}
checked={checked}
onChange={e => {
setChecked(!checked)
}}
/>
)
},

Expand Down

0 comments on commit 8aa713f

Please sign in to comment.