-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (33 loc) · 955 Bytes
/
linting.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Linting
on: pull_request
jobs:
eslint:
runs-on: ubuntu-latest
container:
image: node:12
steps:
- uses: actions/checkout@v1
- name: Cache node modules
id: cache
uses: actions/cache@v1
with:
path: node_modules # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: ESlint
run: npm run lint
no-console:
runs-on: ubuntu-latest
container:
image: node:12
steps:
- uses: actions/checkout@v1
- name: Check for console usage
run: |
[ $(grep -R "console." src | wc -l) = 0 ]