Skip to content

Commit 8adac30

Browse files
author
xueren.dt
committed
chore(ava): update eslint rule and fix test ts problem
1 parent 30d028b commit 8adac30

8 files changed

Lines changed: 17 additions & 39 deletions

File tree

.eslintrc.js

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -79,33 +79,7 @@ module.exports = {
7979
'@typescript-eslint/no-explicit-any': 0,
8080
'@typescript-eslint/type-annotation-spacing': 0,
8181
'no-await-in-loop': 0,
82-
'import/order': [
83-
2,
84-
{
85-
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type', 'unknown'],
86-
pathGroups: [
87-
{
88-
pattern: 'react',
89-
group: 'external',
90-
position: 'before',
91-
},
92-
{
93-
pattern: '@/**',
94-
group: 'internal',
95-
position: 'before',
96-
},
97-
{
98-
pattern: '*.{less,css}',
99-
patternOptions: { matchBase: true },
100-
group: 'unknown',
101-
position: 'after',
102-
},
103-
],
104-
pathGroupsExcludedImportTypes: ['builtin', 'type'],
105-
warnOnUnassignedImports: true,
106-
'newlines-between': 'always',
107-
},
108-
],
82+
'import/order': 0,
10983
'no-param-reassign': 1,
11084
'no-continue': 1,
11185
'no-bitwise': 1,

__tests__/global.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
declare global {
2+
namespace jest {
3+
interface Matchers<R, _T = {}> {
4+
toBeCloseToArray(expected: number[] | number[][]): R;
5+
toBeCloseToObject(expected: Record<string, any>): R;
6+
}
7+
}
8+
}
9+
10+
export {};

__tests__/unit/extract/mock-extract.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { requestTboxLLM } from '@ava/utils/llm';
2-
import { getExtractPrompt } from '@ava/extract/extract/prompt';
1+
import { getExtractPrompt } from '../../../src/extract/extract/prompt';
2+
import { requestTboxLLM } from '../../../src/utils';
33

44
export const extract = async (value: string) => {
55
const llmAuth = process.env.LLM_AUTH;

__tests__/unit/utils/statictics.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ test.skip('statistics', () => {
9999
expect(valueMap([1, null])).toEqual({ 1: 1, null: 1 });
100100
expect(median([1, 3, 2, 4, 5])).toBe(3);
101101
expect(median([1, 2, 3, 4])).toBe(2.5);
102-
expect(() => quartile([1])).toThrowError('The length of value cannot be less than 3.');
102+
expect(() => quartile([1])).toThrow('The length of value cannot be less than 3.');
103103
expect(quartile([1, 2, 3, 4, 5, 6, 7, 8, 9])).toEqual([2.5, 5, 7.5]);
104104
expect(quartile([1, 2, 3, 4, 5, 6, 7, 8, 9], true)).toEqual([2.5, 5, 7.5]);
105105
expect(quartile([1, 2, 3, 4, 5, 6, 7, 8])).toEqual([2.5, 4.5, 6.5]);

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"scripts": {
2525
"clean": "rimraf lib esm dist",
2626
"build:umd": "father build",
27-
"build:esm": "rimraf esm && tsc --module esnext --target es6 --outDir ./esm --rootDir src -p tsconfig.build.json",
28-
"build:cjs": "rimraf lib && tsc --module commonjs --target es6 --outDir ./lib --rootDir src -p tsconfig.build.json",
27+
"build:esm": "rimraf esm && tsc --module esnext --target es6 --outDir ./esm",
28+
"build:cjs": "rimraf lib && tsc --module commonjs --target es6 --outDir ./lib",
2929
"build": "run-p build:*",
3030
"test": "jest",
3131
"lint-staged": "lint-staged",

src/extract/features/plain.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ import {
2323
unique,
2424
} from '../../utils';
2525
import { COLUMN_TYPE } from '../../types/data';
26-
27-
import type { LevelOfMeasurement } from '../../ckb';
2826
import type {
2927
DateColumnFeature,
3028
ColumnFeature,
3129
ColumnMeta,
3230
NumberColumnFeature,
3331
StringColumnFeature,
32+
LevelOfMeasurement,
3433
} from '../../types/data';
3534

3635
/**

src/types/advisor.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Renderer } from '../bind';
2-
32
import { FieldDataType, Meta } from './data';
43
import { UiConfig } from './render';
54

tsconfig.build.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)