feat: Add ESLint (#176)

This commit is contained in:
Lipis 2021-03-03 10:25:30 +02:00 committed by GitHub
parent cbda52be05
commit c0eeac3feb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 888 additions and 38 deletions

3
.eslintrc.json Normal file
View File

@ -0,0 +1,3 @@
{
"extends": "@excalidraw/eslint-config"
}

View File

@ -1,6 +1,8 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
- package-ecosystem: npm
directory: /
schedule:
interval: "weekly"
interval: weekly
day: sunday
time: "01:00"

View File

@ -6,17 +6,13 @@ on:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install dependencies
run: yarn
run: yarn --frozen-lockfile
- name: Lint
run: yarn lint
run: yarn test:other

View File

@ -8,7 +8,6 @@ on:
jobs:
publish-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/build-push-action@v1

View File

@ -6,19 +6,15 @@ on:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Install dependencies
run: yarn
run: yarn --frozen-lockfile
- name: Test and Build
run: |
yarn test
yarn test:code
yarn build

View File

@ -1,16 +1,22 @@
{
"dependencies": {
"@excalidraw/eslint-config": "1.0.0",
"@excalidraw/prettier-config": "1.0.2",
"@types/debug": "4.1.5",
"@types/express": "4.17.11",
"@types/node": "14.14.31",
"@types/socket.io": "2.1.4",
"@typescript-eslint/eslint-plugin": "4.16.1",
"@typescript-eslint/parser": "4.16.1",
"debug": "4.3.1",
"eslint": "7.21.0",
"eslint-config-prettier": "8.1.0",
"eslint-plugin-prettier": "3.3.1",
"express": "4.17.1",
"prettier": "2.2.1",
"socket.io": "2.3.0",
"ts-node-dev": "1.1.1",
"typescript": "4.1.5"
"ts-node-dev": "1.1.6",
"typescript": "4.2.2"
},
"license": "MIT",
"main": "dist/index.js",
@ -18,12 +24,15 @@
"prettier": "@excalidraw/prettier-config",
"scripts": {
"build": "tsc",
"format": "yarn prettier --write",
"lint": "yarn prettier --list-different",
"prettier": "prettier \"**/*.{ts,md,json,yaml,yml}\"",
"fix:code": "yarn test:code --fix",
"fix:other": "yarn prettier --write",
"fix": "yarn fix:other && yarn fix:code",
"prettier": "prettier . --ignore-path=.gitignore",
"start": "node dist/index.js",
"start:dev": "ts-node-dev --respawn --transpile-only src/index.ts",
"test": "yarn lint"
"test:code": "eslint --ext .ts .",
"test:other": "yarn prettier --list-different",
"test": "yarn test:other && yarn test:code"
},
"version": "1.0.0"
}

View File

@ -23,7 +23,7 @@ server.listen(port, () => {
});
const io = socketIO(server, {
handlePreflightRequest: function (req, res) {
handlePreflightRequest: (req, res) => {
const headers = {
"Access-Control-Allow-Headers": "Content-Type, Authorization",
"Access-Control-Allow-Origin":

875
yarn.lock

File diff suppressed because it is too large Load Diff