Merge pull request #11 from YaBoiBurner/main

Add ESLint
This commit is contained in:
dangered wolf 2022-07-25 23:13:45 -04:00 committed by GitHub
commit c226fd5da1
Signed by: DevComp
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 1999 additions and 1 deletions

1
.eslintignore Normal file
View file

@ -0,0 +1 @@
dist

11
.eslintrc.yml Normal file
View file

@ -0,0 +1,11 @@
root: true
extends:
- typescript
- prettier
- plugin:optimize-regex/recommended
- plugin:sonarjs/recommended
plugins:
- eslint-plugin-optimize-regex
- sonarjs

46
.github/workflows/eslint.yml vendored Normal file
View file

@ -0,0 +1,46 @@
name: ESLint
on:
push:
branches:
- main
pull_request:
# The branches below must be a subset of the branches above
branches:
- main
schedule:
- cron: 43 16 * * 6
jobs:
eslint:
name: Run eslint scanning
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
cache-dependency-path: package-lock.json
- run: npm install
- name: Run ESLint
run: npx eslint .
--config .eslintrc.yml
--ext .js,.jsx,.ts,.tsx
--format @microsoft/eslint-formatter-sarif
--output-file eslint-results.sarif
continue-on-error: true
- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: eslint-results.sarif
wait-for-processing: true

1931
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -9,14 +9,23 @@
"log": "wrangler tail", "log": "wrangler tail",
"reload": "wrangler publish && wrangler tail", "reload": "wrangler publish && wrangler tail",
"register": "node src/register.js", "register": "node src/register.js",
"prettier": "prettier --write ." "prettier": "prettier --write .",
"lint:eslint": "eslint --max-warnings=0 src"
}, },
"author": "dangered wolf", "author": "dangered wolf",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@cloudflare/workers-types": "^3.14.1", "@cloudflare/workers-types": "^3.14.1",
"@microsoft/eslint-formatter-sarif": "^3.0.0",
"@types/service-worker-mock": "^2.0.1", "@types/service-worker-mock": "^2.0.1",
"@typescript-eslint/eslint-plugin": "^5.31.0",
"@typescript-eslint/parser": "^5.31.0",
"dotenv": "^16.0.1", "dotenv": "^16.0.1",
"eslint": "^8.20.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-typescript": "^3.0.0",
"eslint-plugin-optimize-regex": "^1.2.1",
"eslint-plugin-sonarjs": "^0.14.0",
"prettier": "^2.7.1", "prettier": "^2.7.1",
"service-worker-mock": "^2.0.5", "service-worker-mock": "^2.0.5",
"ts-loader": "^9.3.1", "ts-loader": "^9.3.1",