Skip to content

fix eslint errors#69

Open
sofiagoldenberg wants to merge 1 commit into
mate-academy:mainfrom
sofiagoldenberg:task_solution
Open

fix eslint errors#69
sofiagoldenberg wants to merge 1 commit into
mate-academy:mainfrom
sofiagoldenberg:task_solution

Conversation

@sofiagoldenberg

Copy link
Copy Markdown

No description provided.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

This requires changes. While you've successfully set up the configuration files, the core functionality of the tools isn't working as required. There are two critical issues that need to be addressed:

  1. Incorrect ESLint Configuration: In eslint.config.mjs, multiple configurations are merged into a single object, causing rules to overwrite each other. Each configuration should be a separate element in the exported array. Also, eslint-config-prettier must be the last element to correctly disable conflicting style rules. [CHECKLIST ITEM #1]

  2. Non-functional Pre-commit Hook: The formatting errors found in tests/signUp/signUpPositive.spec.js indicate that the Husky and lint-staged setup is not triggering Prettier before commits. The purpose of this setup is to automate formatting, so this needs to be fixed. [CHECKLIST ITEM #3]

Please correct these configurations to ensure the tools work as intended.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread eslint.config.mjs
/** @type {import('eslint').Linter.Config[]} */
export default [
{ languageOptions: { globals: globals.node } },
eslintConfigPrettier,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The eslint-config-prettier configuration should be placed last in the array. Its purpose is to disable ESLint rules that conflict with Prettier. Placing it before other configurations allows them to re-enable rules that eslint-config-prettier is intended to turn off.

Comment thread eslint.config.mjs
Comment on lines +11 to +32
{
...pluginJs.configs.recommended,
...playwright.configs['flat/recommended'],
rules: {
...pluginJs.configs.recommended.rules,
'no-unused-vars': 'error',
'max-len': [
'error',
{
code: 80,
comments: 80,
},
],
...playwright.configs['flat/recommended'].rules,
'playwright/expect-expect': 'off',
},
ignores: [
'**/node_modules/*',
'playwright.config.js',
'**/playwright-report/**',
],
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Merging multiple configurations into a single object like this is incorrect. When you spread configurations that both have a rules property (like pluginJs.configs.recommended and playwright.configs['flat/recommended']), their rules will overwrite each other. Then, your explicit rules property on line 14 overwrites them all. To correctly layer these configurations, each one should be a separate element in the exported array.

Comment on lines +22 to +25
test('Successful `Sign up` flow test', async ({


}) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The formatting of this test function's parameters is incorrect. It contains extra newlines and spaces that should be removed.

This kind of formatting issue should be automatically fixed by Prettier. Since it's present in the committed code, it suggests that the Husky and lint-staged setup is not working correctly to format files before they are committed. Please verify your configuration to ensure the tools are working as expected.

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.

2 participants