From b26ba18a5b55e74e62023af9025f490e20a0e72a Mon Sep 17 00:00:00 2001 From: Marius Alwan Meyer <22202402+sporqist@users.noreply.github.com> Date: Mon, 1 May 2023 21:31:27 +0000 Subject: [PATCH] [actions] add linting --- .gitea/workflows/lint.yaml | 38 ++++++++++++++++++++++++++++++ package.json | 48 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 .gitea/workflows/lint.yaml create mode 100644 package.json diff --git a/.gitea/workflows/lint.yaml b/.gitea/workflows/lint.yaml new file mode 100644 index 0000000..ec041ca --- /dev/null +++ b/.gitea/workflows/lint.yaml @@ -0,0 +1,38 @@ +name: Lint + +on: + # Trigger the workflow on push or pull request, + # but only for the main branch + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + run-linters: + name: Run linters + runs-on: ubuntu-latest + + steps: + - name: Install Dependencies + run: apt update; apt install -y nodejs + + - name: Check out Git repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 14 + + # ESLint and Prettier must be in `package.json` + - name: Install Node.js dependencies + run: npm ci + + - name: Run linters + uses: https://github.com/wearerequired/lint-action@v2 + with: + eslint: true + prettier: true \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..0d6cc88 --- /dev/null +++ b/package.json @@ -0,0 +1,48 @@ +{ + "name": "rocketchat-gitea-hook", + "version": "1.15.0-sporq", + "description": "Rocket.Chat integrate Gitea's notifications via Incoming Webhook", + "repository": "https://git.sporq.de/sporq/rocketchat-gitea-hook", + "license": "MIT", + "private": true, + "main": "./gitea-rocketchat.hooks.js", + "eslintConfig": { + "root": true, + "extends": [ + "@samuelmeuli/eslint-config", + "plugin:jsdoc/recommended" + ], + "env": { + "node": true, + "jest": true + }, + "settings": { + "jsdoc": { + "mode": "typescript" + } + }, + "rules": { + "no-await-in-loop": "off", + "no-unused-vars": [ + "error", + { + "args": "none", + "varsIgnorePattern": "^_" + } + ], + "jsdoc/check-indentation": "error", + "jsdoc/check-syntax": "error", + "jsdoc/newline-after-description": [ + "error", + "never" + ], + "jsdoc/require-description": "error", + "jsdoc/require-hyphen-before-param-description": "error", + "jsdoc/require-jsdoc": "off" + } + }, + "eslintIgnore": [ + "img/" + ], + "prettier": "@samuelmeuli/prettier-config" +} \ No newline at end of file