eslint - rules updated
This commit is contained in:
@@ -2,6 +2,6 @@ import {getUserInfo} from './utils/utils';
|
||||
|
||||
export async function getUserName(): Promise<string> {
|
||||
const info = await getUserInfo();
|
||||
return info?.name ?? "No name found!";
|
||||
return info?.name ?? 'No name found!';
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import {getUserName} from './SomeModule';
|
||||
function updateUserName(name: string): void {
|
||||
const node = document.createElement('span');
|
||||
node.innerText = `This user name is fetched with Javascript: ${name}`;
|
||||
document.getElementsByTagName("body")[0].appendChild(node);
|
||||
document.getElementsByTagName('body')[0].appendChild(node);
|
||||
}
|
||||
|
||||
getUserName().then(updateUserName);
|
||||
getUserName().then(updateUserName).catch((err) => console.error(err));
|
||||
|
||||
@@ -22,7 +22,7 @@ export function resetConfig(): void {
|
||||
|
||||
export async function getUserInfo(): Promise<Partial<UserInfo>|undefined> {
|
||||
const config = await getConfig();
|
||||
const res = await fetch(config.EXTERNAL_BASE_URL + "/api/user");
|
||||
const res = await fetch(config.EXTERNAL_BASE_URL + '/api/user');
|
||||
return res.json();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user