eslint-plugin-crisp 1.0.41 → 1.0.42

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-crisp",
3
- "version": "1.0.41",
3
+ "version": "1.0.42",
4
4
  "description": "Custom EsLint Rules for Crisp",
5
5
  "main": "index.js",
6
6
  "author": "Crisp IM SAS",
@@ -15,90 +15,122 @@ module.exports = {
15
15
  "plugin:vue-pug/vue3-recommended"
16
16
  ],
17
17
 
18
+ settings: {
19
+ jsdoc: {
20
+ tagNamePreference: {
21
+ returns: "return"
22
+ },
23
+
24
+ preferredTypes: {
25
+ Function: "function",
26
+ Array: "array",
27
+ Integer: "number"
28
+ }
29
+ }
30
+ },
31
+
18
32
  rules: {
19
33
  // General JS rules
20
- "no-eval": "error",
21
- "no-console": "warn",
22
- "no-debugger": "warn",
23
- "no-unused-vars": "warn",
24
34
  "arrow-parens": ["error", "always"],
25
35
  "comma-dangle": ["error", "never"],
26
- "curly": ["error", "all"],
36
+ "comma-style": ["error", "last"],
37
+ "curly": "error",
27
38
  "computed-property-spacing": ["error", "never"],
28
39
  "default-param-last": "error",
29
40
  "default-case-last": "error",
30
41
  "dot-notation": "error",
31
42
  "eqeqeq": "error",
43
+ "eol-last": "error",
44
+ "for-direction": "error",
32
45
  "linebreak-style": ["error", "unix"],
46
+ "no-console": "warn",
47
+ "no-debugger": "warn",
48
+ "no-eval": "error",
49
+ "no-multi-str": "error",
33
50
  "no-multiple-empty-lines": ["error", { max: 1 }],
34
- "no-trailing-spaces": "error",
51
+ "no-mixed-spaces-and-tabs": "error",
35
52
  "no-tabs": "error",
53
+ "no-trailing-spaces": "error",
54
+ "no-unused-vars": "warn",
55
+ "no-unsafe-optional-chaining": "error",
36
56
  "object-curly-spacing": ["error", "always"],
57
+ "padded-blocks": ["error", "never"],
37
58
  "prefer-arrow-callback": "error",
59
+ "quote-props": ["error", "as-needed"],
38
60
  "semi": ["error", "always"],
39
61
  "semi-style": ["error", "last"],
40
62
  "semi-spacing": ["error", { "before": false, "after": true }],
41
- "space-before-blocks": ["error", "always"],
63
+ "space-before-blocks": "error",
42
64
  "space-in-parens": ["error", "never"],
43
65
 
44
- "indent": ["error", 2, {
45
- "SwitchCase": 1,
46
- "FunctionDeclaration": {
47
- "parameters": "off"
48
- },
49
- "FunctionExpression": {
50
- "parameters": "off"
51
- },
52
- "CallExpression": {
53
- "arguments": "off"
54
- },
55
- "VariableDeclarator": "first",
56
- "outerIIFEBody": 0,
57
- "ArrayExpression": "first",
58
- "ObjectExpression": "first",
59
- "ImportDeclaration": "first",
60
- "flatTernaryExpressions": false,
61
- "ignoredNodes": [
62
- "BinaryExpression",
63
- "ConditionalExpression",
64
- "IfStatement *",
65
- "VariableDeclarator",
66
- "VariableDeclarator > CallExpression",
67
- "CallExpression > ArrayExpression"
68
- ]
69
- }],
70
-
71
- "brace-style": ["error", "1tbs", { "allowSingleLine": true }],
72
- "padded-blocks": ["error", "never"],
73
- "no-mixed-spaces-and-tabs": "error",
74
- "no-multi-str": "error",
75
- "quote-props": ["error", "as-needed"],
76
- "for-direction": "error",
77
- "comma-style": ["error", "last"],
78
- "eol-last": "error",
79
- "object-curly-newline": ["error", { "multiline": true, "consistent": true }],
66
+ "brace-style": [
67
+ "error",
68
+ "1tbs",
80
69
 
70
+ {
71
+ "allowSingleLine": true
72
+ }
73
+ ],
74
+ "indent": [
75
+ "error",
76
+ 2,
81
77
 
78
+ {
79
+ "SwitchCase": 1,
80
+ "FunctionDeclaration": {
81
+ "parameters": "off"
82
+ },
83
+ "FunctionExpression": {
84
+ "parameters": "off"
85
+ },
86
+ "CallExpression": {
87
+ "arguments": "off"
88
+ },
89
+ "VariableDeclarator": "first",
90
+ "outerIIFEBody": 0,
91
+ "ArrayExpression": "first",
92
+ "ObjectExpression": "first",
93
+ "ImportDeclaration": "first",
94
+ "flatTernaryExpressions": false,
95
+ "ignoredNodes": [
96
+ "BinaryExpression",
97
+ "ConditionalExpression",
98
+ "IfStatement *",
99
+ "VariableDeclarator",
100
+ "VariableDeclarator > CallExpression",
101
+ "CallExpression > ArrayExpression"
102
+ ]
103
+ }
104
+ ],
105
+ "object-curly-newline": [
106
+ "error",
107
+
108
+ {
109
+ "multiline": true, "consistent": true
110
+ }
111
+ ],
82
112
  "padding-line-between-statements": [
83
113
  "error",
84
114
 
85
- { blankLine: "always", prev: "let", next: "*" },
86
- { blankLine: "any", prev: "let", next: "let" },
87
- { blankLine: "always", prev: "const", next: "*" },
88
- { blankLine: "any", prev: "const", next: "const" },
89
- { blankLine: "always", prev: "block-like", next: "*" },
90
- { blankLine: "always", prev: "*", next: "break" },
91
- { blankLine: "any", prev: "empty", next: "break" },
92
- { blankLine: "always", prev: "*", next: "block-like" },
93
- { blankLine: "any", prev: "case", next: "case" },
94
- { blankLine: "always", prev: "continue", next: "*" },
95
- { blankLine: "always", prev: "break", next: "*" }
115
+ { "blankLine": "always", "prev": "let", "next": "*" },
116
+ { "blankLine": "any", "prev": "let", "next": "let" },
117
+ { "blankLine": "always", "prev": "const", "next": "*" },
118
+ { "blankLine": "any", "prev": "const", "next": "const" },
119
+ { "blankLine": "always", "prev": "block-like", "next": "*" },
120
+ { "blankLine": "always", "prev": "*", "next": "break" },
121
+ { "blankLine": "any", "prev": "empty", "next": "break" },
122
+ { "blankLine": "always", "prev": "*", "next": "block-like" },
123
+ { "blankLine": "any", "prev": "case", "next": "case" },
124
+ { "blankLine": "always", "prev": "continue", "next": "*" },
125
+ { "blankLine": "always", "prev": "break", "next": "*" }
96
126
  ],
97
127
  "quotes": [
98
128
  "error",
99
129
  "double",
100
130
 
101
- { "avoidEscape": true, "allowTemplateLiterals": true }
131
+ {
132
+ "avoidEscape": true, "allowTemplateLiterals": true
133
+ }
102
134
  ],
103
135
 
104
136
  // Crisp JS rules
@@ -110,15 +142,22 @@ module.exports = {
110
142
  "crisp/no-async": "error",
111
143
  "crisp/no-var-in-blocks": "error",
112
144
  "crisp/no-useless-template-literals": "error",
113
- "crisp/one-space-after-operator": ["error", { "checkColon": false }],
114
145
  "crisp/regex-in-constructor": "error",
115
146
  "crisp/ternary-parenthesis": "error",
116
147
  "crisp/variable-names": "error",
148
+
149
+ "crisp/one-space-after-operator": [
150
+ "error",
151
+
152
+ {
153
+ "checkColon": false
154
+ }
155
+ ],
117
156
  "crisp/no-short-parameters": [
118
157
  "error",
119
158
 
120
159
  {
121
- exceptions: ["_", "$", "x", "y"]
160
+ "exceptions": ["_", "$", "x", "y"]
122
161
  }
123
162
  ],
124
163
 
@@ -130,11 +169,11 @@ module.exports = {
130
169
 
131
170
  {
132
171
  require: {
133
- FunctionDeclaration: true,
134
- MethodDefinition: true,
135
- ClassDeclaration: true,
136
- ArrowFunctionExpression: false,
137
- FunctionExpression: false
172
+ "FunctionDeclaration": true,
173
+ "MethodDefinition": true,
174
+ "ClassDeclaration": true,
175
+ "ArrowFunctionExpression": false,
176
+ "FunctionExpression": false
138
177
  }
139
178
  }
140
179
  ],
@@ -222,19 +261,5 @@ module.exports = {
222
261
  "crisp/vue-html-quotes": "error",
223
262
  "crisp/vue-no-regex-data": "error",
224
263
  "crisp/vue-props-declaration-order": "error"
225
- },
226
-
227
- settings: {
228
- jsdoc: {
229
- tagNamePreference: {
230
- returns: "return"
231
- },
232
-
233
- preferredTypes: {
234
- Function: "function",
235
- Array: "array",
236
- Integer: "number"
237
- }
238
- }
239
264
  }
240
265
  }
package/recommended.js CHANGED
@@ -4,6 +4,14 @@ module.exports = {
4
4
  node: true
5
5
  },
6
6
 
7
+ plugins: [
8
+ "eslint-plugin-jsdoc"
9
+ ],
10
+
11
+ extends: [
12
+ "plugin:jsdoc/recommended"
13
+ ],
14
+
7
15
  settings: {
8
16
  jsdoc: {
9
17
  tagNamePreference: {
@@ -11,99 +19,149 @@ module.exports = {
11
19
  },
12
20
 
13
21
  preferredTypes: {
14
- Function: "function"
22
+ Function: "function",
23
+ Array: "array",
24
+ Integer: "number"
15
25
  }
16
26
  }
17
27
  },
18
28
 
19
- plugins: [
20
- "eslint-plugin-jsdoc",
21
- ],
22
-
23
- extends: [
24
- "plugin:jsdoc/recommended"
25
- ],
26
-
27
29
  rules: {
28
30
  // General JS rules
29
- "no-eval": "error",
30
- "no-console": "warn",
31
- "no-debugger": "warn",
32
- "no-unused-vars": "warn",
33
-
34
- "no-magic-numbers": ["error", {
35
- "ignore": [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100],
36
- "ignoreArrayIndexes": true,
37
- "ignoreDefaultValues": true
38
- }],
39
-
40
- "indent": ["error", 2, {
41
- "SwitchCase": 1,
42
- "FunctionDeclaration": {
43
- "parameters": "off"
44
- },
45
- "FunctionExpression": {
46
- "parameters": "off"
47
- },
48
- "CallExpression": {
49
- "arguments": "off"
50
- },
51
- "VariableDeclarator": "first",
52
- "outerIIFEBody": 0,
53
- "ArrayExpression": "first",
54
- "ObjectExpression": "first",
55
- "ImportDeclaration": "first",
56
- "flatTernaryExpressions": false,
57
- "ignoredNodes": [
58
- "BinaryExpression",
59
- "ConditionalExpression",
60
- "IfStatement *",
61
- "VariableDeclarator",
62
- "VariableDeclarator > CallExpression",
63
- "CallExpression > ArrayExpression"
64
- ]
65
- }],
66
-
31
+ "arrow-parens": ["error", "always"],
32
+ "comma-dangle": ["error", "never"],
33
+ "comma-style": ["error", "last"],
34
+ "curly": "error",
35
+ "default-param-last": "error",
36
+ "default-case-last": "error",
37
+ "dot-notation": "error",
38
+ "eqeqeq": "error",
39
+ "eol-last": "error",
40
+ "for-direction": "error",
67
41
  "linebreak-style": ["error", "unix"],
68
- "semi": ["error", "always"],
69
42
  "max-len": ["error", 80],
43
+ "no-console": "warn",
44
+ "no-debugger": "warn",
45
+ "no-eval": "error",
46
+ "no-multi-str": "error",
47
+ "no-mixed-spaces-and-tabs": "error",
48
+ "no-tabs": "error",
70
49
  "no-trailing-spaces": "error",
71
- "comma-dangle": ["error", "never"],
72
- "arrow-parens": ["error", "always"],
73
- "default-param-last": "error",
74
- "brace-style": ["error", "1tbs", { "allowSingleLine": true }],
50
+ "no-unused-vars": "warn",
51
+ "no-unsafe-optional-chaining": "error",
52
+ "object-curly-spacing": ["error", "always"],
75
53
  "padded-blocks": ["error", "never"],
76
- "curly": "error",
77
- "no-mixed-spaces-and-tabs": "error",
78
- "no-multi-str": "error",
79
54
  "quote-props": ["error", "as-needed"],
80
- "space-in-parens": ["error", "never"],
81
- "for-direction": "error",
55
+ "semi": ["error", "always"],
56
+ "semi-style": ["error", "last"],
82
57
  "space-before-blocks": "error",
83
- "comma-style": ["error", "last"],
84
- "eol-last": "error",
85
- "object-curly-newline": ["error", { "multiline": true, "consistent": true }],
58
+ "space-in-parens": ["error", "never"],
59
+
60
+ "brace-style": [
61
+ "error",
62
+ "1tbs",
86
63
 
64
+ {
65
+ "allowSingleLine": true
66
+ }
67
+ ],
68
+ "indent": [
69
+ "error",
70
+ 2,
71
+
72
+ {
73
+ "SwitchCase": 1,
74
+ "FunctionDeclaration": {
75
+ "parameters": "off"
76
+ },
77
+ "FunctionExpression": {
78
+ "parameters": "off"
79
+ },
80
+ "CallExpression": {
81
+ "arguments": "off"
82
+ },
83
+ "VariableDeclarator": "first",
84
+ "outerIIFEBody": 0,
85
+ "ArrayExpression": "first",
86
+ "ObjectExpression": "first",
87
+ "ImportDeclaration": "first",
88
+ "flatTernaryExpressions": false,
89
+ "ignoredNodes": [
90
+ "BinaryExpression",
91
+ "ConditionalExpression",
92
+ "IfStatement *",
93
+ "VariableDeclarator",
94
+ "VariableDeclarator > CallExpression",
95
+ "CallExpression > ArrayExpression"
96
+ ]
97
+ }
98
+ ],
99
+ "no-magic-numbers": [
100
+ "error",
101
+
102
+ {
103
+ "ignore": [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100],
104
+ "ignoreArrayIndexes": true,
105
+ "ignoreDefaultValues": true
106
+ }
107
+ ],
108
+ "object-curly-newline": [
109
+ "error",
110
+
111
+ {
112
+ "multiline": true, "consistent": true
113
+ }
114
+ ],
87
115
  "padding-line-between-statements": [
88
116
  "error",
89
117
 
90
- { blankLine: "always", prev: "let", next: "*" },
91
- { blankLine: "any", prev: "let", next: "let" },
92
- { blankLine: "always", prev: "const", next: "*" },
93
- { blankLine: "any", prev: "const", next: "const" },
94
- { blankLine: "always", prev: "block-like", next: "*" },
95
- { blankLine: "always", prev: "*", next: "break" },
96
- { blankLine: "any", prev: "empty", next: "break" },
97
- { blankLine: "always", prev: "*", next: "block-like" },
98
- { blankLine: "any", prev: "case", next: "case" },
99
- { blankLine: "always", prev: "continue", next: "*" },
100
- { blankLine: "always", prev: "break", next: "*" }
118
+ { "blankLine": "always", "prev": "let", "next": "*" },
119
+ { "blankLine": "any", "prev": "let", "next": "let" },
120
+ { "blankLine": "always", "prev": "const", "next": "*" },
121
+ { "blankLine": "any", "prev": "const", "next": "const" },
122
+ { "blankLine": "always", "prev": "block-like", "next": "*" },
123
+ { "blankLine": "always", "prev": "*", "next": "break" },
124
+ { "blankLine": "any", "prev": "empty", "next": "break" },
125
+ { "blankLine": "always", "prev": "*", "next": "block-like" },
126
+ { "blankLine": "any", "prev": "case", "next": "case" },
127
+ { "blankLine": "always", "prev": "continue", "next": "*" },
128
+ { "blankLine": "always", "prev": "break", "next": "*" }
101
129
  ],
102
130
  "quotes": [
103
131
  "error",
104
132
  "double",
105
133
 
106
- { "avoidEscape": true, "allowTemplateLiterals": true }
134
+ {
135
+ "avoidEscape": true, "allowTemplateLiterals": true
136
+ }
137
+ ],
138
+
139
+ // Crisp JS rules
140
+ "crisp/align-consecutive-class-assignements": "error",
141
+ "crisp/align-one-var": "error",
142
+ "crisp/align-requires": "error",
143
+ "crisp/const": "error",
144
+ "crisp/constructor-variables": "error"
145
+ "crisp/header-check": "error",
146
+ "crisp/header-comments-check": "error",
147
+ "crisp/methods-naming": "error",
148
+ "crisp/methods-ordering": "error",
149
+ "crisp/multiline-comment-end-backslash": "error",
150
+ "crisp/no-async": "error",
151
+ "crisp/no-var-in-blocks": "error",
152
+ "crisp/no-space-in-optional-arguments": "error",
153
+ "crisp/one-space-after-operator": "error",
154
+ "crisp/regex-in-constructor": "error",
155
+ "crisp/ternary-parenthesis": "error",
156
+ "crisp/two-lines-between-class-members": "error",
157
+ "crisp/variable-names": "error",
158
+
159
+ "crisp/no-short-parameters": [
160
+ "error",
161
+
162
+ {
163
+ "exceptions": ["_", "$"]
164
+ }
107
165
  ],
108
166
 
109
167
  // JSDoc rules
@@ -149,29 +207,6 @@ module.exports = {
149
207
  // Crisp JSDoc rules
150
208
  "crisp/jsdoc-align-params": "error",
151
209
  "crisp/jsdoc-check-indentation": "error",
152
- "crisp/jsdoc-enforce-classdesc": "error",
153
-
154
- // Crisp JS rules
155
- "crisp/align-one-var": "error",
156
- "crisp/multiline-comment-end-backslash": "error",
157
- "crisp/const": "error",
158
- "crisp/header-check": "error",
159
- "crisp/header-comments-check": "error",
160
- "crisp/regex-in-constructor": "error",
161
- "crisp/align-requires": "error",
162
- "crisp/two-lines-between-class-members": "error",
163
- "crisp/no-async": "error",
164
- "crisp/no-var-in-blocks": "error",
165
- "crisp/no-space-in-optional-arguments": "error",
166
- "crisp/no-short-parameters": ["error", {
167
- "exceptions": ["_", "$"]
168
- }],
169
- "crisp/methods-naming": "error",
170
- "crisp/methods-ordering": "error",
171
- "crisp/one-space-after-operator": "error",
172
- "crisp/ternary-parenthesis": "error",
173
- "crisp/align-consecutive-class-assignements": "error",
174
- "crisp/variable-names": "error",
175
- "crisp/constructor-variables": "error"
210
+ "crisp/jsdoc-enforce-classdesc": "error"
176
211
  }
177
212
  }