add linter 💚
This commit is contained in:
parent
666c84b5f7
commit
ae846d198d
4 changed files with 22 additions and 2 deletions
17
.eslintrc.json
Normal file
17
.eslintrc.json
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"extends": "eslint:recommended",
|
||||||
|
"env": {
|
||||||
|
"commonjs": true,
|
||||||
|
"es6": true,
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 2018
|
||||||
|
},
|
||||||
|
"ignorePatterns": [
|
||||||
|
"node_modules"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"no-unused-vars": "off"
|
||||||
|
}
|
||||||
|
}
|
1
.github/workflows/docker-image.yml
vendored
1
.github/workflows/docker-image.yml
vendored
|
@ -15,6 +15,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 16.x
|
||||||
- run: npm install
|
- run: npm install
|
||||||
|
- run: npm run lint
|
||||||
- run: npm test
|
- run: npm test
|
||||||
build-and-publish:
|
build-and-publish:
|
||||||
name: build & publish Docker image
|
name: build & publish Docker image
|
||||||
|
|
4
api.js
4
api.js
|
@ -64,8 +64,8 @@ const modifyRoutes = (routes, hafas, config) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
hostname: process.env.HOSTNAME || 'localhost',
|
hostname: process.env.HOSTNAME || 'localhost',
|
||||||
port: process.env.PORT ? parseInt(process.env.PORT) : 3000,
|
port: process.env.PORT ? parseInt(process.env.PORT) : 3000,
|
||||||
name: pkg.name,
|
name: pkg.name,
|
||||||
description: pkg.description,
|
description: pkg.description,
|
||||||
homepage: pkg.homepage,
|
homepage: pkg.homepage,
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@derhuerst/technical-docs-cli": "^1.1.0",
|
"@derhuerst/technical-docs-cli": "^1.1.0",
|
||||||
"axios": "^0.26.1",
|
"axios": "^0.26.1",
|
||||||
|
"eslint": "^8.12.0",
|
||||||
"get-port": "^5.1.1",
|
"get-port": "^5.1.1",
|
||||||
"pino-pretty": "^4.0.0",
|
"pino-pretty": "^4.0.0",
|
||||||
"tap-min": "^2.0.0",
|
"tap-min": "^2.0.0",
|
||||||
|
@ -46,6 +47,7 @@
|
||||||
"docs": "node api-docs.js >docs/api.md && build-technical-doc --syntax-stylesheet-url /syntax.css <docs/readme.md >docs/index.html && build-technical-doc --syntax-stylesheet-url /syntax.css <docs/getting-started.md >docs/getting-started.html && build-technical-doc --syntax-stylesheet-url /syntax.css <docs/api.md >docs/api.html && build-technical-doc --syntax-stylesheet github >docs/syntax.css",
|
"docs": "node api-docs.js >docs/api.md && build-technical-doc --syntax-stylesheet-url /syntax.css <docs/readme.md >docs/index.html && build-technical-doc --syntax-stylesheet-url /syntax.css <docs/getting-started.md >docs/getting-started.html && build-technical-doc --syntax-stylesheet-url /syntax.css <docs/api.md >docs/api.html && build-technical-doc --syntax-stylesheet github >docs/syntax.css",
|
||||||
"build": "npm run docs",
|
"build": "npm run docs",
|
||||||
"start": "node index.js",
|
"start": "node index.js",
|
||||||
|
"lint": "eslint .",
|
||||||
"test": "node test.js | tap-min"
|
"test": "node test.js | tap-min"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue