You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to give an example with AngularJS-centerd code, where function arguments have different meaning then the rest of JS world.
To ensure the diff to be as meaningful as possible I'd like to be able to declare dependency injection arguments line-by-line and make sure adding another won't modify the line history on any other line than the one I'm adding/modifying:
angular.module('myModule',[]).service('myService',function(dependencyService1,dependencyService2,dependencyService3){// service logic})
(I'm not using array DI syntax for the sake of brevity)
If I want to add fourth dependency as the last argument (I'd probably do exactly that if I want my dependencies to be organised alphabetically or by some custom logic - whatever) I get this:
angular.module('myModule',[]).service('myService',function(dependencyService1,dependencyService2,dependencyService3,// changed line: added commadependencyService4// added line){// service logic})
With last comma the example looks almost exactly the same:
angular.module('myModule',[]).service('myService',function(dependencyService1,dependencyService2,dependencyService3,// please notice the last comma){// service logic})
angular.module('myModule',[]).service('myService',function(dependencyService1,dependencyService2,dependencyService3,// please notice: no change in this linedependencyService4,// added line: the change I've made is a one-liner, by diff is more meaningful!){// service logic})
What I'd like to do is to be able to use last comma syntax and still use eslint, but it's not possible since code using commas after last function argument are not parsed by espree yet.
Repeating my comment from #208 (comment):
This proposal advanced today to stage 4 at the July TC39 meeting (tc39/proposals@6826a19), which means it's past time to support it :-)
This is a re-submission of #208
I'd like to give an example with AngularJS-centerd code, where function arguments have different meaning then the rest of JS world.
To ensure the diff to be as meaningful as possible I'd like to be able to declare dependency injection arguments line-by-line and make sure adding another won't modify the line history on any other line than the one I'm adding/modifying:
(I'm not using array DI syntax for the sake of brevity)
If I want to add fourth dependency as the last argument (I'd probably do exactly that if I want my dependencies to be organised alphabetically or by some custom logic - whatever) I get this:
With last comma the example looks almost exactly the same:
What I'd like to do is to be able to use last comma syntax and still use eslint, but it's not possible since code using commas after last function argument are not parsed by espree yet.
I know this syntax is not yet production ready, but for transpilers (namely: babel) stripping this one comma is not a problem
The text was updated successfully, but these errors were encountered: