Skip to content

fix eslint config creation and using default 8.57.0 instead 9.3.0 (when init without token)#125

Merged
franciscoovazevedo merged 2 commits intomainfrom
default-eslint-8.57
May 20, 2025
Merged

fix eslint config creation and using default 8.57.0 instead 9.3.0 (when init without token)#125
franciscoovazevedo merged 2 commits intomainfrom
default-eslint-8.57

Conversation

@franciscoovazevedo
Copy link
Copy Markdown
Contributor

Fix ESLint configuration generation

Changes

ESLint Configuration Generation

  • Fixed handling of named parameters in ESLint rules configuration
  • Added support for using default values when parameter values are empty
  • Properly formatted boolean parameters (true/false) without quotes
  • Ensured all rules use consistent array format ["error", ...] instead of mixing formats
  • Fixed issue where parameters with empty values were incorrectly ignored even when defaults existed

Benefits

  • More accurate and consistent ESLint configurations
  • Rules now correctly apply their intended parameters
  • Better handling of empty values by using defined defaults
  • Improved compatibility with ESLint 8.57.0 which is currently supported in CLI

@codacy-production
Copy link
Copy Markdown

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.30% 88.57%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (a95a19d) 4637 1424 30.71%
Head commit (f96e66f) 4666 (+29) 1447 (+23) 31.01% (+0.30%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#125) 35 31 88.57%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the ESLint configuration generation by ensuring proper handling of ESLint rule parameters and updating the default ESLint version to 8.57.0.

  • Fixed the format of ESLint rule definitions (using consistent array notation) and improved default parameter handling.
  • Updated integration tests, CLI command templates, and documentation to reflect the new default ESLint version.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/eslintConfigCreator_test.go Added tests for default and unnamed parameter handling
tools/eslintConfigCreator.go Updated parameter processing logic and ensured proper JSON formatting
integration-tests/init-without-token/expected/codacy.yaml Updated default ESLint version
cmd/root.go Updated default ESLint version in CLI usage examples
cmd/init_test.go Updated integration test expectation for default ESLint version
cmd/init.go Changed default ESLint version to 8.57.0
README.md Updated documentation to reflect the new default ESLint version

Comment thread tools/eslintConfigCreator.go
Copy link
Copy Markdown
Contributor

@andrzej-janczak andrzej-janczak left a comment

Choose a reason for hiding this comment

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

LGTM

@franciscoovazevedo franciscoovazevedo merged commit 57e38da into main May 20, 2025
10 checks passed
@alerizzo alerizzo deleted the default-eslint-8.57 branch June 3, 2025 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants