eslint-plugin-jest 29.0.1 → 29.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -109,3 +109,18 @@ describe('MyClass', () => {
|
|
|
109
109
|
});
|
|
110
110
|
});
|
|
111
111
|
```
|
|
112
|
+
|
|
113
|
+
### `ignoreTodos`
|
|
114
|
+
|
|
115
|
+
This option is used to control whether
|
|
116
|
+
[`todo`](https://jestjs.io/docs/api#testtodoname) Jest functions to be checked
|
|
117
|
+
by this rule. By the default, the option is set to false.
|
|
118
|
+
|
|
119
|
+
Example of **correct** code for the `{ "ignoreTodos": true }` option:
|
|
120
|
+
|
|
121
|
+
```js
|
|
122
|
+
/* eslint jest/prefer-lowercase-title: ["error", { "ignoreTodos": true }] */
|
|
123
|
+
test.todo('Uppercase description');
|
|
124
|
+
|
|
125
|
+
it.todo('Uppercase description');
|
|
126
|
+
```
|
|
@@ -175,6 +175,7 @@ describe('foo', () => {
|
|
|
175
175
|
interface Options {
|
|
176
176
|
ignoreSpaces?: boolean;
|
|
177
177
|
ignoreTypeOfDescribeName?: boolean;
|
|
178
|
+
ignoreTypeOfTestName?: boolean;
|
|
178
179
|
disallowedWords?: string[];
|
|
179
180
|
mustNotMatch?: Partial<Record<'describe' | 'test' | 'it', string>> | string;
|
|
180
181
|
mustMatch?: Partial<Record<'describe' | 'test' | 'it', string>> | string;
|
|
@@ -187,12 +188,12 @@ Default: `false`
|
|
|
187
188
|
|
|
188
189
|
When enabled, the leading and trailing spaces won't be checked.
|
|
189
190
|
|
|
190
|
-
#### `ignoreTypeOfDescribeName`
|
|
191
|
+
#### `ignoreTypeOfDescribeName` & `ignoreTypeOfTestName`
|
|
191
192
|
|
|
192
193
|
Default: `false`
|
|
193
194
|
|
|
194
|
-
When enabled, the type of the first argument to `describe` blocks won't
|
|
195
|
-
checked.
|
|
195
|
+
When enabled, the type of the first argument to `describe`/`test` blocks won't
|
|
196
|
+
be checked.
|
|
196
197
|
|
|
197
198
|
#### `disallowedWords`
|
|
198
199
|
|
|
@@ -53,6 +53,10 @@ var _default = exports.default = (0, _utils.createRule)({
|
|
|
53
53
|
ignoreTopLevelDescribe: {
|
|
54
54
|
type: 'boolean',
|
|
55
55
|
default: false
|
|
56
|
+
},
|
|
57
|
+
ignoreTodos: {
|
|
58
|
+
type: 'boolean',
|
|
59
|
+
default: false
|
|
56
60
|
}
|
|
57
61
|
},
|
|
58
62
|
additionalProperties: false
|
|
@@ -61,12 +65,14 @@ var _default = exports.default = (0, _utils.createRule)({
|
|
|
61
65
|
defaultOptions: [{
|
|
62
66
|
ignore: [],
|
|
63
67
|
allowedPrefixes: [],
|
|
64
|
-
ignoreTopLevelDescribe: false
|
|
68
|
+
ignoreTopLevelDescribe: false,
|
|
69
|
+
ignoreTodos: false
|
|
65
70
|
}],
|
|
66
71
|
create(context, [{
|
|
67
72
|
ignore = [],
|
|
68
73
|
allowedPrefixes = [],
|
|
69
|
-
ignoreTopLevelDescribe
|
|
74
|
+
ignoreTopLevelDescribe,
|
|
75
|
+
ignoreTodos
|
|
70
76
|
}]) {
|
|
71
77
|
const ignores = populateIgnores(ignore);
|
|
72
78
|
let numberOfDescribeBlocks = 0;
|
|
@@ -84,6 +90,11 @@ var _default = exports.default = (0, _utils.createRule)({
|
|
|
84
90
|
} else if (jestFnCall.type !== 'test') {
|
|
85
91
|
return;
|
|
86
92
|
}
|
|
93
|
+
|
|
94
|
+
// Ignore *.todo test and/or test suites
|
|
95
|
+
if (ignoreTodos && jestFnCall.members.some(s => (0, _utils.getAccessorValue)(s) === 'todo')) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
87
98
|
const [firstArg] = node.arguments;
|
|
88
99
|
const description = (0, _utils.getStringValue)(firstArg);
|
|
89
100
|
if (allowedPrefixes.some(name => description.startsWith(name))) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-jest",
|
|
3
|
-
"version": "29.0
|
|
3
|
+
"version": "29.1.0",
|
|
4
4
|
"description": "ESLint rules for Jest",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "babel --extensions .js,.ts src --out-dir lib --copy-files && rimraf --glob lib/__tests__ 'lib/**/__tests__'",
|
|
33
33
|
"_postinstall": "is-ci || husky",
|
|
34
|
-
"lint": "eslint .
|
|
34
|
+
"lint": "eslint .",
|
|
35
35
|
"prepack": "rimraf lib && yarn build",
|
|
36
36
|
"prepublishOnly": "pinst --disable",
|
|
37
37
|
"prettier:check": "prettier --check 'docs/**/*.md' README.md '.github/**' package.json tsconfig.json src/globals.json .yarnrc.yml",
|
|
@@ -81,21 +81,21 @@
|
|
|
81
81
|
"@babel/core": "^7.4.4",
|
|
82
82
|
"@babel/preset-env": "^7.4.4",
|
|
83
83
|
"@babel/preset-typescript": "^7.3.3",
|
|
84
|
-
"@commitlint/cli": "^
|
|
85
|
-
"@commitlint/config-conventional": "^
|
|
84
|
+
"@commitlint/cli": "^20.0.0",
|
|
85
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
86
86
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
|
|
87
87
|
"@schemastore/package": "^0.0.10",
|
|
88
88
|
"@semantic-release/changelog": "^6.0.0",
|
|
89
89
|
"@semantic-release/git": "^10.0.0",
|
|
90
90
|
"@tsconfig/node20": "^20.0.0",
|
|
91
91
|
"@types/eslint": "^8.4.6",
|
|
92
|
-
"@types/jest": "^
|
|
92
|
+
"@types/jest": "^30.0.0",
|
|
93
93
|
"@types/node": "^20.0.0",
|
|
94
94
|
"@types/semver": "^7.5.8",
|
|
95
95
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
96
96
|
"@typescript-eslint/parser": "^8.0.0",
|
|
97
97
|
"@typescript-eslint/utils": "^8.0.0",
|
|
98
|
-
"babel-jest": "^
|
|
98
|
+
"babel-jest": "^30.0.0",
|
|
99
99
|
"babel-plugin-replace-ts-export-assignment": "^0.0.2",
|
|
100
100
|
"dedent": "^1.5.0",
|
|
101
101
|
"eslint": "^8.57.0",
|
|
@@ -106,17 +106,17 @@
|
|
|
106
106
|
"eslint-plugin-n": "^17.0.0",
|
|
107
107
|
"eslint-plugin-prettier": "^5.0.0",
|
|
108
108
|
"eslint-remote-tester": "^3.0.0",
|
|
109
|
-
"eslint-remote-tester-repositories": "
|
|
109
|
+
"eslint-remote-tester-repositories": "^1.0.0",
|
|
110
110
|
"husky": "^9.0.1",
|
|
111
111
|
"is-ci": "^4.0.0",
|
|
112
|
-
"jest": "^
|
|
112
|
+
"jest": "^30.0.0",
|
|
113
113
|
"jest-runner-eslint": "^2.0.0",
|
|
114
|
-
"lint-staged": "^
|
|
115
|
-
"markdown-link-check": "
|
|
114
|
+
"lint-staged": "^16.0.0",
|
|
115
|
+
"markdown-link-check": "^3.13.7",
|
|
116
116
|
"pinst": "^3.0.0",
|
|
117
117
|
"prettier": "^3.0.0",
|
|
118
|
-
"rimraf": "^
|
|
119
|
-
"semantic-release": "^
|
|
118
|
+
"rimraf": "^6.0.0",
|
|
119
|
+
"semantic-release": "^25.0.0",
|
|
120
120
|
"semver": "^7.3.5",
|
|
121
121
|
"ts-node": "^10.2.1",
|
|
122
122
|
"typescript": "^5.0.4"
|
|
@@ -134,11 +134,8 @@
|
|
|
134
134
|
"optional": true
|
|
135
135
|
}
|
|
136
136
|
},
|
|
137
|
-
"packageManager": "yarn@
|
|
137
|
+
"packageManager": "yarn@4.11.0",
|
|
138
138
|
"engines": {
|
|
139
139
|
"node": "^20.12.0 || ^22.0.0 || >=24.0.0"
|
|
140
|
-
},
|
|
141
|
-
"publishConfig": {
|
|
142
|
-
"provenance": true
|
|
143
140
|
}
|
|
144
141
|
}
|