Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
build(eslint): add eslint-plugin-testing-library
  • Loading branch information
the-ult committed Apr 15, 2021
commit bfa8d069057946e7dca0a8291e59e69c143eebe4
11 changes: 9 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
},
{
"files": ["*.ts"],
"plugins": ["eslint-plugin-import", "@angular-eslint/eslint-plugin", "@typescript-eslint"],
"rules": {
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "off",
Expand Down Expand Up @@ -102,8 +103,14 @@
"markers": ["/"]
}
]
},
"plugins": ["eslint-plugin-import", "@angular-eslint/eslint-plugin", "@typescript-eslint"]
}
},
{
"files": ["*.spec.ts"],
"extends": ["plugin:testing-library/angular", "plugin:jest-dom/recommended"],
"rules": {
"testing-library/prefer-explicit-assert": "error"
}
},
{
"files": ["*.html"],
Expand Down
2 changes: 1 addition & 1 deletion apps/example-app/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
"types": ["jest", "node", "@testing-library/jest-dom"]
},
"files": ["src/test-setup.ts"],
"include": ["**/*.spec.ts", "**/*.d.ts"]
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"@nrwl/node": "12.0.3",
"@nrwl/nx-plugin": "12.0.3",
"@nrwl/workspace": "12.0.3",
"@testing-library/jest-dom": "^5.11.0",
"@testing-library/jest-dom": "^5.11.10",
"@types/jest": "~26.0.3",
"@types/node": "14.14.37",
"@typescript-eslint/eslint-plugin": "4.22.0",
Expand All @@ -70,6 +70,8 @@
"eslint": "7.24.0",
"eslint-config-prettier": "8.2.0",
"eslint-plugin-import": "latest",
"eslint-plugin-jest-dom": "3.8.0",
"eslint-plugin-testing-library": "^4.0.1",
"husky": "^4.2.5",
"jest": "^26.1.0",
"jest-preset-angular": "8.4.0",
Expand Down
2 changes: 1 addition & 1 deletion projects/jest-utils/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"types": ["node", "jest"]
"types": ["node", "jest", "@testing-library/jest-dom"]
},
"files": ["test-setup.ts"],
"include": ["**/*.spec.ts", "**/*.d.ts"]
Expand Down
2 changes: 1 addition & 1 deletion projects/testing-library/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"types": ["node", "jest"]
"types": ["node", "jest", "@testing-library/jest-dom"]
},
"files": ["test-setup.ts"],
"include": ["**/*.spec.ts", "**/*.d.ts"]
Expand Down