kibana/packages/kbn-eslint-plugin-disable/README.mdx
Tiago Costa b1c7efff8a
chore(NA): prevent disabling eslint protected rules (#137066)
* chore(NA): introduce barebones for no_protected_eslint_disable rule

* chore(NA): includes schema for protected eslint

* chore(NA): more progress on the rule

* chore(NA): first working logic for the rule

* fix(NA): correctly match allowed exclusions

* refact(NA): final refactor to complete rule

* chore(NA): remove non needed additional types

* fix(NA): remove wrongly left custom type

* refact(NA): create parseEslintDisableComment function

* refact(NA): remove option to configure disabled protected rules from configuration

* chore(NA): Update packages/kbn-eslint-plugin-disable/src/helpers/regex.ts

Co-authored-by: Spencer <email@spalger.com>

* refact(NA): use a const instead of function to setup protected rules

* chore(NA): run eslint fix

* refact(NA): removed unused functionality

* add failing test

* refact(NA): rebuild entire comment line on fixing

* refact(NA): joining with a space in between

* chore(NA): improved comparision logic

Co-authored-by: Spencer <email@spalger.com>
Co-authored-by: spalger <spencer@elastic.co>
2022-07-26 16:40:01 -07:00

17 lines
No EOL
946 B
Text

---
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.