Browse Source

update linting

pull/113/head
Jelle van Snik 3 years ago
parent
commit
4731f350d9
  1. 29
      .github/workflows/linting.yml
  2. 40
      .github/workflows/linting_testing.yml
  3. 30
      .github/workflows/testing.yml
  4. 6
      .vscode/extensions.json
  5. 3
      .vscode/settings.json
  6. 3
      package.json
  7. 2
      src/App.tsx

29
.github/workflows/linting.yml

@ -1,29 +0,0 @@ @@ -1,29 +0,0 @@
name: Linting
on:
push:
branches:
- master
- dev
pull_request:
types: [opened, reopened, synchronize]
jobs:
linting:
name: Run linters
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install Yarn packages
run: yarn install
- name: Run linters
run: yarn lint:strict

40
.github/workflows/linting_testing.yml

@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
name: Linting and Testing
on:
push:
branches:
- master
- dev
pull_request:
types: [opened, reopened, synchronize]
jobs:
linting:
name: Run Linters
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install Yarn packages
run: yarn install
- name: Run ESLint Report
run: yarn lint:report
# continue on error, so it still reports it in the next step
continue-on-error: true
- name: Annotate Code Linting Results
uses: ataylorme/eslint-annotate-action@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
report-json: "eslint_report.json"
- name: Build Project
run: npm run build

30
.github/workflows/testing.yml

@ -1,30 +0,0 @@ @@ -1,30 +0,0 @@
name: Testing
on:
push:
branches:
- dev
pull_request:
types: [opened, reopened, synchronize]
permissions: read-all
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install Yarn packages
run: yarn install
- name: Build project
run: yarn build

6
.vscode/extensions.json vendored

@ -0,0 +1,6 @@ @@ -0,0 +1,6 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig"
]
}

3
.vscode/settings.json vendored

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
{
"files.eol": "\n",
"editor.detectIndentation": false,
"editor.tabSize": 2,
"editor.formatOnSave": true,
"editor.tabSize": 2
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
}

3
package.json

@ -25,7 +25,8 @@ @@ -25,7 +25,8 @@
"build": "vite build",
"preview": "vite preview",
"lint": "eslint --ext .tsx,.ts src",
"lint:strict": "eslint --ext .tsx,.ts --max-warnings 0 src"
"lint:strict": "eslint --ext .tsx,.ts --max-warnings 0 src",
"lint:report": "eslint --ext .tsx,.ts --output-file eslint_report.json --format json src"
},
"browserslist": {
"production": [

2
src/App.tsx

@ -12,7 +12,7 @@ function App() { @@ -12,7 +12,7 @@ function App() {
<WatchedContextProvider>
<BookmarkContextProvider>
<Switch>
<Route exact path="/">
<Route exact={true} path="/">
<Redirect to={`/search/${MWMediaType.MOVIE}`} />
</Route>
<Route exact path="/media/movie/:media" component={MediaView} />

Loading…
Cancel
Save