From b747ec8f2400f059de7cd46ea3d4f17fe3a7f3df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=A4ggmark?= Date: Fri, 12 Sep 2025 10:26:50 +0200 Subject: [PATCH] Chore: prevents imports from grafana packages in i18n (#111000) --- eslint.config.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/eslint.config.js b/eslint.config.js index 508d40808a4..a00588a17db 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -552,4 +552,24 @@ module.exports = [ 'no-barrel-files/no-barrel-files': 'error', }, }, + + { + // @grafana/i18n shouldn't import from our 'library' NPM packages + name: 'grafana/packages-that-i18n-cant-import', + files: ['packages/grafana-i18n/**/*.{ts,tsx}'], + ignores: [], + rules: { + 'no-restricted-imports': [ + 'error', + withBaseRestrictedImportsConfig({ + patterns: [ + { + group: ['@grafana/*'], + message: "'@grafana/* packages' should not be imported in @grafana/i18n", + }, + ], + }), + ], + }, + }, ];