-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Resolve deprecation warning message from eslint while running eslint #1586
Conversation
There was a DeprecationWarning message from eslint saying that `ecmaFeatures` property has been deprecated. Moved it under the `parserOptions` as per recommended here - https://eslint.org/docs/user-guide/migrating-to-2.0.0.
The comment in the eslint config indicates that not all es6 features should be enabled. Object.assign for example does not work in IE and we don't use polyfills. Its a good thing to fix the config. Could you do it so that the list of features is used again? |
It would also be helpful to have the disable es6-language at all for the files in the It has happend a couple of times that I wrote a test and everything was find when I ran the tests locally. But when they were executed in SauceLabs with IE11, there was an error. It doesn't have to be in this PR, but it is something to keep in mind. |
Hi @nknapp, Actually, they aren't being removed; but it's just that explicitly setting them under So, that being said there isn't actually any change done in the config. These are default features of Ecma Script that eslint already knows once you set the version now. Check this: Also, as per the deprecation warning - even if you do set them it has no effect now.
Let me know your thoughts on this. |
Are there any features that are allowed by eslint after your change that weren't allowed when the |
I think I misunderstood what the "ecmaFeatures" was doing exactly. But still rules for avoiding "Object.assign" and other things that break in IE or Safari, would be great. That's another matter however. |
I have added the |
Hi @nknapp, Thanks! Regarding your comment:
I'll check if there are rules available for these use cases and can do a PR if possible. |
Eslint-plugin-compat is doing that. Check for Object.assign etc. |
Issue
Running
grunt eslint
or ESLint CLI directly throws this deprecation warning since it was configured as per the older version of eslint:Changes
I followed this Migrating to v2.0.0 to update the configuration as per the recommendation which fixed the deprecation message.
ecmaFeatures
property is now under a top-levelparserOptions
property."ecmaVersion": 6
since we're using ES6."es6": true
underenv
.ecmaVersion: 6
. Check the ESLint migration guidelines for details - https://eslint.org/docs/user-guide/migrating-to-2.0.0#language-options.Now
After these changes you shouldn't see the
DeprecationWarning
like before.You can also check the travis build logs - for 4.x branch and for the PR 1586 and see that the warning isn' showing up now.
Before creating a pull-request, please check https://github.com/wycats/handlebars.js/blob/master/CONTRIBUTING.md first.
Generally we like to see pull requests that
4.x
-branch contains the latest version. Please target that branch in the PR.