diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 2518af6..6426fd1 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -14,6 +14,7 @@ const config = { "prettier", ], rules: { + "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/consistent-type-imports": "error", "@typescript-eslint/no-empty-interface": "off", "@typescript-eslint/no-non-null-assertion": "off", @@ -21,6 +22,7 @@ const config = { "error", { argsIgnorePattern: "^_", + varsIgnorePattern: "^_", destructuredArrayIgnorePattern: "^_", ignoreRestSiblings: true, }, diff --git a/.vscode/settings.json b/.vscode/settings.json index edbfb84..d362d42 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,9 +4,10 @@ "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.codeActionsOnSave": { "source.fixAll": true, - "source.addMissingImports": true + "source.addMissingImports": true, + "source.organizeImports": false }, - "eslint.validate": ["javascript", "javascriptreact", "html", "vue", "svelte"], + "eslint.validate": ["javascript", "javascriptreact", "vue", "svelte"], "typescript.tsdk": "node_modules/typescript/lib", "[html]": { "editor.formatOnSave": true, @@ -24,6 +25,10 @@ "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" }, + "[jsonc]": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, "[javascript]": { "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" @@ -47,5 +52,7 @@ "[yaml]": { "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode" - } + }, + "conventionalCommits.gitmoji": false, + "conventionalCommits.promptFooter": false } diff --git a/package.json b/package.json index de67ce0..2ccd965 100644 --- a/package.json +++ b/package.json @@ -13,9 +13,10 @@ ], "scripts": { "prepublishOnly": "pnpm run build", - "lint": "eslint --ext .ts,.tsx . && prettier --check .", "build": "tsup", - "build:min": "cross-env MINIFY=true tsup && node scripts/gzip.mjs" + "build:min": "cross-env MINIFY=true tsup && node scripts/gzip.mjs", + "lint": "eslint --ext .ts,.tsx,.js,.mjs . && prettier --check . && cspell --no-progress --show-context --dot --show-suggestions '**/*.{md,ts,tsx,cjs,mjs,js,vue,svelte,scss,css,less,json,yml,yaml,toml,html,sh,go,rs}'", + "lint:fix": "eslint --ext .ts,.tsx,.js,.mjs . --fix && prettier -w ." }, "keywords": [ "typescript", diff --git a/scripts/gzip.mjs b/scripts/gzip.mjs index f178db3..a77bca3 100644 --- a/scripts/gzip.mjs +++ b/scripts/gzip.mjs @@ -1,6 +1,6 @@ import { gzipSizeFromFileSync } from "gzip-size"; -import { green, gray } from "yoctocolors"; import prettyBytes from "pretty-bytes"; +import { green, gray } from "yoctocolors"; console.log(); console.log( diff --git a/src/option.ts b/src/option.ts index 4d9935e..46812f9 100644 --- a/src/option.ts +++ b/src/option.ts @@ -1,4 +1,6 @@ -import { Result, UnwrapErr, UnwrapOk } from "./result"; +import type { UnwrapErr, UnwrapOk } from "./result"; + +import { Result } from "./result"; import { ANY, OPTION } from "./utils"; type Falsy = false | 0 | 0n | "" | null | undefined; diff --git a/src/result.ts b/src/result.ts index 749917c..52d85a5 100644 --- a/src/result.ts +++ b/src/result.ts @@ -1,5 +1,7 @@ +import type { UnwrapOption } from "./option"; + +import { Option } from "./option"; import { ANY, RESULT } from "./utils"; -import { Option, UnwrapOption } from "./option"; export type UnwrapOk = T extends Result ? U : Default; export type UnwrapErr = E extends Result