-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move to Biome #28
Merged
Merged
Move to Biome #28
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json", | ||
"extends": ["./node_modules/@lokalise/biome-config/configs/biome-base.jsonc"], | ||
"linter": { | ||
"rules": { | ||
"performance": { | ||
"noBarrelFile": "off", | ||
"noReExportAll": "off" | ||
}, | ||
"style": { | ||
"noUnusedTemplateLiteral": "off" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,63 @@ | ||
{ | ||
"name": "@lokalise/frontend-http-client", | ||
"version": "2.1.0", | ||
"description": "Opinionated HTTP client for the frontend", | ||
"files": [ | ||
"dist/**", | ||
"LICENSE", | ||
"README.md" | ||
], | ||
"main": "./dist/index.cjs", | ||
"types": "./dist/index.d.ts", | ||
"module": "./dist/index.mjs", | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"import": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.mjs" | ||
}, | ||
"require": { | ||
"types": "./dist/index.d.cts", | ||
"default": "./dist/index.cjs" | ||
} | ||
} | ||
}, | ||
"author": { | ||
"name": "Lokalise", | ||
"url": "https://lokalise.com/" | ||
}, | ||
"homepage": "https://github.com/lokalise/frontend-http-client", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/lokalise/frontend-http-client.git" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"build:dev": "tsc", | ||
"build:release": "tsup", | ||
"clean": "rimraf dist .eslintcache", | ||
"lint": "eslint --cache --max-warnings=0 . && prettier --check src \"**/*.{json,md,ts,tsx}\" && tsc --noEmit", | ||
"lint:fix": "prettier --write src \"**/*.{json,md,ts,tsx}\" --log-level=warn && eslint . --fix", | ||
"test": "vitest run --coverage", | ||
"prepublishOnly": "npm run clean && npm run build:release" | ||
}, | ||
"dependencies": { | ||
"fast-querystring": "^1.1.2" | ||
}, | ||
"peerDependencies": { | ||
"wretch": "^2.8.0", | ||
"zod": "^3.22.0" | ||
}, | ||
"devDependencies": { | ||
"@lokalise/prettier-config": "^1.0.0", | ||
"@types/node": "^20.11.5", | ||
"@typescript-eslint/eslint-plugin": "^7.0.1", | ||
"@typescript-eslint/parser": "^7.0.1", | ||
"@vitest/coverage-v8": "^2.0.1", | ||
"jest-fail-on-console": "^3.1.2", | ||
"eslint": "^8.56.0", | ||
"eslint-plugin-import": "^2.29.1", | ||
"eslint-plugin-vitest": "^0.4.0", | ||
"eslint-plugin-import-esm": "^2.0.0", | ||
"mockttp": "^3.10.1", | ||
"prettier": "^3.2.5", | ||
"rimraf": "^5.0.5", | ||
"tsup": "8.1.0", | ||
"typescript": "~5.5.3", | ||
"vitest": "^2.0.1" | ||
}, | ||
"keywords": [ | ||
"frontend", | ||
"web", | ||
"browser", | ||
"http", | ||
"client", | ||
"zod", | ||
"validation", | ||
"typesafe" | ||
], | ||
"prettier": "@lokalise/prettier-config" | ||
"name": "@lokalise/frontend-http-client", | ||
"version": "2.1.0", | ||
"description": "Opinionated HTTP client for the frontend", | ||
"files": ["dist/**", "LICENSE", "README.md"], | ||
"main": "./dist/index.cjs", | ||
"types": "./dist/index.d.ts", | ||
"module": "./dist/index.mjs", | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"import": { | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.mjs" | ||
}, | ||
"require": { | ||
"types": "./dist/index.d.cts", | ||
"default": "./dist/index.cjs" | ||
} | ||
} | ||
}, | ||
"author": { | ||
"name": "Lokalise", | ||
"url": "https://lokalise.com/" | ||
}, | ||
"homepage": "https://github.com/lokalise/frontend-http-client", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/lokalise/frontend-http-client.git" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"build:dev": "tsc", | ||
"build:release": "tsup", | ||
"clean": "rimraf dist", | ||
"lint": "biome check . && tsc --project tsconfig.lint.json --noEmit", | ||
"lint:fix": "biome check --write", | ||
"test": "vitest run --coverage", | ||
"prepublishOnly": "npm run clean && npm run build:release" | ||
}, | ||
"dependencies": { | ||
"fast-querystring": "^1.1.2" | ||
}, | ||
"peerDependencies": { | ||
"wretch": "^2.8.0", | ||
"zod": "^3.22.0" | ||
}, | ||
"devDependencies": { | ||
"@biomejs/biome": "^1.8.3", | ||
"@lokalise/biome-config": "^1.0.0", | ||
"@types/node": "^20.11.5", | ||
"@vitest/coverage-v8": "^2.0.1", | ||
"jest-fail-on-console": "^3.1.2", | ||
"mockttp": "^3.13.0", | ||
"rimraf": "^5.0.8", | ||
"tsup": "8.1.0", | ||
"typescript": "~5.5.3", | ||
"vitest": "^2.0.1" | ||
}, | ||
"keywords": ["frontend", "web", "browser", "http", "client", "zod", "validation", "typesafe"] | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟢 Shouldn't this be "on"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That rule is mostly useful for applications or larger libraries with plenty of optional imports. What would be the benefit of having indirect export structure in a library with just a few exports?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would simply aim for consistency, and never use barrel files (no matter the size of the project). Or are there any scenarios where we still want to use them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that if you don't have a barrel file in a library, you can no longer have imports like
import { Client, RequestError, EMPTY_SCHEMA } from 'my-library'
unless they all come from the same file. For me this also brings worse DX, or clutters code structure of the library.
So for libraries where tree-shaking is not important I'd still go with barrel files. maybe we need separate biome preset for them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. We need to find the right balance with this.