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

Allow usage of mjs #154

Merged
merged 4 commits into from
Mar 15, 2022
Merged

Allow usage of mjs #154

merged 4 commits into from
Mar 15, 2022

Conversation

DavidArchibald
Copy link
Contributor

I requested #131 in order to fix some problems with Yarn 2/3 and cjs but I recently found out that mjs may be a better solution.

.eslintrc.cjs Outdated
@@ -5,7 +5,7 @@ module.exports = {
ecmaVersion: 2020,
project: './tsconfig.eslint.json',
sourceType: 'module',
extraFileExtensions: ['.cjs'],
extraFileExtensions: ['.cjs', '.mjs'],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not needed, is it? foundry-factory itself doesn't use .mjs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was undecided on whether to add this or not just because I didn't know if foundry-factory would want to be consistent with the templates it provides. I'll revert this.

@@ -122,7 +122,11 @@ export class GhostGulpRollupPreset implements Preset {
name: 'TypeScript',
value: 'typescript',
},
{ name: 'Linter & Formatter (ESLint & Prettier)', value: 'linter', checked: true },
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please revert these formatting changes. Applies to other reformatted objects, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... I'm unsure of how they got there in the first place. For sure I wasn't seeking out changes like this, I think it just happened when I ran prettier which is strange, maybe my print width wasn't set wide enough?

@@ -27,13 +28,13 @@ module.exports = {

overrides: [{% if useTypeScript %}
{
files: ['./*.cjs'],
files: ['./*.cjs', './*.mjs'],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look right to me: In .mjs files, we shouldn't allow var requires as they are es modules, so they should use import instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I'd misunderstood what the template was doing trying to put mjs alongside cjs, good catch!

@DavidArchibald DavidArchibald requested a review from ghost91- March 10, 2022 07:02
@ghost91- ghost91- merged commit ee7de94 into ghost-fvtt:master Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants