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

[New] no-dynamic-require: add option esmodule #1223

Merged
merged 1 commit into from
Aug 5, 2021

Conversation

vikr01
Copy link
Contributor

@vikr01 vikr01 commented Oct 26, 2018

Requested in #700.

Adds an option esmodule to no-dynamic-require that defaults to false.

I think it'd be nice if no-dynamic-require was renamed to something like no-nonliteral-import, since it is confusing with import() being called "dynamic import".

@vikr01 vikr01 force-pushed the feature/no-nonliteral-import branch from 836eeab to 065f3f1 Compare October 26, 2018 03:46
@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 97.365% when pulling 065f3f1 on vikr01:feature/no-nonliteral-import into db471a8 on benmosher:master.

5 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 97.365% when pulling 065f3f1 on vikr01:feature/no-nonliteral-import into db471a8 on benmosher:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 97.365% when pulling 065f3f1 on vikr01:feature/no-nonliteral-import into db471a8 on benmosher:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 97.365% when pulling 065f3f1 on vikr01:feature/no-nonliteral-import into db471a8 on benmosher:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 97.365% when pulling 065f3f1 on vikr01:feature/no-nonliteral-import into db471a8 on benmosher:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 97.365% when pulling 065f3f1 on vikr01:feature/no-nonliteral-import into db471a8 on benmosher:master.

@coveralls
Copy link

coveralls commented Oct 26, 2018

Coverage Status

Coverage increased (+0.009%) to 97.365% when pulling 97a7a44 on vikr01:feature/no-nonliteral-import into db471a8 on benmosher:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 97.365% when pulling 065f3f1 on vikr01:feature/no-nonliteral-import into db471a8 on benmosher:master.

src/rules/no-dynamic-require.js Outdated Show resolved Hide resolved
src/rules/no-dynamic-require.js Outdated Show resolved Hide resolved
@vikr01 vikr01 force-pushed the feature/no-nonliteral-import branch from 065f3f1 to 97a7a44 Compare October 26, 2018 06:19
@ljharb ljharb force-pushed the feature/no-nonliteral-import branch 2 times, most recently from 9099fd2 to 7163824 Compare August 5, 2021 01:15
@ljharb ljharb changed the title Add option esmodule to no-dynamic-require [New] no-dynamic-require: add option esmodule Aug 5, 2021
@ljharb ljharb merged commit 7163824 into import-js:master Aug 5, 2021
@vikr01 vikr01 deleted the feature/no-nonliteral-import branch August 5, 2021 20:49
@sindresorhus
Copy link

This pull request is missing documentation updates.

@ljharb
Copy link
Member

ljharb commented Aug 9, 2021

Thanks, you’re right. @vikr01 mind sending a PR for that?

@dasa
Copy link

dasa commented Sep 9, 2021

I'm unable to get this working in TypeScript. The new tests all include parser: require.resolve('babel-eslint'). Is this expected?

@ljharb
Copy link
Member

ljharb commented Sep 9, 2021

@dasa want to open a PR that duplicates those test cases, but with the TS parser?

@dasa
Copy link

dasa commented Apr 26, 2022

This is working in TypesScript now, but the esmodule option is missing from the doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants