rusackas commented on code in PR #37625:
URL: https://github.com/apache/superset/pull/37625#discussion_r2766067111


##########
superset-frontend/eslint-rules/eslint-plugin-theme-colors/index.ts:
##########
@@ -0,0 +1,162 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @fileoverview Rule to warn about literal colors
+ * @author Apache
+ */
+
+import type { Rule } from 'eslint';
+import type { Node, SourceLocation } from 'estree';
+
+const COLOR_KEYWORDS: string[] = require('./colors');

Review Comment:
   The mixing here is intentional and consistent:
   
     - Lines 25-26 use import type — these are type-only imports that are 
completely erased at compile time. They don't participate in the module system 
at runtime.
     - Line 28 uses require — this is a runtime import, matching the 
module.exports = plugin on line 162 and the module.exports = COLOR_KEYWORDS in 
colors.ts.
   
     The runtime module system in both files is consistently CommonJS, which is 
what eslint expects when loading plugins. The import type statements are just 
TypeScript syntax sugar with no runtime presence. Converting the require to 
import would also require changing module.exports to export default in both 
files — a broader refactor outside the scope of this migration.



-- 
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]

Reply via email to