Skip to content

Commit b60001b

Browse files
committed
add unused imports rule
1 parent f5210b8 commit b60001b

File tree

48 files changed

+177
-171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+177
-171
lines changed

eslint.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,23 @@
22

33
// @ts-ignore Needed due to moduleResolution Node vs Bundler
44
import { tanstackConfig } from '@tanstack/config/eslint'
5+
import unusedImports from 'eslint-plugin-unused-imports'
56

67
export default [
78
...tanstackConfig,
89
{
910
name: 'tanstack/temp',
11+
plugins: {
12+
'unused-imports': unusedImports,
13+
},
1014
rules: {
1115
'no-case-declarations': 'off',
1216
'no-shadow': 'off',
1317
'@typescript-eslint/naming-convention': 'off',
1418
'@typescript-eslint/no-empty-function': 'off',
1519
'@typescript-eslint/no-unnecessary-condition': 'warn',
1620
'@typescript-eslint/no-unsafe-function-type': 'off',
21+
'unused-imports/no-unused-imports': 'warn',
1722
},
1823
},
1924
]

examples/angular/column-pinning-sticky/src/app/app.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {
2-
ChangeDetectionStrategy,
32
Component,
43
computed,
54
signal,

examples/angular/filters/src/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class AppComponent {
8686
: this.columnFilters.set(updater)
8787
},
8888
getCoreRowModel: createCoreRowModel(),
89-
getFilteredRowModel: createFilteredRowModel(), //client-side filtering
89+
getFilteredRowModel: createFilteredRowModel(), // client-side filtering
9090
getSortedRowModel: createSortedRowModel(),
9191
getPaginatedRowModel: createPaginatedRowModel(),
9292
getFacetedRowModel: createFacetedRowModel(), // client-side faceting

examples/angular/filters/src/app/table-filter.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CommonModule } from '@angular/common'
2-
import { Component, OnInit, computed, input } from '@angular/core'
2+
import { Component, computed, input } from '@angular/core'
33
import { DebouncedInputDirective } from './debounced-input.directive'
44
import type {
55
CellData,
@@ -10,7 +10,7 @@ import type {
1010
} from '@tanstack/angular-table'
1111

1212
declare module '@tanstack/angular-table' {
13-
//allows us to define custom properties for our columns
13+
// allows us to define custom properties for our columns
1414
interface ColumnMeta<
1515
TFeatures extends TableFeatures,
1616
TFns extends Fns<TFeatures, TFns, TData>,

examples/angular/row-selection-signal/src/app/selection-column.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export class TableHeadSelectionComponent<T> {
2323
// You can define and use the table field, which is defined in HeaderContext.
2424
// Please take note that only signal based input is supported.
2525

26-
//column = input.required<Column<T, unknown>>()
27-
//header = input.required<Header<T, unknown>>()
26+
// column = input.required<Column<T, unknown>>()
27+
// header = input.required<Header<T, unknown>>()
2828
table = input.required<Table<T>>()
2929
}
3030

examples/lit/column-sizing/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const columns: Array<ColumnDef<any, Person>> = [
4141
{
4242
accessorKey: 'rank',
4343
header: 'Rank',
44-
invertSorting: true, //invert the sorting order (golf score-like where smaller is better)
44+
invertSorting: true, // invert the sorting order (golf score-like where smaller is better)
4545
},
4646
{
4747
accessorKey: 'createdAt',

examples/lit/filters/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const columns: Array<ColumnDef<any, Person>> = [
6868
]
6969

7070
declare module '@tanstack/lit-table' {
71-
//allows us to define custom properties for our columns
71+
// allows us to define custom properties for our columns
7272
interface ColumnMeta<
7373
TFeatures extends TableFeatures,
7474
TFns extends Fns<TFeatures, TFns, TData>,
@@ -164,7 +164,7 @@ class LitTableExample extends LitElement {
164164
}
165165
},
166166
getCoreRowModel: createCoreRowModel(),
167-
getFilteredRowModel: createFilteredRowModel(), //client side filtering
167+
getFilteredRowModel: createFilteredRowModel(), // client side filtering
168168
getSortedRowModel: createSortedRowModel(),
169169
getPaginatedRowModel: createPaginatedRowModel(),
170170
debugTable: true,

examples/lit/row-selection/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { customElement, property, state } from 'lit/decorators.js'
1+
import { customElement, state } from 'lit/decorators.js'
22
import { LitElement, html } from 'lit'
33
import { repeat } from 'lit/directives/repeat.js'
44
import {

examples/lit/sorting/src/main.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,30 @@ const columns: Array<ColumnDef<any, Person>> = [
2222
{
2323
accessorKey: 'firstName',
2424
cell: (info) => info.getValue(),
25-
//this column will sort in ascending order by default since it is a string column
25+
// this column will sort in ascending order by default since it is a string column
2626
},
2727
{
2828
accessorFn: (row) => row.lastName,
2929
id: 'lastName',
3030
cell: (info) => info.getValue(),
3131
header: () => html`<span>Last Name</span>`,
32-
sortUndefined: 'last', //force undefined values to the end
33-
sortDescFirst: false, //first sort order will be ascending (nullable values can mess up auto detection of sort order)
32+
sortUndefined: 'last', // force undefined values to the end
33+
sortDescFirst: false, // first sort order will be ascending (nullable values can mess up auto detection of sort order)
3434
},
3535
{
3636
accessorKey: 'age',
3737
header: () => 'Age',
38-
//this column will sort in descending order by default since it is a number column
38+
// this column will sort in descending order by default since it is a number column
3939
},
4040
{
4141
accessorKey: 'visits',
4242
header: () => html`<span>Visits</span>`,
43-
sortUndefined: 'last', //force undefined values to the end
43+
sortUndefined: 'last', // force undefined values to the end
4444
},
4545
{
4646
accessorKey: 'status',
4747
header: 'Status',
48-
sortingFn: sortStatusFn, //use our custom sorting function for this enum column
48+
sortingFn: sortStatusFn, // use our custom sorting function for this enum column
4949
},
5050
{
5151
accessorKey: 'progress',
@@ -55,7 +55,7 @@ const columns: Array<ColumnDef<any, Person>> = [
5555
{
5656
accessorKey: 'rank',
5757
header: 'Rank',
58-
invertSorting: true, //invert the sorting order (golf score-like where smaller is better)
58+
invertSorting: true, // invert the sorting order (golf score-like where smaller is better)
5959
},
6060
{
6161
accessorKey: 'createdAt',

examples/lit/virtualized-rows/src/main.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ class LitTableExample extends LitElement {
9292
class="container"
9393
${ref(this.tableContainerRef)}
9494
style="${styleMap({
95-
overflow: 'auto', //our scrollable table container
96-
position: 'relative', //needed for sticky header
97-
height: '800px', //should be a fixed height
95+
overflow: 'auto', // our scrollable table container
96+
position: 'relative', // needed for sticky header
97+
height: '800px', // should be a fixed height
9898
})}"
9999
>
100100
<table style="display: grid">
@@ -139,8 +139,8 @@ class LitTableExample extends LitElement {
139139
<tbody
140140
style=${styleMap({
141141
display: 'grid',
142-
height: `${virtualizer.getTotalSize()}px`, //tells scrollbar how big the table is
143-
position: 'relative', //needed for absolute positioning of rows
142+
height: `${virtualizer.getTotalSize()}px`, // tells scrollbar how big the table is
143+
position: 'relative', // needed for absolute positioning of rows
144144
})}
145145
>
146146
${repeat(

0 commit comments

Comments
 (0)