Skip to content

Commit

Permalink
GitHub actions and eslint config - warning only for now (#3723)
Browse files Browse the repository at this point in the history
* first step with eslint and github actions build

* warnings only
  • Loading branch information
rathboma committed Jun 19, 2022
1 parent 9a42ed5 commit fbfe451
Show file tree
Hide file tree
Showing 7 changed files with 617 additions and 3,157 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.eslintrc.js
dist
24 changes: 24 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = {
"env": {
"browser": true,
"es2021": true
},
globals: {
'luxon': 'readonly',
'XLSX': 'readonly',
'jspdf': 'readonly'
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["only-warn"],
"rules": {
"semi": "error",
"indent": ["error", "tab"],
"no-unused-vars": ["warn", { "vars": "all", "args": "none", "ignoreRestSiblings": false }],
"no-fallthrough": "off",
"no-inner-declarations": "off",
}
}
39 changes: 39 additions & 0 deletions .github/workflows/bad-files-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Bad files check
on:
pull_request:

jobs:
check:
name: Dist check
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
with:
fetch-depth: 0


- name: Get specific changed files in dist
id: changed-files-specific
uses: tj-actions/changed-files@v17.3
with:
files: |
dist
- name: Check file existence
id: check_files
uses: andstor/file-existence-action@v1
with:
files: "yarn.lock"

- name: Fail if dist files changed
if: steps.changed-files-specific.outputs.any_changed == 'true'
run: |
echo "Oops! Looks like you modified some files in dist/. Please remove them from your PR, thanks!"
exit 1
- name: Fail if yarn lock exists
if: steps.check_files.outputs.files_exists == 'true'
run: |
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!"
exit 1
31 changes: 31 additions & 0 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Lint and build
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
- master
pull_request:

jobs:
linting:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 14

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Build
run: npm run build
Loading

0 comments on commit fbfe451

Please sign in to comment.