kibana/packages/kbn-eslint-config
Weronika Olejniczak 7e46d2e756
chore: update eslint-plugin-eui to 0.1.1 (#210082)
## Summary

Bring in the changes from https://github.com/elastic/eui/pull/8304,
specifically ESLint rules:

- `no-restricted-eui-imports`
- `no-css-color` (migrated from `@kbn/eslint-plugin-css`)
- `prefer-css-attribute-for-eui-components` (migrated from
`@kbn/eslint-plugin-css`)

Relates to https://github.com/elastic/eui/issues/8201,
https://github.com/elastic/eui-private/issues/275

## QA

### Instructions

1. Checkout this branch: `gh pr checkout 210082`.
2. Reinstall dependencies: `yarn kbn bootstrap`.
3. See output of ESLint. There should be no errors.
4. Test below cases.

### Test cases

#### `no-restricted-eui-imports`

Example files:

- JSON imports: `src/platform/packages/shared/kbn-ui-theme/src/theme.ts`
- `@kbn/ui-theme`:
`src/platform/plugins/private/vis_types/vega/public/data_model/utils.ts`

#### `no-css-color`

Example file:
`src/platform/plugins/shared/kibana_react/public/page_template/no_data_page/no_data_card/elastic_agent_card.tsx:50`

![Screenshot 2025-02-26 at 15 01
53](https://github.com/user-attachments/assets/ec6f49bd-5832-4d1c-9cfd-74c40ad5498e)

#### `prefer-css-attribute-for-eui-components`

Example file:
`x-pack/examples/alerting_example/public/alert_types/always_firing.tsx:166`
2025-04-02 14:06:17 +02:00
..
.eslintrc.js chore: update eslint-plugin-eui to 0.1.1 (#210082) 2025-04-02 14:06:17 +02:00
.gitignore
javascript.js Remove eslint-plugin-prefer-object-spread dependency (#162439) 2023-07-25 10:04:44 +02:00
jest.js
kibana.jsonc Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
package.json Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
react.js Upgrade ESLint React plugins (#162464) 2023-07-28 10:43:53 +02:00
README.mdx Initialize ops documentation section (#132262) 2022-05-17 15:22:38 -05:00
restricted_globals.js
typescript.js [ES|QL] unskip autocomplete tests (#182273) 2024-05-02 09:37:50 -05:00

---
id: kibDevDocsOpsEslintConfig
slug: /kibana-dev-docs/ops/eslint-config
title: "@kbn/eslint-config"
description: A package holding the main eslint configs on Kibana
date: 2022-05-16
tags: ['kibana', 'dev', 'contributor', 'operations', 'eslint', 'custom', 'config']
---

This package is used to group and provide the eslint configurations used by the Kibana team.
It defines default plugins, env, parserOptions and rules for javascript, typescript, and react code bases. 
Optionally it can also be used with jest as explained below.

## Usage

To use this eslint config, it needs to be referenced in the `.eslintrc` file:

```javascript
module.exports = {
  extends: [
    '@kbn/eslint-config'
  ]
}
```

## Optional jest eslint config

If [jest test runner](https://facebook.github.io/jest/) is used, 
the `@kbn/eslint-config/jest` config can be extended as well to use 
`eslint-plugin-jest` and add settings specific to it:

```javascript
module.exports = {
  extends: [
    '@kbn/eslint-config',
    '@kbn/eslint-config/jest'
  ]
}
```