frontend linting

This commit is contained in:
realaravinth
2021-10-08 15:24:29 +05:30
parent f7afc72d81
commit 53720ff740
91 changed files with 2158 additions and 1677 deletions

View File

@@ -14,38 +14,38 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {init} from 'mcaptcha-glue';
import {init} from "mcaptcha-glue";
import VIEWS from '../../../views/v1/routes';
import VIEWS from "../../../views/v1/routes";
import isBlankString from '../../../utils/isBlankString';
import genJsonPayload from '../../../utils/genJsonPayload';
import getFormUrl from '../../../utils/getFormUrl';
import registerShowPassword from '../../../components/showPassword';
import createError from '../../../components/error/index';
import isBlankString from "../../../utils/isBlankString";
import genJsonPayload from "../../../utils/genJsonPayload";
import getFormUrl from "../../../utils/getFormUrl";
import registerShowPassword from "../../../components/showPassword";
import createError from "../../../components/error/index";
//import '../forms.scss';
export const getPassword = () => {
const passwordElement = <HTMLInputElement>document.getElementById('password');
export const getPassword = (): string | null => {
const passwordElement = <HTMLInputElement>document.getElementById("password");
if (passwordElement === null) {
console.debug('Password is null');
console.debug("Password is null");
return;
}
return passwordElement.value;
};
const login = async (e: Event) => {
const login = async (e: Event): Promise<void> => {
e.preventDefault();
const loginElement = <HTMLInputElement>document.getElementById('login');
const loginElement = <HTMLInputElement>document.getElementById("login");
if (loginElement === null) {
console.debug('login element element is null');
console.debug("login element element is null");
return;
}
const login = loginElement.value;
isBlankString(login, 'username', e);
isBlankString(login, "username", e);
const password = getPassword();
@@ -65,9 +65,9 @@ const login = async (e: Event) => {
}
};
export const index = () => {
const form = <HTMLFontElement>document.getElementById('form');
form.addEventListener('submit', login, true);
export const index = (): void => {
const form = <HTMLFontElement>document.getElementById("form");
form.addEventListener("submit", login, true);
registerShowPassword();
init();
};