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

@@ -15,13 +15,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {Level} from './index';
import CONST from '../const';
import { Level } from "./index";
import CONST from "../const";
import log from '../../../../../logger';
import log from "../../../../../logger";
/** Fetches level from DOM using the ID passesd and validates */
const getLevelFields = (id: number) => {
const getLevelFields = (id: number): Level => {
log.debug(`[getLevelFields]: id: ${id}`);
const visitorID = CONST.VISITOR_WITHOUT_LEVEL + id.toString();
const difficultyID = CONST.DIFFICULTY_WITHOUT_LEVEL + id.toString();
@@ -35,11 +35,11 @@ const getLevelFields = (id: number) => {
const difficulty_factor = parseInt(difficultyElement.value);
if (Number.isNaN(visitor_threshold)) {
throw new Error('visitor can contain nubers only');
throw new Error("visitor can contain nubers only");
}
if (Number.isNaN(difficulty_factor)) {
throw new Error('difficulty can contain nubers only');
throw new Error("difficulty can contain nubers only");
}
const level: Level = {
@@ -48,7 +48,7 @@ const getLevelFields = (id: number) => {
};
log.debug(
`[getLevelFields.ts] visitor: ${visitor_threshold} difficulty: ${difficulty_factor}`,
`[getLevelFields.ts] visitor: ${visitor_threshold} difficulty: ${difficulty_factor}`
);
return level;