From ec1c7b2d713ca37dda9dcb1bc0119193714ecd8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=9B=D1=8F=D1=89=D1=83=D0=BA?= <40496434+prog-time@users.noreply.github.com> Date: Mon, 2 Mar 2026 14:09:13 +0300 Subject: [PATCH 1/3] fixed yamllint.sh --- scripts/shell/linters/yamllint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/shell/linters/yamllint.sh b/scripts/shell/linters/yamllint.sh index 21a7a71..166b200 100644 --- a/scripts/shell/linters/yamllint.sh +++ b/scripts/shell/linters/yamllint.sh @@ -10,7 +10,8 @@ fi mapfile -t yaml_files < <(find . -type f \( -name "*.yml" -o -name "*.yaml" \) \ -not -path "./_site/*" \ -not -path "./node_modules/*" \ - -not -path "./.git/*") + -not -path "./.git/*" \ + -not -name ".yamllint.yml") if [ ${#yaml_files[@]} -eq 0 ]; then echo "⚠️ No YAML files found. Skipping." From fc78d545548b07e136791ff609d736ec5a4f3c1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=9B=D1=8F=D1=89=D1=83=D0=BA?= <40496434+prog-time@users.noreply.github.com> Date: Mon, 2 Mar 2026 14:14:29 +0300 Subject: [PATCH 2/3] assembled: exclude .yamllint.yml from yamllint scan Co-Authored-By: Claude Sonnet 4.6 --- CI/linters/yamllint.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CI/linters/yamllint.yml b/CI/linters/yamllint.yml index 676038c..fb22fac 100644 --- a/CI/linters/yamllint.yml +++ b/CI/linters/yamllint.yml @@ -17,7 +17,8 @@ yamllint: mapfile -t yaml_files < <(find . -type f \( -name "*.yml" -o -name "*.yaml" \) \ -not -path "./_site/*" \ -not -path "./node_modules/*" \ - -not -path "./.git/*") + -not -path "./.git/*" \ + -not -name ".yamllint.yml") if [ ${#yaml_files[@]} -eq 0 ]; then echo "⚠️ No YAML files found. Skipping." From aa2d7dd34a2b3c3b3723072c16681c17bc284a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=9B=D1=8F=D1=89=D1=83=D0=BA?= <40496434+prog-time@users.noreply.github.com> Date: Mon, 2 Mar 2026 15:11:52 +0300 Subject: [PATCH 3/3] add ESLint linter workflow Co-Authored-By: Claude Sonnet 4.6 --- CI/linters/eslint.yml | 45 +++++++++++++++++++++++++++++++++ scripts/CI/linters/eslint.yml | 8 ++++++ scripts/shell/linters/eslint.sh | 38 ++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 CI/linters/eslint.yml create mode 100644 scripts/CI/linters/eslint.yml create mode 100644 scripts/shell/linters/eslint.sh diff --git a/CI/linters/eslint.yml b/CI/linters/eslint.yml new file mode 100644 index 0000000..62c29dc --- /dev/null +++ b/CI/linters/eslint.yml @@ -0,0 +1,45 @@ +eslint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: npm ci + - name: Run ESLint + run: | + set -euo pipefail + ERROR_FOUND=0 + + CONFIG_FOUND=0 + for config in ".eslintrc.json" ".eslintrc.js" ".eslintrc.yml" ".eslintrc.yaml" "eslint.config.js" "eslint.config.mjs" "eslint.config.cjs"; do + if [ -f "$config" ]; then + CONFIG_FOUND=1 + break + fi + done + + if [ $CONFIG_FOUND -eq 0 ]; then + echo "::error::No ESLint config file found" + exit 1 + fi + + mapfile -t js_files < <(find . -type f \( -name "*.js" -o -name "*.jsx" -o -name "*.ts" -o -name "*.tsx" -o -name "*.mjs" -o -name "*.cjs" \) \ + -not -path "./_site/*" \ + -not -path "./node_modules/*" \ + -not -path "./.git/*") + + if [ ${#js_files[@]} -eq 0 ]; then + echo "⚠️ No JS/TS files found. Skipping." + exit 0 + fi + + for file in "${js_files[@]}"; do + echo "ℹ️ Checking ${file#./}..." + npx eslint "$file" || ERROR_FOUND=1 + done + + if [[ $ERROR_FOUND -eq 0 ]]; then + echo "✅ All JS/TS files passed ESLint checks!" + else + echo "❌ ESLint found issues!" + exit 1 + fi diff --git a/scripts/CI/linters/eslint.yml b/scripts/CI/linters/eslint.yml new file mode 100644 index 0000000..2934c13 --- /dev/null +++ b/scripts/CI/linters/eslint.yml @@ -0,0 +1,8 @@ +eslint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: npm ci + - name: Run ESLint + run: bash scripts/shell/linters/eslint.sh diff --git a/scripts/shell/linters/eslint.sh b/scripts/shell/linters/eslint.sh new file mode 100644 index 0000000..334b211 --- /dev/null +++ b/scripts/shell/linters/eslint.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +set -euo pipefail +ERROR_FOUND=0 + +CONFIG_FOUND=0 +for config in ".eslintrc.json" ".eslintrc.js" ".eslintrc.yml" ".eslintrc.yaml" "eslint.config.js" "eslint.config.mjs" "eslint.config.cjs"; do + if [ -f "$config" ]; then + CONFIG_FOUND=1 + break + fi +done + +if [ $CONFIG_FOUND -eq 0 ]; then + echo "::error::No ESLint config file found" + exit 1 +fi + +mapfile -t js_files < <(find . -type f \( -name "*.js" -o -name "*.jsx" -o -name "*.ts" -o -name "*.tsx" -o -name "*.mjs" -o -name "*.cjs" \) \ + -not -path "./_site/*" \ + -not -path "./node_modules/*" \ + -not -path "./.git/*") + +if [ ${#js_files[@]} -eq 0 ]; then + echo "⚠️ No JS/TS files found. Skipping." + exit 0 +fi + +for file in "${js_files[@]}"; do + echo "ℹ️ Checking ${file#./}..." + npx eslint "$file" || ERROR_FOUND=1 +done + +if [[ $ERROR_FOUND -eq 0 ]]; then + echo "✅ All JS/TS files passed ESLint checks!" +else + echo "❌ ESLint found issues!" + exit 1 +fi