Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
const base = require('@umijs/fabric/dist/eslint');

const disabledTypeScriptRules = {
'@typescript-eslint/ban-types': 0,
'@typescript-eslint/no-parameter-properties': 0,
'@typescript-eslint/no-throw-literal': 0,
'@typescript-eslint/type-annotation-spacing': 0,
};

module.exports = {
...base,
overrides: (base.overrides || []).map((override) => ({
...override,
rules: {
...override.rules,
...disabledTypeScriptRules,
},
})),
rules: {
...base.rules,
'no-template-curly-in-string': 0,
'prefer-promise-reject-errors': 0,
'react/no-array-index-key': 0,
'react/sort-comp': 0,
...disabledTypeScriptRules,
'@typescript-eslint/no-explicit-any': 0,
'jsx-a11y/role-supports-aria-props': 0,
'jsx-a11y/label-has-associated-control': 0,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
"dependencies": {
"@babel/runtime": "^7.10.1",
"@rc-component/motion": "^1.1.4",
"@rc-component/util": "^1.3.0",
"@rc-component/util": "^1.11.1",
"clsx": "^2.1.1"
},
"devDependencies": {
"@rc-component/father-plugin": "^2.0.1",
"@rc-component/father-plugin": "^2.2.0",
"@rc-component/np": "^1.0.4",
"@testing-library/jest-dom": "^6.1.4",
"@testing-library/react": "^16.3.0",
Expand Down
4 changes: 1 addition & 3 deletions src/Collapse.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { clsx } from 'clsx';
import { useControlledState, useEvent } from '@rc-component/util';
import warning from '@rc-component/util/lib/warning';
import { pickAttrs, useControlledState, useEvent, warning } from '@rc-component/util';
import React from 'react';
import useItems from './hooks/useItems';
import type { CollapseProps } from './interface';
import CollapsePanel from './Panel';
import pickAttrs from '@rc-component/util/lib/pickAttrs';

function getActiveKeysArray(activeKey: React.Key | React.Key[]): React.Key[] {
let currentActiveKey = activeKey;
Expand Down
2 changes: 1 addition & 1 deletion src/Panel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { clsx } from 'clsx';
import CSSMotion from '@rc-component/motion';
import KeyCode from '@rc-component/util/lib/KeyCode';
import { KeyCode } from '@rc-component/util';
import React from 'react';
import type { CollapsePanelProps } from './interface';
import PanelContent from './PanelContent';
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useItems.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import toArray from '@rc-component/util/lib/Children/toArray';
import { toArray } from '@rc-component/util';
import React from 'react';
import type { CollapsePanelProps, CollapseProps, ItemType } from '../interface';
import CollapsePanel from '../Panel';
Expand Down
2 changes: 1 addition & 1 deletion tests/index.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RenderResult } from '@testing-library/react';
import { fireEvent, render } from '@testing-library/react';
import KeyCode from '@rc-component/util/lib/KeyCode';
import { KeyCode } from '@rc-component/util';
import React, { Fragment } from 'react';
import Collapse, { Panel } from '../src/index';
import type { CollapseProps, ItemType } from '../src/interface';
Expand Down