1
0
mirror of https://github.com/uetchy/namae.git synced 2025-08-21 02:08:12 +09:00

chore: add eslint rules

This commit is contained in:
2019-12-24 01:57:07 +09:00
parent 934486d64f
commit 1fd9332bdc
35 changed files with 381 additions and 404 deletions

View File

@@ -5,7 +5,7 @@ const APPLICATION_ID = process.env.NTA_APPLICATION_ID;
export default async function handler(
req: NowRequest<{query: string; country: string}>,
res: NowResponse,
) {
): Promise<void> {
const {query} = req.query;
if (!query) {
@@ -24,6 +24,7 @@ export default async function handler(
'GET',
);
const body: string[] = (await response.text()).split('\n').slice(0, -1);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const header = body.shift()!.split(',');
const result = body.map((csv) => {
const entry = csv.split(',').map((item) =>
@@ -32,6 +33,7 @@ export default async function handler(
.replace(/[A-Za-z0-9]/g, (str) =>
String.fromCharCode(str.charCodeAt(0) - 0xfee0),
)
// eslint-disable-next-line no-irregular-whitespace
.replace(/ /g, ' '),
);