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:
@@ -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, ' '),
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user