Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate to ESM (ECMAScript Module) #115

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
module.exports = {
"env": {
"es6": true,
"node": true,
"es2021": true,
"jest": true
},
"parserOptions": {
"ecmaVersion": 2018
},
"extends": [
"eslint:recommended",
"plugin:jest/recommended"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"indent": [
"error",
2,
{
"SwitchCase": 1
"SwitchCase": 1
}
],
"linebreak-style": [
Expand All @@ -33,4 +34,4 @@ module.exports = {
"always"
]
}
};
}
10 changes: 5 additions & 5 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

TODO: params parsing and so on
#*/
'use strict';
const config = require('./src/config');
const Mapscii = require('./src/Mapscii');
const argv = require('yargs')
.option('latitude', {
import config from './src/config.js';
import Mapscii from './src/Mapscii.js';
import yargs from 'yargs';

const argv = yargs().option('latitude', {
alias: 'lat',
description: 'Latitude of initial centre',
default: config.initialLat,
Expand Down
Loading