Skip to content

Commit

Permalink
setup biome and apply it
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeBu committed Jul 7, 2024
1 parent 15b5052 commit c751271
Show file tree
Hide file tree
Showing 20 changed files with 497 additions and 873 deletions.
22 changes: 8 additions & 14 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
module.exports = {
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],
"rules": {
"no-extra-boolean-cast": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
},
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
rules: {
"no-extra-boolean-cast": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
},
};
20 changes: 10 additions & 10 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"printWidth": 90,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": false,
"quoteProps": "preserve",
"trailingComma": "all",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always"
"printWidth": 90,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": false,
"quoteProps": "preserve",
"trailingComma": "all",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always"
}
39 changes: 39 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"organizeImports": { "enabled": true },
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"performance": {
"noAccumulatingSpread": "off"
},
"suspicious": {
"noConfusingVoidType": "off",
"noExplicitAny": "off",
"noConsoleLog": "error"
},
"complexity": {
"noForEach": "off"
},
"correctness": {
"noUnusedVariables": "error",
"useExhaustiveDependencies": "warn"
},
"security": {
"noDangerouslySetInnerHtml": "off"
}
},
"ignore": ["node_modules"]
},
"formatter": {
"lineWidth": 90,
"enabled": true,
"indentWidth": 2,
"indentStyle": "space",
"ignore": ["node_modules"]
},
"files": {
"ignoreUnknown": true
}
}
15 changes: 15 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
pre-commit:
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: pnpm check:cmd --write {staged_files}
stage_fixed: true

pre-push:
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: pnpm check:cmd {push_files}
test:
run: pnpm test

127 changes: 54 additions & 73 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,56 @@
{
"name": "easy-lucia",
"version": "0.0.1",
"description": "#{DESC}#",
"repository": {
"type": "git",
"url": "git://github.com/JeromeBu/easy-lucia.git"
},
"scripts": {
"typecheck": "tsc --noEmit",
"build": "pnpm build:cjs && pnpm build:esm",
"build:cjs": "tsc",
"build:esm": "rm -rf dist/esm && tsc -p tsconfig.esm.json",
"test": "vitest",
"lint:check": "eslint . --ext .ts,.tsx",
"lint": "npm run lint:check -- --fix",
"_format": "prettier '**/*.{ts,tsx,json,md}'",
"format": "npm run _format -- --write",
"format:check": "npm run _format -- --list-different",
"link-in-app": "tsx scripts/link-in-app.ts"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": "./dist/index.js",
"./*": "./dist/*.js",
"./tools": "./dist/tools/index.js"
},
"lint-staged": {
"*.{ts,tsx}": [
"eslint --fix"
],
"*.{ts,tsx,json,md}": [
"prettier --write"
]
},
"husky": {
"hooks": {
"pre-commit": "false && lint-staged -v"
}
},
"author": "u/JeromeBu",
"license": "MIT",
"files": [
"src/",
"dist/",
"!dist/tsconfig.tsbuildinfo"
],
"keywords": [],
"homepage": "https://github.com/JeromeBu/easy-lucia",
"devDependencies": {
"@types/node": "^20.2.1",
"@types/pg": "^8.11.6",
"@types/react": "^18.3.3",
"@typescript-eslint/eslint-plugin": "^5.59.6",
"@typescript-eslint/parser": "^5.59.6",
"eslint": "^8.41.0",
"eslint-config-prettier": "^8.8.0",
"husky": "^4.3.8",
"lint-staged": "^11.1.1",
"prettier": "^3.3.2",
"react": "^18.3.1",
"tsx": "^4.15.5",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@lucia-auth/adapter-postgresql": "^3.1.2",
"lucia": "^3.2.0",
"oslo": "^1.2.1"
}
"name": "easy-lucia",
"version": "0.0.1",
"description": "Lucia auth usecases implemented",
"repository": {
"type": "git",
"url": "git://github.com/JeromeBu/easy-lucia.git"
},
"scripts": {
"typecheck": "tsc --noEmit",
"build": "pnpm build:cjs && pnpm build:esm",
"build:cjs": "tsc",
"build:esm": "rm -rf dist/esm && tsc -p tsconfig.esm.json",
"test": "vitest",
"check:cmd": "biome check --no-errors-on-unmatched",
"check:fix": "pnpm check:cmd --write .",
"check": "pnpm check:cmd .",
"link-in-app": "tsx scripts/link-in-app.ts"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": "./dist/index.js",
"./*": "./dist/*.js",
"./tools": "./dist/tools/index.js"
},
"author": "u/JeromeBu",
"license": "MIT",
"files": ["src/", "dist/", "!dist/tsconfig.tsbuildinfo"],
"keywords": [],
"homepage": "https://github.com/JeromeBu/easy-lucia",
"devDependencies": {
"@biomejs/biome": "1.8.3",
"@types/node": "^20.2.1",
"@types/pg": "^8.11.6",
"@types/react": "^18.3.3",
"@typescript-eslint/eslint-plugin": "^5.59.6",
"@typescript-eslint/parser": "^5.59.6",
"eslint": "^8.41.0",
"eslint-config-prettier": "^8.8.0",
"lefthook": "^1.6.18",
"prettier": "^3.3.2",
"react": "^18.3.1",
"tsx": "^4.15.5",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@lucia-auth/adapter-postgresql": "^3.1.2",
"lucia": "^3.2.0",
"oslo": "^1.2.1"
}
}
Loading

0 comments on commit c751271

Please sign in to comment.