eslint-config-adslot 1.7.0 → 1.8.1
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.
- package/index.js +1 -1
- package/package.json +4 -4
- package/plugin/index.js +0 -5
- package/plugin/no-snapshot.js +0 -37
- package/plugin/package.json +0 -8
package/index.js
CHANGED
package/package.json
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "eslint-config-adslot",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.8.1",
|
4
4
|
"description": "ESLint configuration for Adslot",
|
5
5
|
"main": "index.js",
|
6
6
|
"files": [
|
7
|
-
"index.js"
|
8
|
-
"plugin"
|
7
|
+
"index.js"
|
9
8
|
],
|
10
9
|
"repository": {
|
11
10
|
"type": "git",
|
@@ -13,7 +12,7 @@
|
|
13
12
|
},
|
14
13
|
"author": "Adslot",
|
15
14
|
"engines": {
|
16
|
-
"node": "^
|
15
|
+
"node": "^20"
|
17
16
|
},
|
18
17
|
"keywords": [
|
19
18
|
"ESLint",
|
@@ -42,6 +41,7 @@
|
|
42
41
|
"eslint-plugin-jest": "^27.4.2",
|
43
42
|
"eslint-plugin-jsx-a11y": "^6.7.1",
|
44
43
|
"eslint-plugin-lodash": "^7.4.0",
|
44
|
+
"eslint-plugin-no-snapshot-testing": "^1.0.61",
|
45
45
|
"eslint-plugin-react": "^7.33.2",
|
46
46
|
"eslint-plugin-react-hooks": "^4.6.0"
|
47
47
|
},
|
package/plugin/index.js
DELETED
package/plugin/no-snapshot.js
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
function isSnapshot(name) {
|
2
|
-
return [
|
3
|
-
'toMatchSnapshot',
|
4
|
-
'toMatchInlineSnapshot',
|
5
|
-
'toThrowErrorMatchingSnapshot',
|
6
|
-
'toThrowErrorMatchingInlineSnapshot',
|
7
|
-
].some((method) => method === name);
|
8
|
-
}
|
9
|
-
|
10
|
-
const noSnapshot = {
|
11
|
-
meta: {
|
12
|
-
docs: {
|
13
|
-
description: 'Disallows jest snapshots.',
|
14
|
-
},
|
15
|
-
messages: {
|
16
|
-
notAllowed: 'Snapshot testing is disallowed',
|
17
|
-
},
|
18
|
-
fixable: 'code',
|
19
|
-
},
|
20
|
-
|
21
|
-
create(context) {
|
22
|
-
return {
|
23
|
-
CallExpression({ callee: { property } }) {
|
24
|
-
if (isSnapshot(property && property.name)) {
|
25
|
-
context.report({
|
26
|
-
message:
|
27
|
-
'Do not use {{method}} or related methods that generate jest snapshots.',
|
28
|
-
node: property,
|
29
|
-
data: { method: property.name },
|
30
|
-
});
|
31
|
-
}
|
32
|
-
},
|
33
|
-
};
|
34
|
-
},
|
35
|
-
};
|
36
|
-
|
37
|
-
module.exports = noSnapshot;
|