Skip to content

Commit

Permalink
eslint - enforce arrow functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Inrixia committed Oct 30, 2024
1 parent 8cdb207 commit 27f1b9c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
8 changes: 8 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ export default [

rules: {
"prettier/prettier": 2,
"prefer-arrow-callback": ["error"],
"func-style": ["error", "expression"],
},
},
{
files: ["src/subscriptionFetching.ts", "src/seekAndDestroy.ts"],
rules: {
"func-style": "off",
},
},
];
11 changes: 1 addition & 10 deletions src/float.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,13 @@ import { defaultSettings } from "./lib/defaults.js";
import { loginFloatplane, User } from "./logins.js";
import chalk from "chalk-template";

import type { ContentPost } from "floatplane/content";
import { fetchSubscriptions } from "./subscriptionFetching.js";

import semver from "semver";
const { gt, diff } = semver;

import { Self } from "floatplane/user";

async function* seekAndDestroy(): AsyncGenerator<ContentPost, void, unknown> {
while (settings.floatplane.seekAndDestroy.length > 0) {
const guid = settings.floatplane.seekAndDestroy.pop();
if (guid === undefined) continue;
console.log(chalk`Seek and Destroy: {red ${guid}}`);
yield fApi.content.post(guid);
}
}
import { seekAndDestroy } from "./seekAndDestroy.js";

/**
* Main function that triggeres everything else in the script
Expand Down
12 changes: 12 additions & 0 deletions src/seekAndDestroy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import chalk from "chalk-template";
import type { ContentPost } from "floatplane/content";
import { settings, fApi } from "./lib/helpers/index.js";

export async function* seekAndDestroy(): AsyncGenerator<ContentPost, void, unknown> {
while (settings.floatplane.seekAndDestroy.length > 0) {
const guid = settings.floatplane.seekAndDestroy.pop();
if (guid === undefined) continue;
console.log(chalk`Seek and Destroy: {red ${guid}}`);
yield fApi.content.post(guid);
}
}

0 comments on commit 27f1b9c

Please sign in to comment.