Skip to content

Commit 20a86bd

Browse files
committed
Add eslinter
1 parent e6c590a commit 20a86bd

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/eslinter.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
3+
on: # yamllint disable-line rule:truthy
4+
workflow_call:
5+
inputs:
6+
repository:
7+
description: 'The repository that needs linting'
8+
type: string
9+
default: ${{ github.repository }}
10+
required: false
11+
ref:
12+
description: 'The branch, tag or SHA that needs linting'
13+
type: string
14+
required: false
15+
default: ${{ github.ref }}
16+
config:
17+
description: 'The location of the configuration file'
18+
type: string
19+
required: false
20+
default: './tools/linters/eslint.config.js'
21+
22+
jobs:
23+
linter:
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: Install NodeJS
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: latest
31+
32+
- name: Checkout Code
33+
uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 0
36+
repository: ${{ inputs.repository }}
37+
ref: ${{ inputs.ref }}
38+
39+
- name: Install ESLint
40+
run: |
41+
npm install eslint eslint-config
42+
43+
- name: Lint JavaScript
44+
run: ./node_modules/.bin/eslint --config=${{ inputs.config}}
45+
env:
46+
- DEBUG: eslint:languages:js

0 commit comments

Comments
 (0)