wcjohnson / lightscript

A futuristic fork of the LightScript language.
http://wcjohnson.github.io/lightscript
7 stars 0 forks source link

Lint rule: `no-spread-loop-tail-expressions` #112

Open wcjohnson opened 6 years ago

wcjohnson commented 6 years ago

Proposed rule which would warn when a spread loop has a tail expression which is not a compatible object or array.

Legal:

// Thing being spread is an ArrayExpression, OK.
x = [...for elem e in arr: [f(e)]]

Illegal:

// The thing being spread here is not an ArrayExpression, therefore illegal under the rule
x = [...for elem e in arr: f(e)]