Summary
Integrate @fedify/lint into projects generated by fedify init command, so developers can catch common Fedify mistakes at development time rather than runtime.
Background
The @fedify/lint package was recently added in #494 (closes #287). It provides lint rules that detect:
- Missing actor properties (id, inbox, outbox, followers, etc.)
- Incorrect Context method usage (e.g., using
new URL() instead of ctx.getActorUri())
- Missing collection filtering implementation
Currently, fedify init does not include this package, so new projects miss out on these helpful validations.
Proposed Changes
Deno Projects
Add @fedify/lint as a Deno Lint plugin in deno.json:
{
"lint": {
"plugins": ["jsr:@fedify/lint"]
}
}
Node.js/Bun Projects
-
Add ESLint with @fedify/lint:
Create eslint.config.js:
import fedifyLint from "@fedify/lint";
export default fedifyLint;
-
Add devDependencies:
{
"devDependencies": {
"eslint": "^9.0.0",
"@fedify/lint": "^2.0.0"
}
}
-
Keep Biome as formatter only:
Update biome.json:
{
"linter": { "enabled": false },
"formatter": { "enabled": true }
}
-
Add lint script to package.json:
{
"scripts": {
"lint": "eslint ."
}
}
-
Update VS Code extensions:
Add ESLint extension recommendation in .vscode/extensions.json:
{
"recommendations": [
"dbaeumer.vscode-eslint"
]
}
Implementation Checklist
Related
Summary
Integrate
@fedify/lintinto projects generated byfedify initcommand, so developers can catch common Fedify mistakes at development time rather than runtime.Background
The
@fedify/lintpackage was recently added in #494 (closes #287). It provides lint rules that detect:new URL()instead ofctx.getActorUri())Currently,
fedify initdoes not include this package, so new projects miss out on these helpful validations.Proposed Changes
Deno Projects
Add
@fedify/lintas a Deno Lint plugin in deno.json:{ "lint": { "plugins": ["jsr:@fedify/lint"] } }Node.js/Bun Projects
Add ESLint with
@fedify/lint:Create eslint.config.js:
Add devDependencies:
{ "devDependencies": { "eslint": "^9.0.0", "@fedify/lint": "^2.0.0" } }Keep Biome as formatter only:
Update biome.json:
{ "linter": { "enabled": false }, "formatter": { "enabled": true } }Add lint script to package.json:
{ "scripts": { "lint": "eslint ." } }Update VS Code extensions:
Add ESLint extension recommendation in .vscode/extensions.json:
{ "recommendations": [ "dbaeumer.vscode-eslint" ] }Implementation Checklist
getDevDependencies()in packages/cli/src/init/action/deps.tsgetJsons()in packages/cli/src/init/action/patch.tslintscript to package.json templateRelated
@fedify/lint)