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 CHANGED
@@ -330,6 +330,6 @@ module.exports = {
330
330
  'jest/no-disabled-tests': 'error',
331
331
  'jest/no-focused-tests': 'error',
332
332
 
333
- 'adslot/no-snapshot': 'error',
333
+ "no-snapshot-testing/no-snapshot-testing": "error",
334
334
  },
335
335
  };
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "eslint-config-adslot",
3
- "version": "1.7.0",
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": "^18"
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
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- rules: {
3
- 'no-snapshot': require('./no-snapshot'),
4
- },
5
- };
@@ -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;
@@ -1,8 +0,0 @@
1
- {
2
- "name": "eslint-plugin-adslot",
3
- "version": "1.0.0",
4
- "description": "",
5
- "main": "index.js",
6
- "author": "",
7
- "license": "ISC"
8
- }