-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
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)*'], |
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.
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, |
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.
We can add 'off' to be consistent
🎉 This PR is included in version 4.0.13 🎉 The release is available on: Your semantic-release bot 📦🚀 |
References JIRA ticket
Motivation and context
Linter is showing warnings for tests 3rd party package
@testing-library/user-event
. Instead ofdefault
export of the module, this package exports a named export calleddefault
.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.