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

package creates variable names starting with numbers #29

Open
RobertSandiford opened this issue Nov 1, 2022 · 0 comments
Open

package creates variable names starting with numbers #29

RobertSandiford opened this issue Nov 1, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@RobertSandiford
Copy link

  • Version: 2.1.2
  • TypeScript Version:
  • Operating System and version (if applicable): Win
  • Node Version (if applicable): 14

Description

cjstoesm creates invalid variable names beginning with numbers

// input

'use strict'
var low = require('./lib/core.js')
module.exports = low
low.registerLanguage('1c', require('highlight.js/lib/languages/1c'))
low.registerLanguage('abnf', require('highlight.js/lib/languages/abnf'))

Actual Behavior

// output

import * as low from "./lib/core.js";
import 1c from "highlight.js/lib/languages/1c";
import abnf from "highlight.js/lib/languages/abnf";
'use strict';
low.registerLanguage('1c', 1c);
low.registerLanguage('abnf', abnf);
export default low;

Expected Behavior

// output

import * as low from "./lib/core.js";
import _1c from "highlight.js/lib/languages/1c"; // use underscore for valid var name
import abnf from "highlight.js/lib/languages/abnf";
'use strict';
low.registerLanguage('1c', _1c);
low.registerLanguage('abnf', abnf);
export default low;

@RobertSandiford RobertSandiford added the bug Something isn't working label Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant