This disables autofix specifically for the "no-unnecessary-condition" rule. This allows us to continue using autofix without applying the breaking changes.
Since our code base is now mostly TypeScript, we can merge the configs and have a unified one.
`@typescript-eslint/no-var-requires` was temporarily disabled in webpack configs. These files will be replaced by fec.config.ts in the foreseeable future together with their ESLint override.
Some rule overrides were previously added when the ruleset got updated as more time to update the code was needed.
This removes some of the temporary rules.
This temporarily disables jsx-a11y/no-autofocus rule. A comment marking the disabled rule was added and another disabled rule was moved under it as well.
This adds eslint-plugin-jsx-a11y to the eslint configuration, setting up recommended set of rules for accessibility testing.
The error output by `jsx-a11y/no-autofocus` on encountering `autoFocus` attribute was switched to warning for now as whether to auto focus on an element or not can be highly contextual.
Fixes#948
This updates rules for linting both JS and TS files in a way that is consistent with previous linting.
Some rules for linting TS files were turned off or switched to warnings for now.
Commit #3e84abba3f bumped
@redhat-cloud-services/eslint-config-redhat-cloud-services from 1.3.0 to
2.0.3.
This introduced a new rule that broke a number of our imports. This
commit forbids the rule for now.
(rulesdir/forbid-pf-relative-imports: off)
This commit adds eslint support for .ts and .tsx files.
The recommended Typescript rules are applied only to .ts and .tsx files
and not to existing .js or .jsx files. This is accomplished by creating
a separate .eslintrc-typescript.yml file and pointing to it in the
.eslintrc.yml overrides parameter.
A .eslintignore file was added. This file has syntax similiar to
.gitignore and is used to ignore the programatically generated API
slices so that we do not have to deal with a massive diff whenever we
update one of them.
Require const declarations for variables that are never reassigned after
being declared. If a variable is never reassigned, using the const
declaration is better. const declaration tells readers, “this variable
is never reassigned,” reducing cognitive load and improving
maintainability.
The import ordering was handled by using `sort-imports` rule for alphabetical ordering and `import` plugin for separating the imports into groups by a type of the import.
The alphabetical sorting was not working very well when using the combination.
This removes the use of `sort-imports` rule and adds alphabetical sorting directly under the `import` plugin which means all the sorting is handled in one place.
The rules for sorting of the imports are now following:
- imports are separated into groups by a type of the import
- imports within the groups are ordered alphabetically in ascending order
- new lines separating the groups of imports are enforced
- the import of React library is always at the very top of the imports
Fixes#795. This commit adds rules to `.eslintrc.yml` which enforce sorting of the import declarations.
Added plugin `eslint-plugin-import` allows to sort the import declarations based on their types (builtin, external, internal, etc.) and rule `sort-imports` then sorts the declarations inside these groups alphabetically.
Use the "@redhat-cloud-services/eslint-config-redhat-cloud-services"
eslint config. This allows our styling to be standardized with other
Red Hat Insights apps. Also, remove now unneeded eslint packages.
When the SUT calls history.push that will cause a page redirect
inside the browser. However it doesn't cause the new page to be
rendered when running the test suite hence all assertions fail!
The reason for this is that Jest + RTL use jsdom under the hood,
which partially implements HTML/DOM APIs but **IS NOT** a browser!
It also turns out RTL is not well suited for end-to-end scenarios
which cover multiple pages.
This commit:
- patches renderWithReduxRouter() to also return the history object
so we can set a spy on it later
- changes eslint confirugration to ignore unused variables starting
with underscore
- updates the verifyCancelButton() function and scenarios which
make use of it
This was a bit confusing because in the inline documentation, I wrote
that a compose used state as a key. However this changed to status
pretty early on and I forgot to update it.
Also use an actual uuid with proper length.