feat: Add ESLint (#176)
This commit is contained in:
parent
cbda52be05
commit
c0eeac3feb
3
.eslintrc.json
Normal file
3
.eslintrc.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "@excalidraw/eslint-config"
|
||||
}
|
8
.github/dependabot.yml
vendored
8
.github/dependabot.yml
vendored
@ -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"
|
||||
|
8
.github/workflows/lint.yml
vendored
8
.github/workflows/lint.yml
vendored
@ -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
|
||||
|
1
.github/workflows/publish-docker.yml
vendored
1
.github/workflows/publish-docker.yml
vendored
@ -8,7 +8,6 @@ on:
|
||||
jobs:
|
||||
publish-docker:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: docker/build-push-action@v1
|
||||
|
8
.github/workflows/test.yml
vendored
8
.github/workflows/test.yml
vendored
@ -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
|
||||
|
21
package.json
21
package.json
@ -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"
|
||||
}
|
||||
|
@ -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":
|
||||
|
Loading…
x
Reference in New Issue
Block a user