Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ docs/.vuepress/dist

./package-lock.json
components/**/package-lock.json
/packages/evals/
/packages/sdk/examples/.next/
27 changes: 27 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";

/** @type {import('eslint').Linter.Config[]} */
export default [
{
files: [
"**/*.{js,mjs,cjs,ts}",
],
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Empty configuration object detected.

The first configuration object specifies file patterns but doesn't include any actual configuration. This makes the object redundant.

Consider removing this empty configuration or adding necessary rules:

- {
-   files: [
-     "**/*.{js,mjs,cjs,ts}",
-   ],
- },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
files: [
"**/*.{js,mjs,cjs,ts}",
],
},

{
files: [
"**/*.js",
],
languageOptions: {
sourceType: "commonjs",
},
},
{
languageOptions: {
globals: globals.browser,
},
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance TypeScript configuration for better type safety.

Given that this PR involves TypeScript code and type safety (particularly for the ProjectEnvironment type), the ESLint configuration should be strengthened for TypeScript files.

Consider adding these TypeScript-specific configurations:

 export default [
-  {
-    files: [
-      "**/*.{js,mjs,cjs,ts}",
-    ],
-  },
+  {
+    files: ["**/*.ts"],
+    languageOptions: {
+      parser: tseslint.parser,
+      parserOptions: {
+        project: "./tsconfig.json",
+        ecmaVersion: "latest",
+        sourceType: "module"
+      }
+    },
+    plugins: {
+      "@typescript-eslint": tseslint.plugin
+    },
+    rules: {
+      "@typescript-eslint/strict-boolean-expressions": "error",
+      "@typescript-eslint/no-explicit-any": "error",
+      "@typescript-eslint/explicit-function-return-type": "error",
+      "@typescript-eslint/no-unused-vars": "error"
+    }
+  },
   {
     files: [
       "**/*.js",
     ],
     languageOptions: {
       sourceType: "commonjs",
     },
   },
   {
     languageOptions: {
       globals: globals.browser,
     },
   },
   pluginJs.configs.recommended,
   ...tseslint.configs.recommended,
 ];

These rules will help enforce:

  • Proper type checking in boolean expressions
  • No usage of any type
  • Explicit return types for functions
  • No unused variables

This aligns with the PR's focus on type safety for the ProjectEnvironment implementation.

Committable suggestion skipped: line range outside the PR's diff.

Loading
Loading