@shopgate/eslint-config 7.30.0 → 7.30.1-beta.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/ruleset/main.js +21 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/eslint-config",
3
- "version": "7.30.0",
3
+ "version": "7.30.1-beta.1",
4
4
  "description": "Eslint configuration for the Shopgate Connect projects.",
5
5
  "author": "Shopgate <support@shopgate.com>",
6
6
  "license": "Apache-2.0",
package/ruleset/main.js CHANGED
@@ -15,6 +15,27 @@ module.exports = {
15
15
  },
16
16
  },
17
17
  rules: {
18
+ // disallow reassignment of function parameters
19
+ // disallow parameter object manipulation except for specific exclusions
20
+ // rule: https://eslint.org/docs/rules/no-param-reassign.html
21
+ 'no-param-reassign': ['error', {
22
+ props: true,
23
+ ignorePropertyModificationsFor: [
24
+ 'acc', // for reduce accumulators
25
+ 'accumulator', // for reduce accumulators
26
+ 'e', // for e.returnvalue
27
+ 'ctx', // for Koa routing
28
+ 'context', // for Koa routing
29
+ 'req', // for Express requests
30
+ 'request', // for Express requests
31
+ 'res', // for Express responses
32
+ 'response', // for Express responses
33
+ '$scope', // for Angular 1 scopes
34
+ 'staticContext', // for ReactRouter context
35
+
36
+ 'draft',
37
+ ],
38
+ }],
18
39
  'capitalized-comments': 0,
19
40
  'comma-dangle': ['error', {
20
41
  arrays: 'always-multiline',