Skip to content

Commit

Permalink
refactor: fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
gao-sun committed Dec 23, 2022
1 parent edaafd4 commit 5ca0d2d
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 70 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"lib"
],
"scripts": {
"build": "rm -rf lib/ && tsc",
"build": "rm -rf lib/ && tsc -p tsconfig.build.json",
"build:test": "rm -rf lib/ && tsc -p tsconfig.test.json",
"prepack": "pnpm test && pnpm build",
"lint": "eslint --ext .ts src",
Expand All @@ -27,7 +27,7 @@
"@silverhand/ts-config": "1.2.1",
"@types/jest": "^29.2.4",
"@types/node": "^16.9.1",
"eslint": "^8.22.0",
"eslint": "^8.30.0",
"expect-type": "^0.14.0",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
Expand Down
120 changes: 59 additions & 61 deletions pnpm-lock.yaml

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

4 changes: 2 additions & 2 deletions src/utilities/assertions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Truthy } from './types.js';
import type { Truthy } from './types.js';

// eslint-disable-next-line id-length, complexity
// eslint-disable-next-line id-length
const compareFunction = <T extends string | boolean | number>(a: T, b: T) => {
if (typeof a === 'string' && typeof b === 'string') {
return a.localeCompare(b);
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/conditional.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { notFalsy } from './assertions.js';
import { Nullable, Optional, Truthy } from './types.js';
import type { Nullable, Optional, Truthy } from './types.js';

export const nullable = <T>(exp: T): Nullable<Truthy<T>> => (notFalsy(exp) ? exp : null);

Expand Down
2 changes: 1 addition & 1 deletion src/utilities/pick.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Picked, PlainObject } from './types.js';
import type { Picked, PlainObject } from './types.js';

export const pick = <T, Keys extends Array<keyof T>>(
object: T,
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/types.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expectTypeOf } from 'expect-type';

import { KeysToCamelCase } from './types.js';
import type { KeysToCamelCase } from './types.js';

describe('Check type conversion', () => {
test('Snake case to camel case key mapping conversion', () => {
Expand Down
4 changes: 4 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig",
"exclude": ["src/**/*.test.ts"]
}
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
},
"include": [
"src"
],
"exclude": ["src/**/*.test.ts"],
]
}

0 comments on commit 5ca0d2d

Please sign in to comment.