Open lll000111 opened 6 years ago
@lll000111 Currently this is also a feature of strict mode instead of lint rule.
@TrySound As I wrote: "This should be a linter rule". So that I can turn it off where needed.
@TrySound this means you can't seem to write functions like Lodash's _.once
in strict? You'd want to drop the reference to the argument to free it up for GC:
function once(fn) {
let called = false
return function(...args) {
if (!called) {
called = true
fn(...args)
fn = undefined
}
}
}
https://flow.org/en/docs/config/options/#toc-experimental-const-params-boolean
I can turn off lint rules using comments: https://flow.org/en/docs/linting/#toc-configuring-lints-with-comments
I cannot do that for
const_params
it seems. This should be a linter rule and not a global setting "on/off".