|
6 | 6 |
|
7 | 7 | const pkg = require('./package.json');
|
8 | 8 |
|
9 |
| -module.exports = { |
| 9 | +const plugin = { |
10 | 10 | meta: {
|
11 | 11 | name: pkg.name,
|
12 | 12 | version: pkg.version,
|
@@ -43,25 +43,29 @@ module.exports = {
|
43 | 43 | 'detect-new-buffer': 0,
|
44 | 44 | 'detect-bidi-characters': 0,
|
45 | 45 | },
|
46 |
| - configs: { |
47 |
| - recommended: { |
48 |
| - plugins: ['security'], |
49 |
| - rules: { |
50 |
| - 'security/detect-buffer-noassert': 'warn', |
51 |
| - 'security/detect-child-process': 'warn', |
52 |
| - 'security/detect-disable-mustache-escape': 'warn', |
53 |
| - 'security/detect-eval-with-expression': 'warn', |
54 |
| - 'security/detect-new-buffer': 'warn', |
55 |
| - 'security/detect-no-csrf-before-method-override': 'warn', |
56 |
| - 'security/detect-non-literal-fs-filename': 'warn', |
57 |
| - 'security/detect-non-literal-regexp': 'warn', |
58 |
| - 'security/detect-non-literal-require': 'warn', |
59 |
| - 'security/detect-object-injection': 'warn', |
60 |
| - 'security/detect-possible-timing-attacks': 'warn', |
61 |
| - 'security/detect-pseudoRandomBytes': 'warn', |
62 |
| - 'security/detect-unsafe-regex': 'warn', |
63 |
| - 'security/detect-bidi-characters': 'warn', |
64 |
| - }, |
65 |
| - }, |
| 46 | + configs: {}, // was assigned later so we can reference `plugin` |
| 47 | +}; |
| 48 | + |
| 49 | +const recommended = { |
| 50 | + plugins: { security: plugin }, |
| 51 | + rules: { |
| 52 | + 'security/detect-buffer-noassert': 'warn', |
| 53 | + 'security/detect-child-process': 'warn', |
| 54 | + 'security/detect-disable-mustache-escape': 'warn', |
| 55 | + 'security/detect-eval-with-expression': 'warn', |
| 56 | + 'security/detect-new-buffer': 'warn', |
| 57 | + 'security/detect-no-csrf-before-method-override': 'warn', |
| 58 | + 'security/detect-non-literal-fs-filename': 'warn', |
| 59 | + 'security/detect-non-literal-regexp': 'warn', |
| 60 | + 'security/detect-non-literal-require': 'warn', |
| 61 | + 'security/detect-object-injection': 'warn', |
| 62 | + 'security/detect-possible-timing-attacks': 'warn', |
| 63 | + 'security/detect-pseudoRandomBytes': 'warn', |
| 64 | + 'security/detect-unsafe-regex': 'warn', |
| 65 | + 'security/detect-bidi-characters': 'warn', |
66 | 66 | },
|
67 | 67 | };
|
| 68 | + |
| 69 | +Object.assign(plugin.configs, { recommended }); |
| 70 | + |
| 71 | +module.exports = plugin; |
0 commit comments