Skip to main content

Idiomatic

Rules that enforce idiomatic code.

IDSummary
idiomatic/ambiguous-scope

Ambiguous metadata scope

idiomatic/boolean-assignment

Prefer if over boolean assignment

idiomatic/custom-has-key-construct

Custom function may be replaced by in and object.keys

idiomatic/custom-in-construct

Custom function may be replaced by in keyword

idiomatic/directory-package-mismatch

Directory structure should mirror package

idiomatic/equals-pattern-matching

Prefer pattern matching in function arguments

idiomatic/in-wildcard-key

Unnecessary wildcard key

idiomatic/no-defined-entrypoint

Missing entrypoint annotation

Type: Aggregate - only runs when more than one file is provided for linting

idiomatic/non-raw-regex-pattern

Use raw strings for regex patterns

Automatically fixable: Yes

idiomatic/prefer-set-or-object-rule

Prefer set or object rule over comprehension

idiomatic/single-item-in

Avoid in for single item collection

idiomatic/use-contains

Use the contains keyword

idiomatic/use-if

Use the if keyword

idiomatic/use-in-operator

Use in to check for membership

idiomatic/use-object-keys

Prefer to use object.keys

idiomatic/use-some-for-output-vars

Use some to declare output variables

idiomatic/use-strings-count

Use strings.count where possible