Skip to content

Commit 8d9b5d8

Browse files
authored
Merge pull request #329 from DaleStudy/264-eslint-plugin-testing-library
eslint-plugin-testing-library ์„ค์น˜ ๋ฐ ์„ค์ •
2 parents c3367c0 + 9bb1f03 commit 8d9b5d8

File tree

3 files changed

+41
-12
lines changed

3 files changed

+41
-12
lines changed

โ€Žbun.lockโ€Ž

Lines changed: 21 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

โ€Žeslint.config.jsโ€Ž

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import globals from "globals";
33
import reactHooks from "eslint-plugin-react-hooks";
44
import reactRefresh from "eslint-plugin-react-refresh";
55
import tseslint from "typescript-eslint";
6+
import testingLibrary from "eslint-plugin-testing-library";
67

78
export default tseslint.config(
89
{ ignores: ["dist", "styled-system"] },
@@ -25,4 +26,22 @@ export default tseslint.config(
2526
],
2627
},
2728
},
29+
{
30+
files: ["src/components/**/*.test.[jt]s?(x)"],
31+
languageOptions: {
32+
ecmaVersion: 2020,
33+
globals: {
34+
...globals.browser,
35+
...globals.vitest,
36+
},
37+
},
38+
plugins: {
39+
"testing-library": testingLibrary,
40+
},
41+
rules: {
42+
"testing-library/await-async-queries": "error",
43+
"testing-library/no-debugging-utils": "warn",
44+
"testing-library/no-dom-import": "off",
45+
},
46+
},
2847
);

โ€Žpackage.jsonโ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"eslint-plugin-react-hooks": "^5.1.0",
6262
"eslint-plugin-react-refresh": "^0.4.20",
6363
"eslint-plugin-storybook": "^0.12.0",
64+
"eslint-plugin-testing-library": "^7.5.1",
6465
"globals": "^16.1.0",
6566
"happy-dom": "^17.6.3",
6667
"prettier": "^3.5.3",

0 commit comments

Comments
ย (0)