yousoph commented on code in PR #34437:
URL: https://github.com/apache/superset/pull/34437#discussion_r2248505796
##########
superset-frontend/eslint-rules/eslint-plugin-i18n-strings/index.js:
##########
@@ -52,5 +52,134 @@ module.exports = {
};
},
},
+ 'no-title-case': {
+ create(context) {
+ function checkTitleCase(str) {
+ // Skip strings with placeholders like %s, %d, %(name)s, etc.
+ if (/%[sdf]|%\([^)]+\)[sdf]/.test(str)) {
+ return false;
+ }
+
+ // Skip strings that are all uppercase (likely acronyms)
+ if (str === str.toUpperCase()) {
+ return false;
+ }
+
+ // Skip strings with periods (likely multiple sentences)
+ if (str.includes('.')) {
+ return false;
+ }
+
+ // Skip single words
+ const words = str.trim().split(/\s+/);
+ if (words.length <= 1) {
+ return false;
+ }
+
+ // Whitelist of words that are commonly capitalized in product names
+ // but should not trigger title case warnings
+ const productWords = [
+ 'Lab',
+ 'Server',
+ 'Studio',
+ 'Pro',
+ 'Plus',
+ 'Max',
+ 'Mini',
Review Comment:
```suggestion
'URL',
'Jinja',
'Gaussian',
'Superset',
'JavaScript',
'GeoJSON',
'CSV',
'Excel',
'XML',
'CSS',
'SQL',
'CRON',
'Slack',
'CC',
'BCC',
'Google Sheets',
'SSH',
'SQLAlchemy'
'URI',
'European',
'NaN',
'Apache',
'AntD',
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]