From df8c7a33b9dad303fdf65e4e9e98ca0bb9cfaab0 Mon Sep 17 00:00:00 2001 From: Melissa Liu Date: Tue, 10 Dec 2024 14:41:14 -0800 Subject: [PATCH] address comments to highlight nonstandard css --- .../__tests__/stylex-valid-styles-test.js | 16 ++++++++-------- .../eslint-plugin/src/stylex-valid-styles.js | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/eslint-plugin/__tests__/stylex-valid-styles-test.js b/packages/eslint-plugin/__tests__/stylex-valid-styles-test.js index 7e4f8723..78ef1011 100644 --- a/packages/eslint-plugin/__tests__/stylex-valid-styles-test.js +++ b/packages/eslint-plugin/__tests__/stylex-valid-styles-test.js @@ -617,35 +617,35 @@ eslintTester.run('stylex-valid-styles', rule.default, { errors: [ { message: - 'The key "marginStart" is not allowed by stylex. Use "marginInlineStart" instead.', + 'The key "marginStart" is not a standard CSS property. Did you mean "marginInlineStart"?', }, { message: - 'The key "marginEnd" is not allowed by stylex. Use "marginInlineEnd" instead.', + 'The key "marginEnd" is not a standard CSS property. Did you mean "marginInlineEnd"?', }, { message: - 'The key "marginHorizontal" is not allowed by stylex. Use "marginInline" instead.', + 'The key "marginHorizontal" is not a standard CSS property. Did you mean "marginInline"?', }, { message: - 'The key "marginVertical" is not allowed by stylex. Use "marginBlock" instead.', + 'The key "marginVertical" is not a standard CSS property. Did you mean "marginBlock"?', }, { message: - 'The key "paddingStart" is not allowed by stylex. Use "paddingInlineStart" instead.', + 'The key "paddingStart" is not a standard CSS property. Did you mean "paddingInlineStart"?', }, { message: - 'The key "paddingEnd" is not allowed by stylex. Use "paddingInlineEnd" instead.', + 'The key "paddingEnd" is not a standard CSS property. Did you mean "paddingInlineEnd"?', }, { message: - 'The key "paddingHorizontal" is not allowed by stylex. Use "paddingInline" instead.', + 'The key "paddingHorizontal" is not a standard CSS property. Did you mean "paddingInline"?', }, { message: - 'The key "paddingVertical" is not allowed by stylex. Use "paddingBlock" instead.', + 'The key "paddingVertical" is not a standard CSS property. Did you mean "paddingBlock"?', }, ], output: ` diff --git a/packages/eslint-plugin/src/stylex-valid-styles.js b/packages/eslint-plugin/src/stylex-valid-styles.js index 733cfc95..584a5ddb 100644 --- a/packages/eslint-plugin/src/stylex-valid-styles.js +++ b/packages/eslint-plugin/src/stylex-valid-styles.js @@ -2674,7 +2674,7 @@ const stylexValidStyles = { message: replacementKey && (style.key.type === 'Identifier' || style.key.type === 'Literal') - ? `The key "${originalKey}" is not allowed by stylex. Use "${replacementKey}" instead.` + ? `The key "${originalKey}" is not a standard CSS property. Did you mean "${replacementKey}"?` : 'This is not a key that is allowed by stylex', fix: (fixer) => { if (replacementKey) {