Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minor ESLint API issues #139

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion api/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": ["airbnb-base", "plugin:prettier/recommended"],
"extends": [
"airbnb-base",
"plugin:prettier/recommended"
],
"env": {
"commonjs": true,
"es6": true,
Expand All @@ -8,6 +11,8 @@
},
"rules": {
"no-console": "off",
"import/prefer-default-export": "warn",
"no-underscore-dangle": "off",
"max-len": [
"warn",
{
Expand Down
File renamed without changes.
6 changes: 5 additions & 1 deletion api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-prettier": "^3.1.4",
"jest": "^27.2.0",
"prettier": "^2.0.5"
},
"scripts": {
Expand All @@ -39,7 +40,10 @@
},
"jest": {
"transform": {
"^.+\\.(js|jsx)$": "<rootDir>/node_modules/babel-jest"
"^.+\\.(js|jsx)$": "<rootDir>/node_modules/babel-jest",
"setupFilesAfterEnv": [
"./jest.setup.js"
]
},
"testEnvironment": "node",
"testURL": "http://localhost",
Expand Down
3 changes: 1 addition & 2 deletions api/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as enforce from 'express-sslify';
import express from 'express';
import helmet from 'helmet';

import { createRoutes } from './src/routes';
import createRoutes from './src/routes';

const port = process.env.PORT || 8080;

Expand Down Expand Up @@ -45,7 +45,6 @@ if (process.env.REDIRECT_TO_DOMAIN != undefined) {
}
});
app.use(enforce.HTTPS({ trustProtoHeader: true }));
} else {
}

app.use(express.static(`${__dirname}/dist`));
Expand Down
1 change: 0 additions & 1 deletion api/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ export async function getTaxonomy() {
await indexZip.loadAsync(downloadedRepos.data);

// Iterate through all the .toml files
const orgs = [];
const issues = [];
const promises = [];
indexZip.folder('').forEach((path) => {
Expand Down
7 changes: 3 additions & 4 deletions api/src/routes.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Router } from 'express';
import apicache from 'apicache';

import { getProjectIndex } from './api';
import { getTaxonomy } from './api';
import { getProjectIndex, getTaxonomy } from './api';

export function createRoutes(app) {
export default function createRoutes(app) {
const router = Router();
// maybe a last_update call?
router.get('/tags.json', app.cache('15 minutes'), (_, res) => {
Expand Down Expand Up @@ -42,6 +41,6 @@ export function createRoutes(app) {
apicache.clear('/api/taxonomy.json');
res.redirect('/api/taxonomy.json');
});

return router;
}
Loading