@automattic/eslint-plugin-wpvip 0.13.0 → 1.0.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.
package/configs/cli.js CHANGED
@@ -1,13 +1,16 @@
1
- module.exports = {
2
- /**
3
- * Please include a short description of the rule. For rules that downgrade or
4
- * disable errors, include a brief justification or reasoning.
5
- */
6
- rules: {
7
- // Allow child_process and non-literal `exec` arguments.
8
- 'security/detect-child-process': 'off',
1
+ /** @type import('eslint').Linter.Config[] */
2
+ module.exports = [
3
+ {
4
+ /**
5
+ * Please include a short description of the rule. For rules that downgrade or
6
+ * disable errors, include a brief justification or reasoning.
7
+ */
8
+ rules: {
9
+ // Allow child_process and non-literal `exec` arguments.
10
+ 'security/detect-child-process': 'off',
9
11
 
10
- // Process.exit is used in CLI context to stop execution.
11
- 'no-process-exit': 'off',
12
+ // Process.exit is used in CLI context to stop execution.
13
+ 'no-process-exit': 'off',
14
+ },
12
15
  },
13
- };
16
+ ];
@@ -1,104 +1,107 @@
1
- module.exports = {
2
- /**
3
- * Please include a short description of the rule. For rules that downgrade or
4
- * disable errors, include a brief justification or reasoning.
5
- */
6
- rules: {
7
- 'array-bracket-spacing': [ 'error', 'always' ],
1
+ /** @type import('eslint').Linter.Config[] */
2
+ module.exports = [
3
+ {
4
+ /**
5
+ * Please include a short description of the rule. For rules that downgrade or
6
+ * disable errors, include a brief justification or reasoning.
7
+ */
8
+ rules: {
9
+ 'array-bracket-spacing': [ 'error', 'always' ],
8
10
 
9
- 'arrow-parens': [ 'error', 'always' ],
11
+ 'arrow-parens': [ 'error', 'always' ],
10
12
 
11
- 'arrow-spacing': 'error',
13
+ 'arrow-spacing': 'error',
12
14
 
13
- 'brace-style': [ 'error', '1tbs' ],
15
+ 'brace-style': [ 'error', '1tbs' ],
14
16
 
15
- // Identifiers should be in camelCase. Object properties are excluded
16
- // (including when destructuring) since they often come from external
17
- // sources (like APIs).
18
- camelcase: [
19
- 'error',
20
- {
21
- properties: 'never',
22
- ignoreDestructuring: true,
23
- },
24
- ],
17
+ // Identifiers should be in camelCase. Object properties are excluded
18
+ // (including when destructuring) since they often come from external
19
+ // sources (like APIs).
20
+ camelcase: [
21
+ 'error',
22
+ {
23
+ properties: 'never',
24
+ ignoreDestructuring: true,
25
+ },
26
+ ],
25
27
 
26
- 'comma-dangle': [ 'error', 'always-multiline' ],
28
+ 'comma-dangle': [ 'error', 'always-multiline' ],
27
29
 
28
- 'comma-spacing': 'error',
30
+ 'comma-spacing': 'error',
29
31
 
30
- 'comma-style': [ 'error', 'last' ],
32
+ 'comma-style': [ 'error', 'last' ],
31
33
 
32
- 'computed-property-spacing': [ 'error', 'always' ],
34
+ 'computed-property-spacing': [ 'error', 'always' ],
33
35
 
34
- curly: [ 'error', 'all' ],
36
+ curly: [ 'error', 'all' ],
35
37
 
36
- 'dot-notation': 'error',
38
+ 'dot-notation': 'error',
37
39
 
38
- // Files must end in a newline.
39
- 'eol-last': [ 'error', 'always' ],
40
+ // Files must end in a newline.
41
+ 'eol-last': [ 'error', 'always' ],
40
42
 
41
- 'func-call-spacing': 'error',
43
+ 'func-call-spacing': 'error',
42
44
 
43
- indent: [ 'error', 'tab', { SwitchCase: 1 } ],
45
+ indent: [ 'error', 'tab', { SwitchCase: 1 } ],
44
46
 
45
- 'key-spacing': 'error',
47
+ 'key-spacing': 'error',
46
48
 
47
- 'keyword-spacing': 'error',
49
+ 'keyword-spacing': 'error',
48
50
 
49
- // Lines containing code should be a maximum of 200 characters in length.
50
- 'max-len': [
51
- 'warn',
52
- {
53
- code: 200,
54
- },
55
- ],
51
+ // Lines containing code should be a maximum of 200 characters in length.
52
+ 'max-len': [
53
+ 'warn',
54
+ {
55
+ code: 200,
56
+ },
57
+ ],
56
58
 
57
- 'no-multi-spaces': 'error',
59
+ 'no-multi-spaces': 'error',
58
60
 
59
- 'no-multi-str': 'error',
61
+ 'no-multi-str': 'error',
60
62
 
61
- 'no-multiple-empty-lines': [ 'error', { max: 1 } ],
63
+ 'no-multiple-empty-lines': [ 'error', { max: 1 } ],
62
64
 
63
- 'no-trailing-spaces': 'error',
65
+ 'no-trailing-spaces': 'error',
64
66
 
65
- 'no-whitespace-before-property': 'error',
67
+ 'no-whitespace-before-property': 'error',
66
68
 
67
- 'object-curly-spacing': [ 'error', 'always' ],
69
+ 'object-curly-spacing': [ 'error', 'always' ],
68
70
 
69
- 'object-shorthand': 'error',
71
+ 'object-shorthand': 'error',
70
72
 
71
- 'operator-linebreak': 'error',
73
+ 'operator-linebreak': 'error',
72
74
 
73
- 'padded-blocks': [ 'error', 'never' ],
75
+ 'padded-blocks': [ 'error', 'never' ],
74
76
 
75
- // Arrow functions should be used for function arguments and callbacks.
76
- 'prefer-arrow-callback': 'warn',
77
+ // Arrow functions should be used for function arguments and callbacks.
78
+ 'prefer-arrow-callback': 'warn',
77
79
 
78
- quotes: [ 'error', 'single', { allowTemplateLiterals: true, avoidEscape: true } ],
80
+ quotes: [ 'error', 'single', { allowTemplateLiterals: true, avoidEscape: true } ],
79
81
 
80
- 'quote-props': [ 'error', 'as-needed' ],
82
+ 'quote-props': [ 'error', 'as-needed' ],
81
83
 
82
- semi: 'error',
84
+ semi: 'error',
83
85
 
84
- 'semi-spacing': 'error',
86
+ 'semi-spacing': 'error',
85
87
 
86
- 'space-before-blocks': [ 'error', 'always' ],
88
+ 'space-before-blocks': [ 'error', 'always' ],
87
89
 
88
- 'space-before-function-paren': [
89
- 'error',
90
- { anonymous: 'never', named: 'never', asyncArrow: 'always' },
91
- ],
90
+ 'space-before-function-paren': [
91
+ 'error',
92
+ { anonymous: 'never', named: 'never', asyncArrow: 'always' },
93
+ ],
92
94
 
93
- 'space-in-parens': [ 'error', 'always' ],
95
+ 'space-in-parens': [ 'error', 'always' ],
94
96
 
95
- 'space-infix-ops': 'error',
97
+ 'space-infix-ops': 'error',
96
98
 
97
- 'space-unary-ops': [ 'error', { overrides: { '!': true, yield: true } } ],
99
+ 'space-unary-ops': [ 'error', { overrides: { '!': true, yield: true } } ],
98
100
 
99
- // Comments should always include consistent spacing for readability.
100
- 'spaced-comment': 'warn',
101
+ // Comments should always include consistent spacing for readability.
102
+ 'spaced-comment': 'warn',
101
103
 
102
- 'template-curly-spacing': [ 'error', 'always' ],
104
+ 'template-curly-spacing': [ 'error', 'always' ],
105
+ },
103
106
  },
104
- };
107
+ ];
package/configs/index.js CHANGED
@@ -1,4 +1,5 @@
1
- module.exports = {
1
+ /** @type {Record<string, import('eslint').Linter.Config[]>} */
2
+ const configs = {
2
3
  base: require( './base' ), // synonym for javascript
3
4
  cli: require( './cli' ),
4
5
  formatting: require( './formatting' ),
@@ -13,3 +14,5 @@ module.exports = {
13
14
  'weak-testing': require( './weak-testing' ),
14
15
  'weak-typescript': require( './weak-typescript' ),
15
16
  };
17
+
18
+ module.exports = configs;