Skip to content

Commit

Permalink
fix: fix type lint (#628)
Browse files Browse the repository at this point in the history
* fix: fix type

* feat: add @typescript-eslint/no-unused-vars to eslint

* fix: fix lint
  • Loading branch information
soulwu authored and janryWang committed Jan 21, 2020
1 parent 02e715c commit 8215d7f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 29 deletions.
20 changes: 6 additions & 14 deletions packages/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,15 @@
"extends": [
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"prettier/@typescript-eslint"
],
"env": {
"browser": true,
"es6": true,
"jest": true,
"commonjs": true
},
"plugins": [
"@typescript-eslint",
"react",
"react-hooks",
"prettier"
],
"plugins": ["@typescript-eslint", "react", "react-hooks", "prettier"],
"parserOptions": {
"project": "./tsconfig.json",
"sourceType": "module",
Expand All @@ -27,7 +22,7 @@
},
"settings": {
"react": {
"version": "detect",
"version": "detect"
}
},
"rules": {
Expand All @@ -50,15 +45,12 @@
"@typescript-eslint/array-type": 0,
"@typescript-eslint/no-object-literal-type-assertion": 0,
"@typescript-eslint/no-use-before-define": 0,
"@typescript-eslint/no-unused-vars": 2,
"no-console": [
"error",
{
"allow": [
"warn",
"error",
"info"
]
"allow": ["warn", "error", "info"]
}
]
}
}
}
14 changes: 6 additions & 8 deletions packages/next/src/fields/table.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { forwardRef, useRef } from 'react'
import React, { forwardRef } from 'react'
import {
registerFormField,
ISchemaFieldComponentProps,
Expand All @@ -12,11 +12,9 @@ import { Table, Form, Icon } from '@alifd/next'
import styled from 'styled-components'
import { CompatNextFormItemProps } from '../compat/FormItem'
import cls from 'classnames'
import {
IDragableRowProps,
IDragableTableProps,
IDragHandlerCellProps
} from '../types'
import { IDragableRowProps, IDragHandlerCellProps } from '../types'

const SelectionRow = (Table as any).SelectionRow

const ArrayComponents = {
Wrapper: Table,
Expand Down Expand Up @@ -76,9 +74,9 @@ const DragableRow = forwardRef(
const [firstCol, ...otherCols] = columns

return (
<Table.SelectionRow
<SelectionRow
{...props}
className={cls(props.className, "drag-item")}
className={cls(props.className, 'drag-item')}
ref={ref}
columns={[
{
Expand Down
7 changes: 1 addition & 6 deletions packages/next/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ButtonProps } from '@alifd/next/types/button'
import { FormProps, ItemProps } from '@alifd/next/types/form'
import { StepProps, ItemProps as StepItemProps } from '@alifd/next/types/step'
import { ColumnProps, TableProps } from '@alifd/next/types/table'
import { ColumnProps } from '@alifd/next/types/table'
import {
ISchemaFormProps,
IMarkupSchemaFieldProps,
Expand All @@ -10,11 +10,6 @@ import {
} from '@uform/react-schema-renderer'
import { PreviewTextConfigProps } from '@uform/react-shared-components'
import { StyledComponent } from 'styled-components'
import {
DragObjectWithType,
ConnectDragSource,
ConnectDragPreview
} from 'react-dnd'

type ColSpanType = number | string

Expand Down
2 changes: 1 addition & 1 deletion packages/react-schema-editor/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const SchemaEditor: React.FC<{
setSelectedPath(path)
}

const handleCodeChange = code => {}
const handleCodeChange = () => {}

const isRoot = selectedPath === 'root'

Expand Down
1 change: 1 addition & 0 deletions packages/shared/src/deprecate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export function deprecate<P1 = any, P2 = any, P3 = any, P4 = any, P5 = any>(
help?: string
) {
if (isFn(method)) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
return function(p1?: P1, p2?: P2, p3?: P3, p4?: P4, p5?: P5) {
deprecate(message, help)
return method.apply(this, arguments)
Expand Down

0 comments on commit 8215d7f

Please sign in to comment.