-
Notifications
You must be signed in to change notification settings - Fork 0
Fixed eslint config #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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, | ||
| ...globals.jest | ||
| } | ||
| }, | ||
| plugins: { | ||
| jest: jestPlugin | ||
| }, | ||
| rules: { | ||
| // Core ESLint rules | ||
| 'semi': ['error', 'always'], | ||
| 'quotes': ['error', 'single', { 'avoidEscape': true }], | ||
| 'no-console': 'off', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Disabled console logging restrictions
Tell me moreWhat is the issue?ESLint rule 'no-console' is turned off, allowing direct console.log usage instead of proper logging mechanisms. Why this mattersUsing 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💬 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/**' | ||
| ] | ||
| } | ||
| ]; | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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}`); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sensitive Error Information Exposure
Tell me moreWhat is the issue?Error message exposes internal error details to the output which could reveal sensitive system information. Why this mattersExposing internal error details could help attackers understand the system structure and potentially exploit vulnerabilities. Suggested change ∙ Feature Previewthrow 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💬 Looking for more details? Reply to this comment to chat with Korbit. |
||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant Global Definitions
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:
Provide feedback to improve future suggestions
💬 Looking for more details? Reply to this comment to chat with Korbit.