Skip to content

Commit

Permalink
remove prettier and eslint in favor of biome
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrkulpinski committed Feb 19, 2024
1 parent 6bc0da7 commit 4822aaa
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 164 deletions.
125 changes: 0 additions & 125 deletions .eslintrc.cjs

This file was deleted.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"scripts": {
"build": "bun build ./src/index.ts --outdir ./dist && bun run build:declaration",
"build:declaration": "tsc --emitDeclarationOnly",
"format": "prettier --write \"./**/*.{js,ts,json,md}\"",
"lint": "eslint --ext .js,.jsx,.ts,.tsx . --fix --quiet"
"format": "biome format --write ."
},
"dependencies": {
"@uiw/color-convert": "^2.0.6"
Expand Down
10 changes: 0 additions & 10 deletions prettier.config.js

This file was deleted.

14 changes: 10 additions & 4 deletions src/helpers/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const range = (start: number, end: number) => {
* @param delay - The amount of time to delay the execution of the function, in milliseconds.
*/
export const sleep = async (delay: number) => {
new Promise((resolve) => setTimeout(resolve, delay))
new Promise(resolve => setTimeout(resolve, delay))
}

/**
Expand Down Expand Up @@ -61,7 +61,13 @@ export const toSlugCase = (string?: string) => {
* Returns a label for the first search key shortcut found.
* @returns The label for the shortcut.
*/
export const getShortcutLabel = ({ key, metaKey }: { key: string; metaKey?: boolean }) => {
export const getShortcutLabel = ({
key,
metaKey,
}: {
key: string
metaKey?: boolean
}) => {
const label = `${metaKey ? "⌘" : ""}${key.toUpperCase()}`
return label
}
Expand Down Expand Up @@ -139,7 +145,7 @@ export const getInitials = (value?: string | null, limit = 0) => {
}

const values = val.split(" ").filter(isTruthy)
const initials = values.map((name) => name.charAt(0).toUpperCase()).join("")
const initials = values.map(name => name.charAt(0).toUpperCase()).join("")

if (limit > 0) {
return initials.slice(0, limit)
Expand All @@ -158,6 +164,6 @@ export const toBase64 = (file: File): Promise<string> => {
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = () => resolve(reader.result as string)
reader.onerror = (error) => reject(error)
reader.onerror = error => reject(error)
})
}
46 changes: 23 additions & 23 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */

/* Language and Environment */
"target": "esnext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"target": "esnext" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "react-jsx", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
Expand All @@ -25,9 +25,9 @@
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */

/* Modules */
"module": "ESNext", /* Specify what module code is generated. */
"rootDir": "src", /* Specify the root folder within your source files. */
"moduleResolution": "Node", /* Specify how TypeScript looks up a file from a given module specifier. */
"module": "ESNext" /* Specify what module code is generated. */,
"rootDir": "src" /* Specify the root folder within your source files. */,
"moduleResolution": "Node" /* Specify how TypeScript looks up a file from a given module specifier. */,
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
Expand All @@ -44,18 +44,18 @@
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */

/* JavaScript Support */
"allowJs": false, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
"allowJs": false /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */,
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
"maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
"maxNodeModuleJsDepth": 1 /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */,

/* Emit */
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
"declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
"emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
"emitDeclarationOnly": true /* Only output d.ts files and not JavaScript files. */,
"sourceMap": true /* Create source map files for emitted JavaScript files. */,
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
"outFile": "dist/index.d.ts", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
"outDir": "dist", /* Specify an output folder for all emitted files. */
"outFile": "dist/index.d.ts" /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */,
"outDir": "dist" /* Specify an output folder for all emitted files. */,
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
Expand All @@ -76,13 +76,13 @@
/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
"allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
"allowSyntheticDefaultImports": true /* Allow 'import x from y' when a module doesn't have a default export. */,
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,

/* Type Checking */
"strict": true, /* Enable all strict type-checking options. */
"strict": true /* Enable all strict type-checking options. */,
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
Expand All @@ -91,22 +91,22 @@
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
"noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
"noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
"noUnusedLocals": true /* Enable error reporting when local variables aren't read. */,
"noUnusedParameters": true /* Raise an error when a function parameter isn't read. */,
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
"noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
"noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
"noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
"noImplicitReturns": true /* Enable error reporting for codepaths that do not explicitly return in a function. */,
"noFallthroughCasesInSwitch": true /* Enable error reporting for fallthrough cases in switch statements. */,
"noUncheckedIndexedAccess": true /* Add 'undefined' to a type when accessed using an index. */,
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
"allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
"allowUnreachableCode": true /* Disable error reporting for unreachable code. */,

/* Completeness */
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */

"types": ["bun-types"] /* Add Bun global */
"types": ["bun-types"] /* Add Bun global */
},

"include": ["src"],
Expand Down

0 comments on commit 4822aaa

Please sign in to comment.