Skip to content

Commit

Permalink
chore: fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
crimx committed Oct 13, 2023
1 parent 4f55f5b commit eec5f7b
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ 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",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
ignoreRestSiblings: true,
},
Expand Down
13 changes: 10 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"
Expand All @@ -47,5 +52,7 @@
"[yaml]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
},
"conventionalCommits.gitmoji": false,
"conventionalCommits.promptFooter": false
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion scripts/gzip.mjs
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
4 changes: 3 additions & 1 deletion src/option.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 3 additions & 1 deletion src/result.ts
Original file line number Diff line number Diff line change
@@ -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, Default = T> = T extends Result<infer U> ? U : Default;
export type UnwrapErr<E, Default = E> = E extends Result<infer _S, infer U>
Expand Down

0 comments on commit eec5f7b

Please sign in to comment.