Skip to content

Latest commit

 

History

History
53 lines (39 loc) · 1.04 KB

component-filename-suffix.md

File metadata and controls

53 lines (39 loc) · 1.04 KB

Enforces the file name of components to have a specified suffix (component-filename-suffix)

This rule enforces that file name of classes decorated with @Component must have suffix "component" (or custom) in their name.

Rule Details

This rule follows the recommendation from the Angular styleguide.

Examples of incorrect file name for this rule (with default configuration):

app.page.ts
app.view.ts
app.comp.ts

Example of correct file name for this rule:

app.component.ts

Options

By default, the suffix will be component. You may pass an array of suffixes, for example:

{
  "angular-file-naming/component-filename-suffix": [
    "error",
    {
      "suffixes": ["component", "page", "view", "component.mock"]
    }
  ]
}

Examples of incorrect file name with the above options:

app.comp.ts
app.com.ts
app.mock.ts

Example of correct file name with the above options:

app.component.ts
app.page.ts
app.view.ts
app.component.mock.ts