diff --git a/.gitea/workflows/api-docs.yml b/.gitea/workflows/api-docs.yml index d559ac3..5c43fe9 100644 --- a/.gitea/workflows/api-docs.yml +++ b/.gitea/workflows/api-docs.yml @@ -51,10 +51,13 @@ jobs: npm install fi + - name: Add node_modules/.bin to PATH + run: echo "$(pwd)/node_modules/.bin" >> $GITHUB_PATH + - name: Run linting run: | - npm run lint - npm run lint:fix --dry-run + npx eslint . --ext .js + npx eslint . --ext .js --fix --dry-run - name: Run type checking run: npm run type-check @@ -118,6 +121,9 @@ jobs: npm install fi + - name: Add node_modules/.bin to PATH + run: echo "$(pwd)/node_modules/.bin" >> $GITHUB_PATH + - name: Build application run: npm run build diff --git a/services/api-docs/.eslintignore b/services/api-docs/.eslintignore new file mode 100644 index 0000000..d933ad0 --- /dev/null +++ b/services/api-docs/.eslintignore @@ -0,0 +1,8 @@ +node_modules/ +coverage/ +*.min.js +*.bundle.js +.env +.env.local +.env.production +.env.test diff --git a/services/api-docs/.eslintrc.js b/services/api-docs/.eslintrc.js new file mode 100644 index 0000000..7b19057 --- /dev/null +++ b/services/api-docs/.eslintrc.js @@ -0,0 +1,27 @@ +module.exports = { + env: { + browser: true, + commonjs: true, + es2021: true, + node: true, + jest: true + }, + extends: [ + 'standard' + ], + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module' + }, + rules: { + 'no-console': 'warn', + 'no-unused-vars': 'warn', + 'prefer-const': 'error', + 'no-var': 'error', + 'object-shorthand': 'error', + 'prefer-template': 'error' + }, + globals: { + process: 'readonly' + } +} diff --git a/services/api-docs/package.json b/services/api-docs/package.json index 0c86f17..14eaa7d 100644 --- a/services/api-docs/package.json +++ b/services/api-docs/package.json @@ -22,7 +22,14 @@ "swagger-ui-express": "^5.0.0" }, "devDependencies": { - "nodemon": "^3.0.2" + "nodemon": "^3.0.2", + "eslint": "^8.57.0", + "eslint-config-standard": "^17.1.0", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^6.1.1", + "jest": "^29.7.0", + "supertest": "^7.0.0" }, "keywords": [ "api",