Skip to content
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

feat: add fresh lint preset on update #1459

Merged
merged 3 commits into from
Jul 13, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const help = `fresh-update
Update a Fresh project. This updates dependencies and optionally performs code
mods to update a project's source code to the latest recommended patterns.

To upgrade a projecct in the current directory, run:
To upgrade a project in the current directory, run:
fresh-update .

USAGE:
Expand Down Expand Up @@ -60,6 +60,20 @@ if (denoJson.importMap) {
await Deno.remove(IMPORT_MAP_PATH);
}

// Add fresh lint preset
if (!denoJson.lint) {
denoJson.lint = {};
}
if (!denoJson.lint.rules) {
denoJson.lint.rules = {};
}
if (!denoJson.lint.rules.tags) {
denoJson.lint.rules.tags = [];
}
if (!denoJson.lint.rules.tags.includes("fresh")) {
denoJson.lint.rules.tags.push("fresh");
}
marvinhagemeister marked this conversation as resolved.
Show resolved Hide resolved

freshImports(denoJson.imports);
if (denoJson.imports["twind"]) {
twindImports(denoJson.imports);
Expand Down