Skip to content

Commit

Permalink
chore: fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
ASafaeirad committed Apr 13, 2024
1 parent 445c0eb commit da8e0cc
Show file tree
Hide file tree
Showing 8 changed files with 3,164 additions and 4,420 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const { init } = require('@fullstacksjs/eslint-config/init');
module.exports = init({
root: true,
modules: {
auto: true,
test: true,
typescript: {
parserProject: './tsconfig.eslint.json',
Expand Down
1 change: 1 addition & 0 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// eslint-disable-next-line import/extensions
export * from './src/index.ts';
7,529 changes: 3,135 additions & 4,394 deletions package-lock.json

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"build": "tsup --dts-only && tsup --config tsup.browser.ts && tsup --tsconfig tsconfig.build.json && ./postbuild",
"type-check": "tsc --emitDeclarationOnly false --noEmit",
"lint": "npm run lint:ci -- --fix",
"lint:ci": "eslint . --ext .js,.ts,.tsx",
"lint:ci": "eslint . --ext .js,.ts",
"test": "vitest --run",
"test:ci": "CI=true vitest --allowOnly",
"test:watch": "vitest",
Expand All @@ -49,33 +49,33 @@
"prepare": ".husky/prepare"
},
"devDependencies": {
"@commitlint/cli": "18.2.0",
"@commitlint/config-conventional": "18.1.0",
"@commitlint/cli": "18.4.3",
"@commitlint/config-conventional": "18.4.3",
"@frontendmonster/builder": "2.2.0",
"@fullstacksjs/eslint-config": "10.4.0",
"@fullstacksjs/toolbox": "4.6.1",
"@fullstacksjs/eslint-config": "10.8.0",
"@fullstacksjs/toolbox": "4.7.0",
"@fullstacksjs/tsconfig": "1.1.0",
"@semantic-release/github": "9.2.1",
"@semantic-release/npm": "11.0.0",
"@semantic-release/release-notes-generator": "12.0.0",
"@types/node": "20.8.9",
"@vitest/coverage-v8": "0.34.6",
"@semantic-release/github": "9.2.6",
"@semantic-release/npm": "11.0.2",
"@semantic-release/release-notes-generator": "12.1.0",
"@types/node": "20.10.5",
"@vitest/coverage-v8": "1.1.0",
"commitizen": "4.3.0",
"cspell": "7.3.8",
"cspell": "8.2.3",
"cz-conventional-changelog": "3.3.0",
"eslint": "8.52.0",
"eslint": "8.56.0",
"husky": "8.0.3",
"lint-staged": "15.0.2",
"lint-staged": "15.2.0",
"npm-run-all": "4.1.5",
"pinst": "3.0.0",
"pkg-ok": "3.0.0",
"prettier": "3.0.3",
"semantic-release": "22.0.5",
"prettier": "3.1.1",
"semantic-release": "22.0.12",
"shx": "0.3.4",
"standard-version": "9.5.0",
"tsup": "7.2.0",
"typescript": "5.2.2",
"vitest": "0.34.6"
"tsup": "8.0.1",
"typescript": "5.3.3",
"vitest": "1.1.0"
},
"config": {
"commitizen": {
Expand Down
4 changes: 2 additions & 2 deletions src/InferType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ export type InferType<T extends Record<string, Schema>> = {
[K in keyof T]: T[K] extends Schema<object>
? Prettify<InferType<T[K]['value']>>
: T[K]['isRequired'] extends true
? NonNullable<T[K]['value']>
: T[K]['value'];
? NonNullable<T[K]['value']>
: T[K]['value'];
};
4 changes: 2 additions & 2 deletions src/Schema/ObjectSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Schema } from './Schema';
class ObjectGuard implements Guard<Record<string, Schema>> {
constructor(private schema: Record<string, Schema>) {}

validate(input: Record<string, unknown>, key: string) {
validate(input: Record<string, unknown> | undefined, key: string) {
if (!input) return;

Object.entries(this.schema).forEach(([subKey, schema]) => {
Expand All @@ -19,7 +19,7 @@ class ObjectGuard implements Guard<Record<string, Schema>> {
export class ObjectSchema<TInput = any> extends Schema<TInput, TInput> {
constructor(schema: Record<string, Schema>) {
super({
typeConstructor: x => x as TInput,
typeConstructor: x => x,
type: 'object',
});
this.require();
Expand Down
3 changes: 2 additions & 1 deletion src/Schema/Schema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { GuardError, type Guard } from '../Guard';
import type { Guard } from '../Guard';
import { GuardError } from '../Guard';

export class RequiredGuard implements Guard<string> {
validate(input: unknown, field: string) {
Expand Down
6 changes: 3 additions & 3 deletions src/Schema/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from './StringSchema';
export * from './NumberSchema';
export * from './BooleanSchema';
export type { SchemaOptions } from './SchemaOptions';
export * from './NumberSchema';
export type { Schema } from './Schema';
export type { SchemaOptions } from './SchemaOptions';
export * from './StringSchema';

0 comments on commit da8e0cc

Please sign in to comment.