Skip to content
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

fix: disable linter warning for tests #191

Merged
merged 3 commits into from
Sep 27, 2023
Merged

Conversation

rashmasch
Copy link
Contributor

References JIRA ticket

Motivation and context

Linter is showing warnings for tests 3rd party package @testing-library/user-event. Instead of default export of the module, this package exports a named export called default.

Before

Running linter shows warnings for test files: warning Using exported name 'userEvent' as identifier for default export import/no-named-as-default.

After

Running linter doesn't show import/no-named-as-default warnings for test files.

How to test

Affected repos: seller-web, listings-web, next-example, components-pkg.

Run linter and confirm warnings are showing up. As change is a small one, you might apply it directly and re-run the linter. After the PR merge and eslint-config-pkg version bump, re-test all the affected repos.

src/index.js Outdated
@@ -35,6 +35,12 @@ module.exports = {
'sonarjs/no-duplicate-string': 'off',
},
},
{
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[tj]s?(x)*'],
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add this bellow line 35, as part of ignore of group of files.

src/index.js Outdated
{
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[tj]s?(x)*'],
rules: {
'import/no-named-as-default': 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

We can add 'off' to be consistent

@rashmasch rashmasch merged commit d70058d into main Sep 27, 2023
6 checks passed
@rashmasch rashmasch deleted the remove-eslint-warning branch September 27, 2023 13:48
@automotiveengineeringbot
Copy link
Collaborator

🎉 This PR is included in version 4.0.13 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants