@theforeman/eslint-plugin-rules

13.1.0 • Public • Published

Eslint Plugin Rules

About

Place for eslint custom rules for Foreman and plugins

Usage

Create an eslintrc file

{
  "plugins": ["@theforeman/rules"],
  "rules": {
    "@theforeman/rules/require-ouiaid": "warn",
  }
}

ouiaId prop is used in automation tests. An example can be found here.

If not specified in the eslintrc file, these components will be checked for an ouiaId prop:

  "Alert",
  "Breadcrumb",
  "Button",
  "Card",
  "Checkbox",
  "Chip",
  "ChipGroup",
  "ContextSelector",
  "Dropdown",
  "DropdownItem",
  "DropdownSeparator",
  "DropdownToggle",
  "DropdownToggleCheckbox",
  "FormSelect",
  "Menu",
  "Modal",
  "ModalBoxCloseButton",
  "ModalContent",
  "Nav",
  "NavExpandable",
  "NavItem",
  "OptionsMenu",
  "Pagination",
  "Radio",
  "RowWrapper",
  "Select",
  "Switch",
  "TabButton",
  "TabContent",
  "Tabs",
  "Text",
  "TextInput",
  "Title",
  "Toolbar",
  "Table",
  "TableComposable",
  "Tr"

You can specify what components you want to check against.

{
  "plugins": ["@theforeman/rules"],
  "rules": {
    "@theforeman/rules/require-ouiaid": [
      "warn",
      "Button",
      "Table",
    ]
  }

Here is the list of OUIA-compliant PatternFly 4 components.

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @theforeman/eslint-plugin-rules

    Weekly Downloads

    1,620

    Version

    13.1.0

    License

    MIT

    Unpacked Size

    7.44 kB

    Total Files

    6

    Last publish

    Collaborators

    • sharvita
    • amirfefer