kibana/packages/kbn-eslint-plugin-disable
Gerard Soldevila 7b820130ab
[8.x] Add ESLINT constraints to detect inter-group dependencies (#194810) (#197670)
# Backport

This will backport the following commits from `main` to `8.x`:
- [Add ESLINT constraints to detect inter-group dependencies
(#194810)](https://github.com/elastic/kibana/pull/194810)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Gerard
Soldevila","email":"gerard.soldevila@elastic.co"},"sourceCommit":{"committedDate":"2024-10-22T11:34:19Z","message":"Add
ESLINT constraints to detect inter-group dependencies (#194810)\n\n##
Summary\r\n\r\nAddresses
https://github.com/elastic/kibana-team/issues/1175\r\n\r\nAs part of the
**Sustainable Kibana Architecture** initiative, this PR\r\nsets the
foundation to start classifying plugins in isolated groups,\r\nmatching
our current solutions / project types:\r\n\r\n* It adds support for the
following fields in the packages' manifests\r\n(kibana.jsonc):\r\n*
`group?: 'search' | 'security' | 'observability' | 'platform'
|\r\n'common'`\r\n * `visibility?: 'private' | 'shared'`\r\n\r\n* It
proposes a folder structure to automatically infer
groups:\r\n```javascript\r\n 'src/platform/plugins/shared': {\r\n group:
'platform',\r\n visibility: 'shared',\r\n },\r\n
'src/platform/plugins/internal': {\r\n group: 'platform',\r\n
visibility: 'private',\r\n },\r\n 'x-pack/platform/plugins/shared':
{\r\n group: 'platform',\r\n visibility: 'shared',\r\n },\r\n
'x-pack/platform/plugins/internal': {\r\n group: 'platform',\r\n
visibility: 'private',\r\n },\r\n
'x-pack/solutions/observability/plugins': {\r\n group:
'observability',\r\n visibility: 'private',\r\n },\r\n
'x-pack/solutions/security/plugins': {\r\n group: 'security',\r\n
visibility: 'private',\r\n },\r\n 'x-pack/solutions/search/plugins':
{\r\n group: 'search',\r\n visibility: 'private',\r\n },\r\n```\r\n\r\n*
If a plugin is moved to one of the specific locations above, the
group\r\nand visibility in the manifest (if specified) must match those
inferred\r\nfrom the path.\r\n* Plugins that are not relocated are
considered: `group: 'common',\r\nvisibility: 'shared'` by default. As
soon as we specify a custom\r\n`group`, the ESLINT rules will check
violations against dependencies /\r\ndependants.\r\n\r\nThe ESLINT rules
are pretty simple:\r\n* Plugins can only depend on:\r\n * Plugins in the
same group\r\n * OR plugins with `'shared'` visibility\r\n* Plugins in
`'observability', 'security', 'search'` groups are\r\nmandatorily
`'private'`.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"2a085e103afe8c7bdfb626d0dc683fc8be0e6c05","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","backport
missing","v9.0.0","release_note:feature","backport:prev-minor"],"number":194810,"url":"https://github.com/elastic/kibana/pull/194810","mergeCommit":{"message":"Add
ESLINT constraints to detect inter-group dependencies (#194810)\n\n##
Summary\r\n\r\nAddresses
https://github.com/elastic/kibana-team/issues/1175\r\n\r\nAs part of the
**Sustainable Kibana Architecture** initiative, this PR\r\nsets the
foundation to start classifying plugins in isolated groups,\r\nmatching
our current solutions / project types:\r\n\r\n* It adds support for the
following fields in the packages' manifests\r\n(kibana.jsonc):\r\n*
`group?: 'search' | 'security' | 'observability' | 'platform'
|\r\n'common'`\r\n * `visibility?: 'private' | 'shared'`\r\n\r\n* It
proposes a folder structure to automatically infer
groups:\r\n```javascript\r\n 'src/platform/plugins/shared': {\r\n group:
'platform',\r\n visibility: 'shared',\r\n },\r\n
'src/platform/plugins/internal': {\r\n group: 'platform',\r\n
visibility: 'private',\r\n },\r\n 'x-pack/platform/plugins/shared':
{\r\n group: 'platform',\r\n visibility: 'shared',\r\n },\r\n
'x-pack/platform/plugins/internal': {\r\n group: 'platform',\r\n
visibility: 'private',\r\n },\r\n
'x-pack/solutions/observability/plugins': {\r\n group:
'observability',\r\n visibility: 'private',\r\n },\r\n
'x-pack/solutions/security/plugins': {\r\n group: 'security',\r\n
visibility: 'private',\r\n },\r\n 'x-pack/solutions/search/plugins':
{\r\n group: 'search',\r\n visibility: 'private',\r\n },\r\n```\r\n\r\n*
If a plugin is moved to one of the specific locations above, the
group\r\nand visibility in the manifest (if specified) must match those
inferred\r\nfrom the path.\r\n* Plugins that are not relocated are
considered: `group: 'common',\r\nvisibility: 'shared'` by default. As
soon as we specify a custom\r\n`group`, the ESLINT rules will check
violations against dependencies /\r\ndependants.\r\n\r\nThe ESLINT rules
are pretty simple:\r\n* Plugins can only depend on:\r\n * Plugins in the
same group\r\n * OR plugins with `'shared'` visibility\r\n* Plugins in
`'observability', 'security', 'search'` groups are\r\nmandatorily
`'private'`.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"2a085e103afe8c7bdfb626d0dc683fc8be0e6c05"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194810","number":194810,"mergeCommit":{"message":"Add
ESLINT constraints to detect inter-group dependencies (#194810)\n\n##
Summary\r\n\r\nAddresses
https://github.com/elastic/kibana-team/issues/1175\r\n\r\nAs part of the
**Sustainable Kibana Architecture** initiative, this PR\r\nsets the
foundation to start classifying plugins in isolated groups,\r\nmatching
our current solutions / project types:\r\n\r\n* It adds support for the
following fields in the packages' manifests\r\n(kibana.jsonc):\r\n*
`group?: 'search' | 'security' | 'observability' | 'platform'
|\r\n'common'`\r\n * `visibility?: 'private' | 'shared'`\r\n\r\n* It
proposes a folder structure to automatically infer
groups:\r\n```javascript\r\n 'src/platform/plugins/shared': {\r\n group:
'platform',\r\n visibility: 'shared',\r\n },\r\n
'src/platform/plugins/internal': {\r\n group: 'platform',\r\n
visibility: 'private',\r\n },\r\n 'x-pack/platform/plugins/shared':
{\r\n group: 'platform',\r\n visibility: 'shared',\r\n },\r\n
'x-pack/platform/plugins/internal': {\r\n group: 'platform',\r\n
visibility: 'private',\r\n },\r\n
'x-pack/solutions/observability/plugins': {\r\n group:
'observability',\r\n visibility: 'private',\r\n },\r\n
'x-pack/solutions/security/plugins': {\r\n group: 'security',\r\n
visibility: 'private',\r\n },\r\n 'x-pack/solutions/search/plugins':
{\r\n group: 'search',\r\n visibility: 'private',\r\n },\r\n```\r\n\r\n*
If a plugin is moved to one of the specific locations above, the
group\r\nand visibility in the manifest (if specified) must match those
inferred\r\nfrom the path.\r\n* Plugins that are not relocated are
considered: `group: 'common',\r\nvisibility: 'shared'` by default. As
soon as we specify a custom\r\n`group`, the ESLINT rules will check
violations against dependencies /\r\ndependants.\r\n\r\nThe ESLINT rules
are pretty simple:\r\n* Plugins can only depend on:\r\n * Plugins in the
same group\r\n * OR plugins with `'shared'` visibility\r\n* Plugins in
`'observability', 'security', 'search'` groups are\r\nmandatorily
`'private'`.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"2a085e103afe8c7bdfb626d0dc683fc8be0e6c05"}}]}]
BACKPORT-->
2024-10-24 13:20:30 -07:00
..
src [8.x] Add ESLINT constraints to detect inter-group dependencies (#194810) (#197670) 2024-10-24 13:20:30 -07:00
index.ts Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
jest.config.js Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
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
README.mdx
tsconfig.json Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00

---
id: kibDevDocsOpsEslintPluginDisable
slug: /kibana-dev-docs/ops/kbn-eslint-plugin-disable
title: "@kbn/eslint-plugin-disable"
description: Custom ESLint rules for managing eslint rules disable in the Kibana repository
tags: ['kibana', 'dev', 'contributor', 'operations', 'eslint', 'disable']
---

`@kbn/eslint-plugin-disable` is an ESLint plugin providing custom rules to allow us to enforce specific eslint rules behaviours around eslint disables that we need to implement Bazel packages across the monorepo as our main development unit.

## `@kbn/disable/no_naked_eslint_disable`

Disallows the usage of naked eslint-disable comments without being specific about each rule to disable.

## `@kbn/disable/no_protected_eslint_disable`

Disallows the eslint-disable comments with specific protected rules that were built to not be disabled. Please contact the Kibana Operations team if you have a justifiable use case for disabling one of them.