diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..e78d41e --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,28 @@ +name: eslint +on: + - push: + branches: + - master + - pull_request + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + - name: Cache pnpm modules + uses: actions/cache@v2 + env: + cache-name: cache-pnpm-modules + with: + path: ~/.pnpm-store + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/package.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}- + - uses: pnpm/action-setup@v2.0.1 + with: + version: 6.3.0 + run_install: false + - run: pnpm install eslint + - run: pnpm run lint diff --git a/package.json b/package.json index 629774e..1d6fab3 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "description": "An open-source Discord bot for ticket management", "main": "src/index.js", "scripts": { + "lint": "eslint src --fix", "start": "node src/", "test": "echo \"Nothing to test! Run with 'npm start'\" && exit 1" },