Skip to content

New rules regarding namespaces used as values #532

Open
@dead-claudia

Description

@dead-claudia

The following patterns are considered not warnings:

import * as foo from "./foo";

foo.bar();
const baz = foo.baz;
const {property} = foo;

The following patterns are considered warnings:

import * as foo from "./foo";

foo();
const [value] = foo;
func(foo);
func(...foo);
const alias = foo;
const {child} = foo; // foo.child is an exported namespace

Basically, warn if a namespace is used in a way that cannot be validated (aliased, called, destructured as array, passed as argument, etc.). There's no overlap with namespace.allowComputed in the above, but that option could be merged into this one, or these merged into another namespace option.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions