Skip to content

Commit fbfe451

Browse files
authored
GitHub actions and eslint config - warning only for now (#3723)
* first step with eslint and github actions build * warnings only
1 parent 9a42ed5 commit fbfe451

7 files changed

Lines changed: 617 additions & 3157 deletions

File tree

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.eslintrc.js
2+
dist

.eslintrc.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = {
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
globals: {
7+
'luxon': 'readonly',
8+
'XLSX': 'readonly',
9+
'jspdf': 'readonly'
10+
},
11+
"extends": "eslint:recommended",
12+
"parserOptions": {
13+
"ecmaVersion": "latest",
14+
"sourceType": "module"
15+
},
16+
"plugins": ["only-warn"],
17+
"rules": {
18+
"semi": "error",
19+
"indent": ["error", "tab"],
20+
"no-unused-vars": ["warn", { "vars": "all", "args": "none", "ignoreRestSiblings": false }],
21+
"no-fallthrough": "off",
22+
"no-inner-declarations": "off",
23+
}
24+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Bad files check
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
check:
7+
name: Dist check
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Check out Git repository
11+
uses: actions/checkout@v2
12+
with:
13+
fetch-depth: 0
14+
15+
16+
- name: Get specific changed files in dist
17+
id: changed-files-specific
18+
uses: tj-actions/changed-files@v17.3
19+
with:
20+
files: |
21+
dist
22+
23+
- name: Check file existence
24+
id: check_files
25+
uses: andstor/file-existence-action@v1
26+
with:
27+
files: "yarn.lock"
28+
29+
- name: Fail if dist files changed
30+
if: steps.changed-files-specific.outputs.any_changed == 'true'
31+
run: |
32+
echo "Oops! Looks like you modified some files in dist/. Please remove them from your PR, thanks!"
33+
exit 1
34+
35+
- name: Fail if yarn lock exists
36+
if: steps.check_files.outputs.files_exists == 'true'
37+
run: |
38+
echo "Oops! Looks like you checked in a yarn.lock file, we use npm and package-lock.json. Please remove it from your PR, thanks!"
39+
exit 1
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Lint and build
2+
on:
3+
# Trigger the workflow on push or pull request,
4+
# but only for the main branch
5+
push:
6+
branches:
7+
- main
8+
- master
9+
pull_request:
10+
11+
jobs:
12+
linting:
13+
name: Linting
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out Git repository
17+
uses: actions/checkout@v2
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v1
21+
with:
22+
node-version: 14
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Lint
28+
run: npm run lint
29+
30+
- name: Build
31+
run: npm run build

0 commit comments

Comments
 (0)