-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Acknowledge .mjs files #22
Conversation
eslint-common.json
Outdated
@@ -101,15 +101,15 @@ | |||
} | |||
}, | |||
{ | |||
"files": ["index.js"], | |||
"files": ["index.{js,mjs}"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a file ends in .mjs
, we could also automatically set the sourceType
to module
, but I've left that to the user, for now. At least this change makes it so they don't have to go deep into Sanctuary stuff to copy the overrides with small modifications.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a file ends in
.mjs
, we could also automatically set thesourceType
tomodule
, but I've left that to the user, for now.
This sounds to me like a useful inclusion. Could we specify **/*.mjs
in a separate entry to achieve this?
@@ -105,11 +109,11 @@ | |||
"globals": {"__doctest": false, "define": false, "module": false, "require": false, "self": false} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the rule from here. Modules don't have any of these globals.
eslint-common.json
Outdated
{ | ||
"files": ["*.mjs"], | ||
"parserOptions": {"sourceType": "module"} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested it, and it seems this rule correctly merges with overlapping rules. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
Shall we release this as v2.1.0 or as v3.0.0? |
That's a good question. I think the |
In cases where people were using |
After some consideration, I think it needs a 3.0.0. Releasing it as anything else would be like changing the rules during the game. I find that most changes to configuration bundles constitute major version bumps. |
Okay. Let's update to |
Similarly to sanctuary-js/sanctuary-scripts#17, this change allows authors to use
.mjs
files, and still have the Sanctuary tooling lint them by default.