Skip to content

Change filter front matter key to filterOut for v2.x #2522

Open
@Zearin

Description

@Zearin

Is your feature request related to a problem? Please describe.
When writing a .filter( … ) function in JavaScript, I tend to think of it as “Filter FOR «truthy condition»”. In other words, I think in terms of what I want to include.

But the filter front matter key filters based on what you want to exclude.

Describe the solution you'd like
For more human-friendliness, I recommend changing the name of this key to filterOut for the official v2.x release of Eleventy.

Describe alternatives you've considered
Optionally, you could allow Eleventy to continue support for filter with a deprecation warning.

(You could also keep the filter keyword, and flip the logic that Eleventy uses…but that is hostile to users that have become used to the current behavior.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking-changeThis will have to be included with a major version as it breaks backwards compatibility.enhancement

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions