add linter 💚

This commit is contained in:
Jannis R 2022-04-03 14:15:36 +02:00
parent 666c84b5f7
commit ae846d198d
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
4 changed files with 22 additions and 2 deletions

17
.eslintrc.json Normal file
View 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"
}
}

View file

@ -15,6 +15,7 @@ jobs:
with:
node-version: 16.x
- run: npm install
- run: npm run lint
- run: npm test
build-and-publish:
name: build & publish Docker image

4
api.js
View file

@ -64,8 +64,8 @@ const modifyRoutes = (routes, hafas, config) => {
}
const config = {
hostname: process.env.HOSTNAME || 'localhost',
port: process.env.PORT ? parseInt(process.env.PORT) : 3000,
hostname: process.env.HOSTNAME || 'localhost',
port: process.env.PORT ? parseInt(process.env.PORT) : 3000,
name: pkg.name,
description: pkg.description,
homepage: pkg.homepage,

View file

@ -37,6 +37,7 @@
"devDependencies": {
"@derhuerst/technical-docs-cli": "^1.1.0",
"axios": "^0.26.1",
"eslint": "^8.12.0",
"get-port": "^5.1.1",
"pino-pretty": "^4.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",
"build": "npm run docs",
"start": "node index.js",
"lint": "eslint .",
"test": "node test.js | tap-min"
}
}