kibana/packages/kbn-eslint-plugin-eslint/rules/no_deprecated_imports.js
Anton Dosov 0dbbf482a5
[Lint] Officially deprecate Enzyme (#221779)
## Summary

Please see for
[context](https://docs.google.com/document/d/1J9mGfmGukgFS-6jqD1zopH8wIRvsqNhDhQbjQZ9hjEY/edit?tab=t.hzzf0a72f9gd)

This PR tries to discourage usage of enzyme: 

- Mark shared test utils that use enzyme as `@deprecated` 
- Add eslint warning for imports of `enzyme` 
- Add ci stat counter of imports of `enzyme`
2025-06-03 12:15:37 +02:00

19 lines
829 B
JavaScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
const Linter = require('eslint').Linter;
const coreRule = new Linter().getRules().get('no-restricted-imports');
/**
* This rule is used to prevent the use of deprecated imports in Kibana code.
* It is a wrapper around the core ESLint rule `no-restricted-imports` with
* a different id to avoid conflicts with the core rule.
*/
module.exports = coreRule;