Skip to content

Commit

Permalink
Merge pull request #7 from tinyhttp/chore/maintenance-sept2024
Browse files Browse the repository at this point in the history
chore: use biome and vitest, remove everything else
  • Loading branch information
talentlessguy authored Nov 3, 2024
2 parents bb9ddf6 + f48978b commit 546ab1b
Show file tree
Hide file tree
Showing 28 changed files with 2,455 additions and 3,443 deletions.
8 changes: 0 additions & 8 deletions .eslintignore

This file was deleted.

24 changes: 0 additions & 24 deletions .eslintrc

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ jobs:
version: 8
- run: pnpm install
- run: pnpm test:coverage
- run: pnpm test:report
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage.lcov
path-to-lcov: ./coverage/lcov.info
5 changes: 1 addition & 4 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --config commitlint.config.cjs --edit "$1"
npx --no-install commitlint --config commitlint.config.mjs --edit "$1"
6 changes: 2 additions & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm format && pnpm lint && pnpm build && pnpm test
pnpm check
pnpm test
7 changes: 0 additions & 7 deletions .prettierignore

This file was deleted.

7 changes: 0 additions & 7 deletions .prettierrc

This file was deleted.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pnpm i

### Formatting

If you use VS Code, please install Prettier and ESLint plugins for proper linting and code formatting.
If you use VS Code, please install Biome plugin for proper linting and code formatting.

If you use a text editor that doesn't have Prettier integration, you can run `pnpx format:fix"`

Expand Down
48 changes: 48 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.2/schema.json",
"files": {
"ignore": ["node_modules", "dist", "coverage", ".pnpm-store"]
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 120,
"attributePosition": "auto"
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"correctness": {
"noVoidTypeReturn": "off"
},
"style": {
"noParameterAssign": "off",
"noNonNullAssertion": "off"
},
"suspicious": {
"noAssignInExpressions": "off",
"noExplicitAny": "off"
}
}
},
"javascript": {
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "none",
"semicolons": "asNeeded",
"arrowParentheses": "always",
"bracketSpacing": true,
"bracketSameLine": false,
"quoteStyle": "single",
"attributePosition": "auto"
}
}
}
5 changes: 2 additions & 3 deletions commitlint.config.cjs → commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const defaultConfig = require('@commitlint/config-conventional')
import defaultConfig from '@commitlint/config-conventional'

module.exports = {
export default {
extends: ['@commitlint/config-conventional'],
rules: {
...defaultConfig.rules,
Expand Down
68 changes: 24 additions & 44 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,21 @@
"name": "malibu",
"version": "1.0.6",
"description": "Framework-agnostic CSRF middleware",
"keywords": [
"csrf",
"middleware",
"tokens",
"framework agnostic",
"express",
"tinyhttp",
"polka",
"http"
],
"keywords": ["csrf", "middleware", "tokens", "framework agnostic", "express", "tinyhttp", "polka", "http"],
"author": "Reinaldy Rafli <aldy505@proton.me>",
"license": "MIT",
"type": "module",
"types": "./dist/index.d.ts",
"exports": "./dist/index.js",
"files": [
"dist"
],
"files": ["dist"],
"scripts": {
"build": "rollup -c",
"test": "uvu -r tsm tests",
"test:coverage": "c8 --include=src pnpm test",
"test:report": "c8 report --reporter=text-lcov > coverage.lcov",
"lint": "eslint \"./**/*.ts\"",
"format": "prettier --write \"./**/*.ts\"",
"prepare": "husky install"
"build": "tsc",
"test": "vitest run",
"test:coverage": "vitest run --coverage",
"lint": "biome lint .",
"format": "biome format .",
"check": "biome check .",
"prepare": "husky"
},
"repository": {
"type": "git",
Expand All @@ -45,32 +34,23 @@
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"devDependencies": {
"@commitlint/cli": "17.7.2",
"@commitlint/config-conventional": "17.7.0",
"@rollup/plugin-typescript": "11.1.4",
"@tinyhttp/app": "2.0.32",
"@biomejs/biome": "1.9.1",
"@commitlint/cli": "19.5.0",
"@commitlint/config-conventional": "19.5.0",
"@tinyhttp/app": "2.4.0",
"@tinyhttp/cookie-parser": "2.0.6",
"@types/express-session": "1.17.8",
"@types/node": "20.8.0",
"@typescript-eslint/eslint-plugin": "6.7.3",
"@typescript-eslint/parser": "6.7.3",
"c8": "8.0.1",
"eslint": "8.50.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-prettier": "5.0.0",
"express-session": "1.17.3",
"husky": "8.0.3",
"milliparsec": "2.3.0",
"prettier": "3.0.3",
"rollup": "3.29.4",
"supertest-fetch": "1.5.0",
"tslib": "2.6.2",
"tsm": "^2.3.0",
"typescript": "5.2.2",
"uvu": "0.5.6"
"@types/express-session": "1.18.0",
"@types/node": "22.5.5",
"@vitest/coverage-v8": "2.1.1",
"express-session": "1.18.0",
"husky": "9.1.6",
"milliparsec": "4.0.0",
"supertest-fetch": "2.0.0",
"typescript": "5.6.2",
"vitest": "2.1.1"
},
"dependencies": {
"@tinyhttp/cookie": "2.1.0",
"@tinyhttp/cookie-signature": "2.1.0"
"@tinyhttp/cookie": "2.1.1",
"@tinyhttp/cookie-signature": "2.1.1"
}
}
Loading

0 comments on commit 546ab1b

Please sign in to comment.