From 019f64c897cba8b3fffcfa991c9001a0b66472b6 Mon Sep 17 00:00:00 2001 From: Josephat-S Date: Mon, 25 May 2026 11:30:01 +0200 Subject: [PATCH 1/2] updated the CI by adding prettier and proper linting --- .eslintrc.json | 11 +++--- .github/workflows/ci.yml | 23 ++++-------- .husky/pre-commit | 6 ++-- .prettierrc | 7 ++-- package-lock.json | 77 +++++++++++++++++++++++++++++++++------- package.json | 8 +++-- 6 files changed, 91 insertions(+), 41 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index abb9a0a..8113781 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,14 +1,15 @@ { - "root": true, "env": { "node": true, "es2022": true }, - "extends": ["eslint:recommended"], "parserOptions": { "ecmaVersion": "latest", "sourceType": "module" }, - "ignorePatterns": ["node_modules/", "templates/"], - "rules": {} -} \ No newline at end of file + "extends": ["eslint:recommended"], + "rules": { + "no-unused-vars": "warn", + "no-console": "off" + } +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1dd448b..6a19a51 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,25 +2,16 @@ name: CI on: pull_request: - branches: - - main + branches: [main] jobs: lint: runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Node.js - uses: actions/setup-node@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: - node-version: 20 - cache: npm - - - name: Install dependencies - run: npm install - - - name: Run linter - run: npm run lint \ No newline at end of file + node-version: '20' + cache: 'npm' + - run: npm install + - run: npm run lint diff --git a/.husky/pre-commit b/.husky/pre-commit index dba9310..75fac8e 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" -npm run lint \ No newline at end of file +npm run lint diff --git a/.prettierrc b/.prettierrc index dcb7279..8b0e83d 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,4 +1,7 @@ { "singleQuote": true, - "trailingComma": "all" -} \ No newline at end of file + "trailingComma": "all", + "semi": true, + "printWidth": 100, + "tabWidth": 2 +} diff --git a/package-lock.json b/package-lock.json index 1b614d3..22c1683 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,9 +18,11 @@ "opusify": "index.js" }, "devDependencies": { + "@eslint/js": "^10.0.1", "eslint": "^8.57.1", + "globals": "^17.6.0", "husky": "^8.0.3", - "prettier": "^3.6.2" + "prettier": "^3.8.3" } }, "node_modules/@eslint-community/eslint-utils": { @@ -76,14 +78,41 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@eslint/js": { - "version": "8.57.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", - "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", + "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", "dev": true, "license": "MIT", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "eslint": "^10.0.0" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } } }, "node_modules/@humanwhocodes/config-array": { @@ -503,6 +532,7 @@ "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -849,6 +879,16 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/@eslint/js": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, "node_modules/eslint/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -866,6 +906,22 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/eslint/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/espree": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", @@ -1122,16 +1178,13 @@ } }, "node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "version": "17.6.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.6.0.tgz", + "integrity": "sha512-sepffkT8stwnIYbsMBpoCHJuJM5l98FUF2AnE07hfvE0m/qp3R586hw4jF4uadbhvg1ooIdzuu7CsfD2jzCaNA==", "dev": true, "license": "MIT", - "dependencies": { - "type-fest": "^0.20.2" - }, "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" diff --git a/package.json b/package.json index 36aac7e..5ec2d6c 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "lint": "eslint index.js src", + "lint": "eslint index.js src/", "format": "prettier --write .", "prepare": "husky install" }, @@ -31,8 +31,10 @@ "tiged": "^2.12.7" }, "devDependencies": { + "@eslint/js": "^10.0.1", "eslint": "^8.57.1", + "globals": "^17.6.0", "husky": "^8.0.3", - "prettier": "^3.6.2" + "prettier": "^3.8.3" } -} \ No newline at end of file +} From eaad3fecaa238cde966db821470f26027ccb0f8b Mon Sep 17 00:00:00 2001 From: Josephat-S Date: Mon, 25 May 2026 11:35:47 +0200 Subject: [PATCH 2/2] removed @eslint/js --- package-lock.json | 37 +------------------------------------ package.json | 2 -- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/package-lock.json b/package-lock.json index 22c1683..984d2fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,9 +18,7 @@ "opusify": "index.js" }, "devDependencies": { - "@eslint/js": "^10.0.1", "eslint": "^8.57.1", - "globals": "^17.6.0", "husky": "^8.0.3", "prettier": "^3.8.3" } @@ -94,27 +92,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@eslint/js": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", - "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^20.19.0 || ^22.13.0 || >=24" - }, - "funding": { - "url": "https://eslint.org/donate" - }, - "peerDependencies": { - "eslint": "^10.0.0" - }, - "peerDependenciesMeta": { - "eslint": { - "optional": true - } - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.13.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", @@ -799,6 +776,7 @@ "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -1177,19 +1155,6 @@ "node": ">=10.13.0" } }, - "node_modules/globals": { - "version": "17.6.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-17.6.0.tgz", - "integrity": "sha512-sepffkT8stwnIYbsMBpoCHJuJM5l98FUF2AnE07hfvE0m/qp3R586hw4jF4uadbhvg1ooIdzuu7CsfD2jzCaNA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/globalyzer": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz", diff --git a/package.json b/package.json index 5ec2d6c..b46fec4 100644 --- a/package.json +++ b/package.json @@ -31,9 +31,7 @@ "tiged": "^2.12.7" }, "devDependencies": { - "@eslint/js": "^10.0.1", "eslint": "^8.57.1", - "globals": "^17.6.0", "husky": "^8.0.3", "prettier": "^3.8.3" }