diff --git a/.eslintrc.js b/.eslintrc.js index b7962fddda881a..18f8d279c9946f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -357,6 +357,26 @@ module.exports = { 'jsdoc/require-param': 'off', }, }, + { + files: [ 'packages/components/src/**' ], + excludedFiles: [ 'packages/components/src/utils/colors-values.js' ], + rules: { + 'no-restricted-syntax': [ + 'error', + { + selector: 'Literal[value=/--wp-admin-theme-/]', + message: + '--wp-admin-theme-* variables do not support component theming. Use variables from the COLORS object in packages/components/src/utils/colors-values.js instead.', + }, + { + selector: + 'TemplateElement[value.cooked=/--wp-admin-theme-/]', + message: + '--wp-admin-theme-* variables do not support component theming. Use variables from the COLORS object in packages/components/src/utils/colors-values.js instead.', + }, + ], + }, + }, { files: [ 'packages/components/src/**' ], excludedFiles: [ 'packages/components/src/**/@(test|stories)/**' ],