diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index ff38ce7..0000000 --- a/.eslintrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "@nodesecure/eslint-config", - "parserOptions": { - "sourceType": "module", - "requireConfigFile": false - }, - "rules": { - "@typescript-eslint/no-non-null-assertion": "off" - } -} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..8a1e9d0 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,3 @@ +import { typescriptConfig } from "@openally/config.eslint"; + +export default typescriptConfig(); diff --git a/package.json b/package.json index 19c5c6f..1d245a9 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "prepublishOnly": "npm run build", "test": "glob -c \"tsx --test\" \"./test/**/*.spec.ts\"", "coverage": "c8 --all -r html npm test", - "lint": "eslint src/*.ts test/*.ts" + "lint": "eslint src test" }, "repository": { "type": "git", @@ -27,7 +27,7 @@ }, "homepage": "https://github.com/dashlog/core#readme", "devDependencies": { - "@nodesecure/eslint-config": "^1.9.0", + "@openally/config.eslint": "^1.3.0", "@types/node": "^22.0.0", "c8": "^10.1.2", "glob": "^11.0.0", diff --git a/src/index.ts b/src/index.ts index 0a011f7..d8ec519 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,7 +12,7 @@ export type DashlogPlugins = keyof typeof plugins; export type DashlogOrganization = { logo: string; projects: DashlogRepository[]; -} +}; export interface IFetchOrgMetadataOptions { plugins: Plugins[]; diff --git a/src/plugins/nodesecure.ts b/src/plugins/nodesecure.ts index a6e6a2f..6fa395c 100644 --- a/src/plugins/nodesecure.ts +++ b/src/plugins/nodesecure.ts @@ -10,10 +10,10 @@ const kScannerLock = new Mutex({ concurrency: 5 }); export type NodesecurePlugin = { nodesecure?: scanner.tarball.ScannedPackageResult; -} +}; export async function execute( - orgName: string, + _orgName: string, repository: DashlogRepository ) { if (repository.package_name === null) { diff --git a/src/plugins/scorecard.ts b/src/plugins/scorecard.ts index 32f3bf6..d1702c7 100644 --- a/src/plugins/scorecard.ts +++ b/src/plugins/scorecard.ts @@ -6,7 +6,7 @@ import { DashlogRepository } from "../services/repository.js"; export type ScorecardPlugin = { scorecard?: scorecard.ScorecardResult | null; -} +}; export async function execute( orgName: string, diff --git a/src/services/repository.ts b/src/services/repository.ts index ea7004d..7b85cfd 100644 --- a/src/services/repository.ts +++ b/src/services/repository.ts @@ -90,11 +90,11 @@ export default class Repository { } async #fetchLastGithubCommit() { - // eslint-disable-next-line max-len - const uri = `${this.#repository.commits_url.slice(0, this.#repository.commits_url.length - kCommitUrlPostfixLen)}?per_page=${kMaxCommitFetch}`; + const url = new URL(this.#repository.commits_url.slice(0, this.#repository.commits_url.length - kCommitUrlPostfixLen)); + url.searchParams.set("per_page", kMaxCommitFetch.toString()); const { data: commits } = await httpie.get( - uri, { headers: this.#org.headers } + url, { headers: this.#org.headers } ); this.#commits = commits; const lastCommit = commits[0]; diff --git a/test/plugins/scorecard.spec.ts b/test/plugins/scorecard.spec.ts index 1e88cfb..5788878 100644 --- a/test/plugins/scorecard.spec.ts +++ b/test/plugins/scorecard.spec.ts @@ -53,5 +53,3 @@ describe("execute()", async() => { assert.strictEqual(repo.plugins.scorecard, null); }); }); - -