Skip to content

Commit

Permalink
fix: add linting to CI + testing-library linting plugin (#32)
Browse files Browse the repository at this point in the history
* fix: add linting to CI + testing-library linting plugin

* add cleanup back

* add prefer-user-event, remove testing-library from top-level extends prop
  • Loading branch information
DrewHoo authored Mar 11, 2024
1 parent 4d1fa35 commit dd28776
Show file tree
Hide file tree
Showing 7 changed files with 288 additions and 670 deletions.
11 changes: 10 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@ module.exports = {
],
ignorePatterns: ["dist", ".eslintrc.cjs", "lib"],
parser: "@typescript-eslint/parser",
plugins: ["react-refresh"],
plugins: ["react-refresh", "testing-library"],
overrides: [ {
files: ["./src/**/*.test.tsx"],
extends: ["plugin:testing-library/react"],
rules: {
"testing-library/prefer-implicit-assert": "error",
"testing-library/prefer-presence-queries": "error",
"testing-library/prefer-user-event": "error"
}
}],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run lint
run: pnpm lint

- name: Run tests
run: pnpm test
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"eslint-plugin-storybook": "^0.6.15",
"eslint-plugin-testing-library": "^6.2.0",
"jsdom": "^24.0.0",
"json-schema-to-ts": "^3.0.0",
"lodash.isempty": "^4.4.0",
Expand Down
Loading

0 comments on commit dd28776

Please sign in to comment.