Skip to content

Commit 1cef16c

Browse files
authored
Merge pull request #149 from vue-pivottable/fix/eslint-and-style-format
chore: modify lint and format rule
2 parents 5e1d50c + d986bfc commit 1cef16c

File tree

8 files changed

+19
-29
lines changed

8 files changed

+19
-29
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ dist-ssr
2525
*.sw?
2626

2727
# vscode
28-
.history
28+
.history
29+
reference

eslint.config.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,11 @@ export default defineConfig([
1717
{
1818
files: ['**/*.{js,mjs,cjs,vue,ts}', 'eslint.config.js'],
1919
extends: [
20-
...standardjs.configs.recommended,
20+
...standardjs.configs.base,
2121
...tseslint.configs.recommended,
2222
...pluginVue.configs['flat/strongly-recommended']
2323
],
2424
rules: {
25-
'@stylistic/space-before-function-paren': [
26-
'error',
27-
{
28-
anonymous: 'always',
29-
named: 'never',
30-
asyncArrow: 'always'
31-
}
32-
],
33-
'@stylistic/quote-props': ['error', 'consistent'],
3425
'vue/html-self-closing': [
3526
'error',
3627
{

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const sorters = ref({
111111
112112
const vals = ref(['Tip'])
113113
const rendererName = ref('Table')
114-
const onDataParsed = (data) => {
114+
const onDataParsed = () => {
115115
rows.value = []
116116
cols.value = []
117117
vals.value = []

src/components/pivottable-ui/VAggregatorCell.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ const numValsAllowed = computed(
107107
const currentRowSortIcon = computed(() => sortIcons[props.rowOrder].rowSymbol)
108108
const currentColSortIcon = computed(() => sortIcons[props.colOrder].colSymbol)
109109
const updateAggregatorName = (value) => emit('update:aggregatorName', value)
110-
const updateRowOrder = (value) =>
110+
const updateRowOrder = () =>
111111
emit('update:rowOrder', sortIcons[props.rowOrder].next)
112-
const updateColOrder = (value) =>
112+
const updateColOrder = () =>
113113
emit('update:colOrder', sortIcons[props.colOrder].next)
114114
const updateVals = (val, i) => {
115115
const newVals = [...props.vals]

src/composables/usePivotUiState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type PivotUiState = {
77
openStatus: Record<string, boolean>
88
}
99

10-
export function usePivotUiState() {
10+
export function usePivotUiState () {
1111
const pivotUiState = reactive<PivotUiState>({
1212
unusedOrder: [],
1313
zIndices: {},

src/composables/useProvideFilterbox.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface ProvideFilterBoxProps {
1010
[key: string]: any
1111
}
1212

13-
export function provideFilterBox(props: ProvideFilterBoxProps) {
13+
export function provideFilterBox (props: ProvideFilterBoxProps) {
1414
const localeStrings = computed(
1515
() => props.languagePack[props.locale].localeStrings
1616
)
@@ -24,6 +24,6 @@ export function provideFilterBox(props: ProvideFilterBoxProps) {
2424
})
2525
}
2626

27-
export function useProvideFilterBox() {
27+
export function useProvideFilterBox () {
2828
return inject(filterBoxKey)
2929
}

src/helper/utilities.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ interface AggregatorInstance {
3838
format?: Formatter | ((x: any) => string);
3939
numInputs?: number;
4040
}
41+
interface PivotDataContext {
42+
getAggregator: (rowKey: any[], colKey: any[]) => AggregatorInstance;
43+
}
4144
type AggregatorFunction = (data?: PivotDataContext, rowKey?: any[], colKey?: any[]) => AggregatorInstance;
4245
type AggregatorTemplate = (...args: any[]) => AggregatorFunction;
4346
interface AggregatorTemplates {
@@ -73,9 +76,6 @@ interface PivotDataProps {
7376
colOrder?: 'key_a_to_z' | 'key_z_to_a' | 'value_a_to_z' | 'value_z_to_a';
7477
derivedAttributes?: Record<string, (record: DataRecord) => RecordValue>;
7578
}
76-
interface PivotDataContext {
77-
getAggregator: (rowKey: any[], colKey: any[]) => AggregatorInstance;
78-
}
7979
interface LocaleStrings {
8080
renderError: string;
8181
computeError: string;

src/helper/utilities.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ interface AggregatorInstance {
4141
format?: Formatter | ((x: any) => string)
4242
numInputs?: number
4343
}
44-
44+
interface PivotDataContext {
45+
getAggregator: (rowKey: any[], colKey: any[]) => AggregatorInstance
46+
}
4547
type AggregatorFunction = (data?: PivotDataContext, rowKey?: any[], colKey?: any[]) => AggregatorInstance
4648
type AggregatorTemplate = (...args: any[]) => AggregatorFunction
4749

@@ -81,10 +83,6 @@ interface PivotDataProps {
8183
derivedAttributes?: Record<string, (record: DataRecord) => RecordValue>
8284
}
8385

84-
interface PivotDataContext {
85-
getAggregator: (rowKey: any[], colKey: any[]) => AggregatorInstance
86-
}
87-
8886
// ==================== Locale 관련 타입 ====================
8987
interface LocaleStrings {
9088
renderError: string
@@ -209,8 +207,8 @@ const naturalSort: SortFunction = (as: any, bs: any): number => {
209207
}
210208

211209
// finally, "smart" string sorting
212-
let a = String(as)
213-
let b = String(bs)
210+
const a = String(as)
211+
const b = String(bs)
214212
if (a === b) {
215213
return 0
216214
}
@@ -353,7 +351,7 @@ const aggregatorTemplates: AggregatorTemplates = {
353351
),
354352
push (record: DataRecord) {
355353
const raw = record?.[attr]
356-
let x = raw
354+
const x = raw
357355
if (['min', 'max'].includes(mode)) {
358356
const numX = x != null ? parseFloat(String(x)) : NaN
359357
if (!isNaN(numX)) {
@@ -1000,4 +998,4 @@ export {
1000998
getSort,
1001999
sortAs,
10021000
PivotData
1003-
}
1001+
}

0 commit comments

Comments
 (0)