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
JSLint doesn't recognize array with index as an argument for a dynamic import #317
Comments
this looks like expected behavior since 2020-03-17: stmt("import", function () {
...
if (string.id !== "(string)") {
// cause: "import(aa)"
warn("expected_string_a", string);
} can you rewrite it instead as follows?
|
No, I need to loop through a dynamically created array of modules to import. I'm not using the await/async syntax for doing this. JSLint supports standard dynamic import statements, such as:
Or the same, this time written with variables:
It needs to accept array indexes, as well. The standard dynamic import statements allow programmers to use dynamic imports within a larger enclosing function that is not an async function itself. |
…s about dynamic-import. - bugfix - fix off-by-one-column bug in missing-semicolon-warning.
…s about dynamic-import. - bugfix - fix off-by-one-column bug in missing-semicolon-warning.
…s about dynamic-import. - bugfix - fix off-by-one-column bug in missing-semicolon-warning.
…rt. (#318) - bugfix - fix off-by-one-column bug in missing-semicolon-warning.
should be fixed. thx for reporting. |
- bugfix - fix await expression/statement inside catch-statement not registered by functionage.await. - bugfix - fix cli appending slash "/" to normalized filename. - bugfix - fix issue jslint-org#316, jslint-org#317 - jslint complains about dynamic-import. - bugfix - fix misleading warning describing alphabetical-order instead of ascii-order. - bugfix - fix off-by-one-column bug in missing-semicolon-warning. - bugfix - fix try-catch-block complaining about "Unexpected await" inside async-function. - directive - re-introduce `/*jslint name*/` to ignore "Bad property name" warning. - doc - add install-screenshots. - jslint - add new warning if case-statements are not sorted. - jslint - add warning for unexpected ? in example `aa=/.{0}?/`. - jslint - add warning for unexpected-expr in example `async function aa(){await 0;}`. - jslint-refactor-1 - make "stateful" variables scoped outside of jslint() "stateless" by moving them into jslint(). - jslint-refactor-2 - inline constants anticondition, bitwiseop, escapeable, and opener directly into code. - jslint-refactor-3 - inline regexp-functions quantifier(), ranges(), klass(), choice(), directly into code. - jslint-refactor-4 - document jslint process and each recursion-loop converted to while-loop. - remove unnecessary variables nr. - rename artifact-related variables a, b to let artifact_now, artifact_nxt. - rename functions make() to token_create(). - reorganize/rename "global" variables by topical-prefixes: artifact_xxx, export_xxx, from_xxx, import_xxx, line_xxx, mode_xxx, token_xxx - jslint-refactor-5 - split jslint-core-logic into 5-phases. - move phase-sub-functions out of function-jslint(). - move global-vars into state-object, that can be passed between functions. - migrate recursive-loops to while-loops in sub-function phase2_lex(). - move remaining global-vars into sub-functions or hardcode. - update functions artifact(), stop(), warn() with fallback-code `the_token = the_token || state.token_nxt;`. - website - add ui-loader-animation.
JSLint version: v2021.6.4-beta
Options: [x] in development [x] a browser
JSLint doesn't recognize array with index as an argument for a dynamic import
Error message:
The text was updated successfully, but these errors were encountered: