Skip to content

Commit

Permalink
fix: lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
schummar committed Sep 6, 2022
1 parent 0295729 commit 6dc39a9
Show file tree
Hide file tree
Showing 7 changed files with 288 additions and 17 deletions.
276 changes: 276 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@
"license": "ISC",
"scripts": {
"start": "npm -w docs start",
"build": "runp build:clean :p build:compile:* :s build:cjsPackage",
"build": "npm-run-all build:clean -p build:compile:* -s build:cjsPackage",
"build:clean": "rimraf \"dist/**/*\"",
"build:compile:js": "vite build",
"build:compile:types": "tsc",
"build:cjsPackage": "echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
"lint": "runp lint:*",
"lint": "run-p lint:*",
"lint:eslint": "eslint src",
"lint:tsc": "tsc --emitDeclarationOnly false --noEmit",
"prepublishOnly": "runp :s lint build",
"prepublishOnly": "run-s lint build",
"docs:build": "npm -w docs run build"
},
"dependencies": {
Expand Down Expand Up @@ -93,6 +93,7 @@
"@vitejs/plugin-react": "2.0.1",
"eslint": "8.23.0",
"eslint-plugin-storybook": "0.6.4",
"npm-run-all": "^4.1.5",
"prettier": "2.7.1",
"react": "18.2.0",
"react-dom": "18.2.0",
Expand Down
6 changes: 0 additions & 6 deletions src/components/columnFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ export function ColumnFooter() {
const content = table.useState((state) => {
const column = state.activeColumns.find((column) => column.id === columnId);

if (column?.footer instanceof Function) {
const items = state.activeItems;
const values = items.map((item) => column?.value(item.value));
return column?.footer(values, items);
}

return column?.footer;
});

Expand Down
2 changes: 0 additions & 2 deletions src/components/sortComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ export function SortComponent<T>({ children }: { children: ReactNode }): JSX.Ele
const index = state.sort.findIndex((s) => s.columnId === columnId) ?? -1;
const column = state.activeColumns.find((column) => column.id === columnId);

console.log(column, state);

return {
direction: state.sort[index]?.direction,
index: index >= 0 && state.sort.length > 1 ? index + 1 : undefined,
Expand Down
2 changes: 1 addition & 1 deletion src/components/virtualized.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function Virtualized<T>({
header: ReactNode;
footer: ReactNode;
children: (itemIds: Id[], startIndex: number) => ReactNode;
} & HTMLProps<HTMLDivElement>): JSX.Element {
} & Omit<HTMLProps<HTMLDivElement>, 'children'>): JSX.Element {
const table = useTableContext<T>();
const virtual = table.useState('props.virtual');
const probeRef = useRef<HTMLDivElement>(null);
Expand Down
4 changes: 2 additions & 2 deletions src/internalState/calcProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export function calcProps<T>(props: TableProps<T>): InternalTableProps<T> {

return {
id,
header: header instanceof Function ? cache(`columns.${cacheKey}.header`, header) : header,
footer: footer instanceof Function ? cache(`columns.${cacheKey}.footer`, footer) : footer,
header,
footer,
value: cache(`columns.${cacheKey}.value`, value),
renderCell: cache(`columns.${cacheKey}.renderCell`, renderCell),
exportCell,
Expand Down
Loading

0 comments on commit 6dc39a9

Please sign in to comment.