Skip to content

Commit

Permalink
EDSC-4076: Integrate a linter for react-testing-library before the nu…
Browse files Browse the repository at this point in the history
…mber of those gets too large in EDSC (#1844)

* EDSC-4076 adds react testing library linter

* EDSC-4076 renamed component tests to jsx

* EDSC-4076 more renames

* EDSC-4076 fixes more linter errors

* EDCS-4076 clean up

* EDSC-4076 cleanup

* EDSC-4076 package.json changes

* EDSC-4076 linter fixes

* EDSC-4076 eslint-config install

* EDSC-4076 test fixes

* EDSC-4076 test fix

* EDSC-4076 clean up

* EDSC-4076 pr comments

* EDSC-4076 rebase on main

* EDSC-4076 pr comments
  • Loading branch information
daniel-zamora authored Jan 23, 2025
1 parent 67a97c3 commit 54ee5da
Show file tree
Hide file tree
Showing 192 changed files with 2,988 additions and 1,947 deletions.
47 changes: 43 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"node": true,
"jest": true
},
// Use AirBnb settings as a base
"extends": [
"@edsc"
],
"rules": {
// Allowing cyclic dependencies
"import/no-cycle": "off",
Expand Down Expand Up @@ -33,12 +37,47 @@
"rules": {
"import/prefer-default-export": 0
}
},
// These rules are an attempt to prevent testing library linting on non testing library test files and source files.
// It works by assuming any test file we actually want to lint with these rules will be named with extention jsx.
{
"files": [
"tests/**/*.js",
"serverless/**/*",
"static/src/js/components/**/[^_]*/*.jsx",
"static/src/js/**/*.js"
],
"rules": {
"testing-library/await-async-events": "off",
"testing-library/await-async-queries": "off",
"testing-library/await-async-utils": "off",
"testing-library/consistent-data-testid": "off",
"testing-library/no-await-sync-events": "off",
"testing-library/no-await-sync-queries": "off",
"testing-library/no-container": "off",
"testing-library/no-debugging-utils": "off",
"testing-library/no-dom-import": "off",
"testing-library/no-global-regexp-flag-in-query": "off",
"testing-library/no-manual-cleanup": "off",
"testing-library/no-node-access": "off",
"testing-library/no-promise-in-fire-event": "off",
"testing-library/no-render-in-lifecycle": "off",
"testing-library/no-unnecessary-act": "off",
"testing-library/no-wait-for-multiple-assertions": "off",
"testing-library/no-wait-for-side-effects": "off",
"testing-library/no-wait-for-snapshot": "off",
"testing-library/prefer-explicit-assert": "off",
"testing-library/prefer-find-by": "off",
"testing-library/prefer-implicit-assert": "off",
"testing-library/prefer-presence-queries": "off",
"testing-library/prefer-query-by-disappearance": "off",
"testing-library/prefer-query-matchers": "off",
"testing-library/prefer-screen-queries": "off",
"testing-library/prefer-user-event": "off",
"testing-library/render-result-naming-convention": "off"
}
}
],
// Use AirBnb settings as a base
"extends": [
"@edsc"
],
// Define version settings
"settings": {
"react": {
Expand Down
Loading

0 comments on commit 54ee5da

Please sign in to comment.