From 579805d97d449b692e7d86e5f4d578b197406d73 Mon Sep 17 00:00:00 2001 From: fitsum Date: Thu, 4 Jul 2024 01:40:17 -0400 Subject: [PATCH] comment out default values for options + lint --- main.js | 88 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/main.js b/main.js index 462b9ed..3b61a9e 100644 --- a/main.js +++ b/main.js @@ -1,4 +1,4 @@ -/*# +/* # MapSCII - Terminal Map Viewer by Michael Strassburger Discover the planet in your console! @@ -6,65 +6,65 @@ This scripts boots up the application. TODO: params parsing and so on -#*/ -'use strict'; -const config = require('./src/config'); -const Mapscii = require('./src/Mapscii'); -const argv = require('yargs') - .option('latitude', { +# */ +'use strict' +const config = require( './src/config' ) +const Mapscii = require( './src/Mapscii' ) +const argv = require( 'yargs' ) + .option( 'latitude', { alias: 'lat', description: 'Latitude of initial centre', - default: config.initialLat, - type: 'number', - }) - .option('longitude', { + /* default: config.initialLat, */ + type: 'number' + } ) + .option( 'longitude', { alias: 'lon', description: 'Longitude of initial centre', - default: config.initialLon, - type: 'number', - }) - .option('zoom', { + /* default: config.initialLon, */ + type: 'number' + } ) + .option( 'zoom', { alias: 'z', description: 'Initial zoom', - default: config.initialZoom, - type: 'number', - }) - .option('width', { + /* default: config.initialZoom, */ + type: 'number' + } ) + .option( 'width', { alias: 'w', description: 'Fixed width of rendering', - type: 'number', - }) - .option('height', { + type: 'number' + } ) + .option( 'height', { alias: 'h', description: 'Fixed height of rendering', - type: 'number', - }) - .option('braille', { + type: 'number' + } ) + .option( 'braille', { alias: 'b', description: 'Activate braille rendering', default: config.useBraille, - type: 'boolean', - }) - .option('headless', { + type: 'boolean' + } ) + .option( 'headless', { alias: 'H', description: 'Activate headless mode', default: config.headless, - type: 'boolean', - }) - .option('tile_source', { + type: 'boolean' + } ) + .option( 'tile_source', { alias: 'tileSource', description: 'URL or path to osm2vectortiles source', default: config.source, - type: 'string', - }) - .option('style_file', { + type: 'string' + } ) + .option( 'style_file', { alias: 'style', description: 'path to json style file', default: config.styleFile, - type: 'string', - }) + type: 'string' + } ) .strict() - .argv; + .argv const options = { initialLat: argv.latitude, @@ -77,11 +77,11 @@ const options = { useBraille: argv.braille, headless: argv.headless, source: argv.tile_source, - styleFile: argv.style_file, -}; + styleFile: argv.style_file +} -const mapscii = new Mapscii(options); -mapscii.init().catch((err) => { - console.error('Failed to start MapSCII.'); - console.error(err); -}); +const mapscii = new Mapscii( options ) +mapscii.init().catch( ( err ) => { + console.error( 'Failed to start MapSCII.' ) + console.error( err ) +} )