Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
48 changes: 48 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import js from '@eslint/js';
import globals from 'globals';
import jestPlugin from 'eslint-plugin-jest';

export default [
// Base ESLint recommended rules
js.configs.recommended,

// Main configuration
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.node,
...globals.es6,
Comment on lines +16 to +17
Copy link

Choose a reason for hiding this comment

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

Redundant Global Definitions category Design

Tell me more
What is the issue?

Using globals.es6 is redundant when globals.node is already included, as Node.js environments include ES6+ globals.

Why this matters

Unnecessary inclusion of ES6 globals increases configuration complexity and may cause confusion about which globals are actually needed.

Suggested change ∙ Feature Preview

Remove the redundant globals.es6 spread:

      globals: {
        ...globals.node,
        ...globals.jest
      }
Provide feedback to improve future suggestions

Nice Catch Incorrect Not in Scope Not in coding standard Other

💬 Looking for more details? Reply to this comment to chat with Korbit.

...globals.jest
}
},
plugins: {
jest: jestPlugin
},
rules: {
// Core ESLint rules
'semi': ['error', 'always'],
'quotes': ['error', 'single', { 'avoidEscape': true }],
'no-console': 'off',
Copy link

Choose a reason for hiding this comment

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

Disabled console logging restrictions category Logging

Tell me more
What is the issue?

ESLint rule 'no-console' is turned off, allowing direct console.log usage instead of proper logging mechanisms.

Why this matters

Using console.log statements in production code makes it difficult to control log levels, format logs consistently, and integrate with logging infrastructure. This impacts monitoring, debugging, and log aggregation capabilities.

Suggested change ∙ Feature Preview
'no-console': ['error', { allow: ['warn', 'error'] }],

Also recommend adding a comment to document that developers should use a proper logging library instead of console statements.

Provide feedback to improve future suggestions

Nice Catch Incorrect Not in Scope Not in coding standard Other

💬 Looking for more details? Reply to this comment to chat with Korbit.

'no-unused-vars': ['error', { 'argsIgnorePattern': '^_' }],

// Jest plugin rules
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error'
}
},

// Ignore patterns (equivalent to .eslintignore)
{
ignores: [
'node_modules/**',
'dist/**',
'coverage/**'
]
}
];
32 changes: 18 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@
"ejs": "^3.1.10"
},
"devDependencies": {
"@vercel/ncc": "^0.38.1",
"@eslint/js": "^9.25.0",
"esbuild": "^0.25.2",
"eslint": "^9.25.0",
"eslint-plugin-jest": "^28.11.0",
"globals": "^16.0.0",
"jest": "^29.7.0",
"mock-fs": "^5.5.0",
"tmp-promise": "^3.0.3"
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/ComposerHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class ComposerHelper {
await fs.access(classmapPath);
return true;
} catch (error) {
throw new Error(`Could not find classmap at ${classmapPath}. Make sure you've run composer with the --optimize flag.`);
throw new Error(`Could not find classmap at ${classmapPath}. Make sure you've run composer with the --optimize flag. Internal error: ${error}`);
Copy link

Choose a reason for hiding this comment

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

Sensitive Error Information Exposure category Security

Tell me more
What is the issue?

Error message exposes internal error details to the output which could reveal sensitive system information.

Why this matters

Exposing internal error details could help attackers understand the system structure and potentially exploit vulnerabilities.

Suggested change ∙ Feature Preview
throw new Error(`Could not find classmap at ${classmapPath}. Make sure you've run composer with the --optimize flag.`);
// If needed, log the detailed error separately using appropriate logging
core.debug(`Internal error details: ${error}`);
Provide feedback to improve future suggestions

Nice Catch Incorrect Not in Scope Not in coding standard Other

💬 Looking for more details? Reply to this comment to chat with Korbit.

}
}
}