@wistia/eslint-config 0.13.4 → 0.14.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.
@@ -1,7 +1,7 @@
1
1
  // see: https://github.com/stylelint-scss/stylelint-config-standard-scss/blob/main/index.js
2
2
 
3
3
  module.exports = {
4
- plugins: ['stylelint-prettier', 'eslint-plugin-stylelint-scss'],
4
+ plugins: ['stylelint-prettier', 'stylelint-scss'],
5
5
  extends: ['stylelint-config-standard-scss', '../../rules/stylelint/scss'].map(require.resolve),
6
6
  rules: {
7
7
  // prettier configuration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wistia/eslint-config",
3
- "version": "0.13.4",
3
+ "version": "0.14.0",
4
4
  "description": "Wistia's ESLint configurations",
5
5
  "main": "react.js",
6
6
  "exports": {
@@ -45,6 +45,7 @@
45
45
  "eslint-plugin-jest-formatting": "^3.1.0",
46
46
  "eslint-plugin-jsx-a11y": "^6.6.1",
47
47
  "eslint-plugin-no-only-tests": "^3.0.0",
48
+ "eslint-plugin-no-snapshot-testing": "^1.0.61",
48
49
  "eslint-plugin-node": "^11.1.0",
49
50
  "eslint-plugin-prettier": "^4.2.1",
50
51
  "eslint-plugin-promise": "^6.0.0",
@@ -3,7 +3,12 @@
3
3
  // see: https://github.com/dangreenisrael/eslint-plugin-jest-formatting#rule-documentation
4
4
 
5
5
  module.exports = {
6
- plugins: ['eslint-plugin-no-only-tests', 'eslint-plugin-jest', 'eslint-plugin-jest-formatting'],
6
+ plugins: [
7
+ 'eslint-plugin-no-only-tests',
8
+ 'eslint-plugin-jest',
9
+ 'eslint-plugin-jest-formatting',
10
+ 'eslint-plugin-no-snapshot-testing',
11
+ ],
7
12
 
8
13
  rules: {
9
14
  // Authoring rules for tests:
@@ -12,6 +17,11 @@ module.exports = {
12
17
  // https://github.com/levibuzolic/eslint-plugin-no-only-tests#usage
13
18
  'no-only-tests/no-only-tests': 'error',
14
19
 
20
+ // Prevent snapshot tests
21
+ // decision: snapshot tests are more suitable for library code (eg. VHS); for application
22
+ // code they rarely (never?) catch bugs as they're just updated until they pass
23
+ 'no-snapshot-testing/no-snapshot-testing': 'error',
24
+
15
25
  // Have control over `test` and `it` usages
16
26
  // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/consistent-test-it.md
17
27
  'jest/consistent-test-it': 'error',
@@ -94,7 +104,8 @@ module.exports = {
94
104
 
95
105
  // disallow large snapshots
96
106
  // https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-large-snapshots.md
97
- // decision: arbitrary but reasonable size limit
107
+ // decision: arbitrary but reasonable size limit; although we suggest not writing snapshot tests with the
108
+ // `no-snapshot-testing` rule, in cases where we decide to allow them, this rule is beneficial
98
109
  'jest/no-large-snapshots': ['error', { maxSize: 500 }],
99
110
 
100
111
  // Disallow manually importing from `__mocks__`