eslint-plugin-crisp 1.1.0 → 1.1.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.
package/index.js CHANGED
@@ -1,11 +1,16 @@
1
+ import fs from "fs";
2
+
1
3
  import configRecommended from "./recommended.js";
2
4
  import configRecommendedVue from "./recommended-vue.js";
3
5
 
4
- import { name, version } from "./package.json";
6
+ const projectPackage = JSON.parse(
7
+ fs.readFileSync(new URL("./package.json", import.meta.url), "utf8")
8
+ );
9
+
5
10
  const plugin = {
6
11
  meta: {
7
- name: name,
8
- version: version,
12
+ name: projectPackage.name,
13
+ version: projectPackage.version,
9
14
  namespace: "crisp"
10
15
  },
11
16
 
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "eslint-plugin-crisp",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Custom ESLint Rules for Crisp",
5
5
  "author": "Crisp IM SAS",
6
6
  "main": "index.js",
7
+ "type": "module",
7
8
  "homepage": "https://github.com/crisp-oss/eslint-plugin-crisp",
8
9
  "repository": {
9
10
  "type": "git",
@@ -19,7 +20,8 @@
19
20
  "peerDependencies": {
20
21
  "eslint": "9.29.0",
21
22
  "eslint-plugin-vue": "10.2.0",
22
- "eslint-plugin-vue-pug": "1.0.0-alpha.3"
23
+ "eslint-plugin-vue-pug": "1.0.0-alpha.3",
24
+ "globals": "15.15.0"
23
25
  },
24
26
  "keywords": [
25
27
  "eslint",
@@ -1,368 +1,376 @@
1
1
  import globals from "globals";
2
+ import pluginJS from "@eslint/js";
3
+ // import pluginJSdoc from "eslint-plugin-jsdoc";
4
+ import pluginVue from "eslint-plugin-vue";
2
5
 
3
6
  export default function configRecommendedVue(plugin) {
4
- return {
5
- languageOptions: {
6
- globals: {
7
- ...globals.browser,
8
- ...globals.node
9
- }
10
- },
11
-
12
- plugins: {
13
- "eslint-plugin-jsdoc",
14
- "eslint-plugin-crisp": plugin
15
- },
16
-
17
- extends: [
18
- "eslint:recommended",
19
- "plugin:jsdoc/recommended",
20
- "plugin:vue/vue3-recommended",
21
- "plugin:vue-pug/vue3-recommended"
22
- ],
23
-
24
- settings: {
25
- jsdoc: {
26
- tagNamePreference: {
27
- returns: "return"
28
- },
29
-
30
- preferredTypes: {
31
- Function: "function",
32
- Array: "array",
33
- Map: "map",
34
- Integer: "number"
7
+ return [
8
+ pluginJS.configs.recommended,
9
+ // pluginJSdoc.configs["flat/recommended"],
10
+ pluginVue.configs["flat/vue3-recommended"],
11
+
12
+ {
13
+ languageOptions: {
14
+ globals: {
15
+ ...globals.browser,
16
+ ...globals.node
35
17
  }
36
- }
37
- },
18
+ },
38
19
 
39
- rules: {
40
- // General JS rules
41
- "arrow-parens": ["error", "always"],
42
- "brace-style": [
43
- "error",
44
- "1tbs",
20
+ plugins: {
21
+ // "jsdoc": pluginJSdoc,
22
+ "crisp": plugin
23
+ },
45
24
 
46
- {
47
- "allowSingleLine": true
48
- }
49
- ],
50
- "comma-dangle": ["error", "never"],
51
- "comma-spacing": ["error", { "before": false, "after": true }],
52
- "comma-style": ["error", "last"],
53
- "curly": "error",
54
- "computed-property-spacing": ["error", "never"],
55
- "default-param-last": "error",
56
- "default-case-last": "error",
57
- "dot-notation": "error",
58
- "eqeqeq": "error",
59
- "eol-last": "error",
60
- "for-direction": "error",
61
- "indent": [
62
- "error",
63
- 2,
64
-
65
- {
66
- "SwitchCase": 1,
67
- "FunctionDeclaration": {
68
- "parameters": "off"
69
- },
70
- "FunctionExpression": {
71
- "parameters": "off"
72
- },
73
- "CallExpression": {
74
- "arguments": "off"
75
- },
76
- "VariableDeclarator": 1,
77
- "outerIIFEBody": 0,
78
- "ArrayExpression": 1,
79
- "ObjectExpression": 1,
80
- "ImportDeclaration": 1,
81
- "flatTernaryExpressions": false,
82
- "offsetTernaryExpressions": true
83
- }
84
- ],
85
- "key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
86
- "keyword-spacing": "error",
87
- "linebreak-style": ["error", "unix"],
88
- "newline-per-chained-call": "error",
89
- "no-console": "warn",
90
- "no-debugger": "warn",
91
- "no-eval": "error",
92
- "no-multi-str": "error",
93
- "no-multiple-empty-lines": ["error", { max: 1 }],
94
- "no-mixed-spaces-and-tabs": "error",
95
- "no-restricted-syntax": [
96
- "error",
97
-
98
- {
99
- "selector": "SwitchCase > *.consequent[type!='BlockStatement']",
100
- "message": "Switch cases without braces are disallowed."
101
- }
102
- ],
103
- "no-tabs": "error",
104
- "no-trailing-spaces": "error",
105
- "no-undef": "error",
106
- "no-unused-vars": "warn",
107
- "no-unsafe-optional-chaining": "error",
108
- "object-curly-newline": [
109
- "error",
110
-
111
- {
112
- "multiline": true, "consistent": true
113
- }
114
- ],
115
- "object-curly-spacing": ["error", "always"],
116
- "padded-blocks": ["error", "never"],
117
- "padding-line-between-statements": [
118
- "error",
119
-
120
- { "blankLine": "always", "prev": "let", "next": "*" },
121
- { "blankLine": "any", "prev": "let", "next": "let" },
122
- { "blankLine": "always", "prev": "const", "next": "*" },
123
- { "blankLine": "any", "prev": "const", "next": "const" },
124
- { "blankLine": "always", "prev": "block-like", "next": "*" },
125
- { "blankLine": "always", "prev": "*", "next": "break" },
126
- { "blankLine": "any", "prev": "empty", "next": "break" },
127
- { "blankLine": "always", "prev": "*", "next": "block-like" },
128
- { "blankLine": "any", "prev": "case", "next": "case" },
129
- { "blankLine": "always", "prev": "continue", "next": "*" },
130
- { "blankLine": "always", "prev": "break", "next": "*" }
25
+ // TODO: drop extends
26
+ extends: [
27
+ "plugin:vue/vue3-recommended",
28
+ "plugin:vue-pug/vue3-recommended"
131
29
  ],
132
- "prefer-arrow-callback": "error",
133
- "quotes": [
134
- "error",
135
- "double",
136
30
 
137
- {
138
- "avoidEscape": true, "allowTemplateLiterals": true
139
- }
140
- ],
141
- "quote-props": ["error", "as-needed"],
142
- "semi": ["error", "always"],
143
- "semi-style": ["error", "last"],
144
- "semi-spacing": ["error", { "before": false, "after": true }],
145
- "space-before-blocks": "error",
146
- "space-in-parens": ["error", "never"],
147
- "space-infix-ops": "error",
148
-
149
- // Crisp JS rules
150
- "crisp/align-comments": "error",
151
- "crisp/enforce-optional": "error",
152
- "crisp/header-check": "error",
153
- "crisp/header-comments-check": "error",
154
- "crisp/import-group-comment": "error",
155
- "crisp/import-group-order": "error",
156
- "crisp/methods-naming": "error",
157
- "crisp/methods-ordering": "error",
158
- "crisp/multiline-comment-end-backslash": "error",
159
- "crisp/newline-after-switch-case": "error",
160
- "crisp/no-async": "error",
161
- "crisp/no-extra-line-within-function": "error",
162
- "crisp/no-short-parameters": [
163
- "error",
164
-
165
- {
166
- "exceptions": ["_", "$", "x", "y"]
167
- }
168
- ],
169
- "crisp/no-useless-template-literals": "error",
170
- "crisp/no-var-in-blocks": "error",
171
- "crisp/one-space-after-operator": [
172
- "error",
173
-
174
- {
175
- "checkColon": false
176
- }
177
- ],
178
- "crisp/regex-in-constructor": "error",
179
- "crisp/ternary-parenthesis": "error",
180
- "crisp/variable-names": "error",
181
-
182
- // General JSDoc rules
183
- "jsdoc/require-description": "error",
184
- "jsdoc/require-param-description": "off",
185
- "jsdoc/require-jsdoc": [
186
- "error",
187
-
188
- {
189
- "require": {
190
- "FunctionDeclaration": true,
191
- "MethodDefinition": true,
192
- "ClassDeclaration": true,
193
- "ArrowFunctionExpression": false,
194
- "FunctionExpression": false
31
+ settings: {
32
+ jsdoc: {
33
+ tagNamePreference: {
34
+ returns: "return"
195
35
  },
196
36
 
197
- "contexts": [
198
- "Property[key.name=\"getters\"] > ObjectExpression > Property",
199
- "Property[key.name=\"methods\"] > ObjectExpression > Property"
200
- ]
201
- }
202
- ],
203
- "jsdoc/sort-tags": [
204
- "error",
205
-
206
- {
207
- "tagSequence": [
208
- {
209
- "tags": [
210
- "private",
211
- "protected",
212
- "public",
213
-
214
- "class",
215
-
216
- "classdesc",
217
-
218
- "param",
219
- "return"
220
- ]
221
- }
222
- ]
223
- }
224
- ],
225
-
226
- // Crisp JSDoc rules
227
- "crisp/jsdoc-align-params": "error",
228
- "crisp/jsdoc-check-indentation": "error",
229
- "crisp/jsdoc-check-optional-params": "error",
230
- "crisp/jsdoc-enforce-access": "error",
231
- "crisp/jsdoc-enforce-classdesc": "error",
232
- "crisp/jsdoc-require-description-uppercase": "error",
233
-
234
- // General Vue rules
235
- "vue/attributes-order": [
236
- "error",
237
-
238
- {
239
- "order": [
240
- "RENDER_MODIFIERS",
241
- "CONDITIONALS",
242
- "OTHER_DIRECTIVES",
243
- "LIST_RENDERING",
244
- "SLOT",
245
- "TWO_WAY_BINDING",
246
- "CONTENT",
247
- "EVENTS",
248
- "DEFINITION",
249
- "ATTR_DYNAMIC",
250
- "ATTR_STATIC",
251
- "ATTR_SHORTHAND_BOOL"
252
- ],
253
- "alphabetical": false
37
+ preferredTypes: {
38
+ Function: "function",
39
+ Array: "array",
40
+ Map: "map",
41
+ Integer: "number"
42
+ }
254
43
  }
255
- ],
256
- "vue/block-lang": [
257
- "error",
258
-
259
- {
260
- "script": { "allowNoLang": true }
261
- }
262
- ],
263
- "vue/block-order": [
264
- "error",
265
-
266
- {
267
- "order": ["template", "script", "style"]
268
- }
269
- ],
270
- "vue/block-tag-newline": [
271
- "error",
272
-
273
- {
274
- "singleline": "always",
275
- "multiline": "always",
276
- "maxEmptyLines": 0
277
- }
278
- ],
279
- "vue/comma-dangle": "error",
280
- "vue/component-api-style": ["error", ["options"]],
281
- "vue/component-name-in-template-casing": ["error", "kebab-case"],
282
- "vue/component-options-name-casing": ["error", "PascalCase"],
283
- "vue/custom-event-name-casing": [
284
- "error",
285
- "camelCase",
286
-
287
- {
288
- "ignores": [
289
- "/^[a-z]+(?:-[a-z]+)*(?::[a-z]+(?:-[a-z]+)*)*$/i"
290
- ]
291
- }
292
- ],
293
- "vue/eqeqeq": "error",
294
- "vue/html-comment-content-spacing": ["error", "always"],
295
- "vue/html-quotes": "off",
296
- "vue/key-spacing": [
297
- "error",
298
-
299
- {
300
- "beforeColon": false,
301
- "afterColon": true
302
- }
303
- ],
304
- "vue/match-component-import-name": "error",
305
- "vue/max-len": [
306
- "error",
307
-
308
- {
309
- "code": 80,
310
- "template": 999,
311
- "ignorePattern": "^import|\`(.+?)\`|\/\\*\\* \@type|\@return \\{|\\*{20,}",
312
- "ignoreStrings": true,
313
- "ignoreUrls": true,
314
- "ignoreRegExpLiterals": true
315
- }
316
- ],
317
- "vue/new-line-between-multi-line-property": "error",
318
- "vue/no-bare-strings-in-template": "error",
319
- "vue/no-irregular-whitespace": "error",
320
- "vue/no-multiple-objects-in-class": "error",
321
- "vue/no-mutating-props": [
322
- "error",
323
-
324
- {
325
- "shallowOnly": true
326
- }
327
- ],
328
- "vue/no-static-inline-styles": "error",
329
- "vue/no-use-v-else-with-v-for": "error",
330
- "vue/no-useless-v-bind": "error",
331
- "vue/no-v-html": "off",
332
- "vue/padding-line-between-blocks": ["error", "always"],
333
- "vue/padding-lines-in-component-definition": [
334
- "error",
335
-
336
- {
337
- "groupSingleLineProperties": false
338
- }
339
- ],
340
- "vue/prefer-true-attribute-shorthand": "error",
341
- "vue/require-direct-export": "error",
342
- "vue/v-for-delimiter-style": ["error", "in"],
343
- "vue/v-slot-style": [
344
- "error",
345
-
346
- {
347
- "atComponent": "v-slot",
348
- "default": "v-slot",
349
- "named": "longform"
350
- }
351
- ],
352
-
353
- // Crisp Vue rules
354
- "crisp/vue-attribute-comma": "error",
355
- "crisp/vue-attribute-linebreak": "error",
356
- "crisp/vue-computed-order": "error",
357
- "crisp/vue-emits-order": "error",
358
- "crisp/vue-header-check": "error",
359
- "crisp/vue-html-indent": "error",
360
- "crisp/vue-html-quotes": "error",
361
- "crisp/vue-no-regex-data": "error",
362
- "crisp/vue-props-declaration-line-break": "error",
363
- "crisp/vue-props-declaration-multiline": "error",
364
- "crisp/vue-props-declaration-order": "error",
365
- "crisp/vue-ref-case": "error"
44
+ },
45
+
46
+ rules: {
47
+ // General JS rules
48
+ "arrow-parens": ["error", "always"],
49
+ "brace-style": [
50
+ "error",
51
+ "1tbs",
52
+
53
+ {
54
+ "allowSingleLine": true
55
+ }
56
+ ],
57
+ "comma-dangle": ["error", "never"],
58
+ "comma-spacing": ["error", { "before": false, "after": true }],
59
+ "comma-style": ["error", "last"],
60
+ "curly": "error",
61
+ "computed-property-spacing": ["error", "never"],
62
+ "default-param-last": "error",
63
+ "default-case-last": "error",
64
+ "dot-notation": "error",
65
+ "eqeqeq": "error",
66
+ "eol-last": "error",
67
+ "for-direction": "error",
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": 1,
84
+ "outerIIFEBody": 0,
85
+ "ArrayExpression": 1,
86
+ "ObjectExpression": 1,
87
+ "ImportDeclaration": 1,
88
+ "flatTernaryExpressions": false,
89
+ "offsetTernaryExpressions": true
90
+ }
91
+ ],
92
+ "key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
93
+ "keyword-spacing": "error",
94
+ "linebreak-style": ["error", "unix"],
95
+ "newline-per-chained-call": "error",
96
+ "no-console": "warn",
97
+ "no-debugger": "warn",
98
+ "no-eval": "error",
99
+ "no-multi-str": "error",
100
+ "no-multiple-empty-lines": ["error", { max: 1 }],
101
+ "no-mixed-spaces-and-tabs": "error",
102
+ "no-restricted-syntax": [
103
+ "error",
104
+
105
+ {
106
+ "selector": "SwitchCase > *.consequent[type!='BlockStatement']",
107
+ "message": "Switch cases without braces are disallowed."
108
+ }
109
+ ],
110
+ "no-tabs": "error",
111
+ "no-trailing-spaces": "error",
112
+ "no-undef": "error",
113
+ "no-unused-vars": "warn",
114
+ "no-unsafe-optional-chaining": "error",
115
+ "object-curly-newline": [
116
+ "error",
117
+
118
+ {
119
+ "multiline": true, "consistent": true
120
+ }
121
+ ],
122
+ "object-curly-spacing": ["error", "always"],
123
+ "padded-blocks": ["error", "never"],
124
+ "padding-line-between-statements": [
125
+ "error",
126
+
127
+ { "blankLine": "always", "prev": "let", "next": "*" },
128
+ { "blankLine": "any", "prev": "let", "next": "let" },
129
+ { "blankLine": "always", "prev": "const", "next": "*" },
130
+ { "blankLine": "any", "prev": "const", "next": "const" },
131
+ { "blankLine": "always", "prev": "block-like", "next": "*" },
132
+ { "blankLine": "always", "prev": "*", "next": "break" },
133
+ { "blankLine": "any", "prev": "empty", "next": "break" },
134
+ { "blankLine": "always", "prev": "*", "next": "block-like" },
135
+ { "blankLine": "any", "prev": "case", "next": "case" },
136
+ { "blankLine": "always", "prev": "continue", "next": "*" },
137
+ { "blankLine": "always", "prev": "break", "next": "*" }
138
+ ],
139
+ "prefer-arrow-callback": "error",
140
+ "quotes": [
141
+ "error",
142
+ "double",
143
+
144
+ {
145
+ "avoidEscape": true, "allowTemplateLiterals": true
146
+ }
147
+ ],
148
+ "quote-props": ["error", "as-needed"],
149
+ "semi": ["error", "always"],
150
+ "semi-style": ["error", "last"],
151
+ "semi-spacing": ["error", { "before": false, "after": true }],
152
+ "space-before-blocks": "error",
153
+ "space-in-parens": ["error", "never"],
154
+ "space-infix-ops": "error",
155
+
156
+ // Crisp JS rules
157
+ "crisp/align-comments": "error",
158
+ "crisp/enforce-optional": "error",
159
+ "crisp/header-check": "error",
160
+ "crisp/header-comments-check": "error",
161
+ "crisp/import-group-comment": "error",
162
+ "crisp/import-group-order": "error",
163
+ "crisp/methods-naming": "error",
164
+ "crisp/methods-ordering": "error",
165
+ "crisp/multiline-comment-end-backslash": "error",
166
+ "crisp/newline-after-switch-case": "error",
167
+ "crisp/no-async": "error",
168
+ "crisp/no-extra-line-within-function": "error",
169
+ "crisp/no-short-parameters": [
170
+ "error",
171
+
172
+ {
173
+ "exceptions": ["_", "$", "x", "y"]
174
+ }
175
+ ],
176
+ "crisp/no-useless-template-literals": "error",
177
+ "crisp/no-var-in-blocks": "error",
178
+ "crisp/one-space-after-operator": [
179
+ "error",
180
+
181
+ {
182
+ "checkColon": false
183
+ }
184
+ ],
185
+ "crisp/regex-in-constructor": "error",
186
+ "crisp/ternary-parenthesis": "error",
187
+ "crisp/variable-names": "error",
188
+
189
+ // General JSDoc rules
190
+ "jsdoc/require-description": "error",
191
+ "jsdoc/require-param-description": "off",
192
+ "jsdoc/require-jsdoc": [
193
+ "error",
194
+
195
+ {
196
+ "require": {
197
+ "FunctionDeclaration": true,
198
+ "MethodDefinition": true,
199
+ "ClassDeclaration": true,
200
+ "ArrowFunctionExpression": false,
201
+ "FunctionExpression": false
202
+ },
203
+
204
+ "contexts": [
205
+ "Property[key.name=\"getters\"] > ObjectExpression > Property",
206
+ "Property[key.name=\"methods\"] > ObjectExpression > Property"
207
+ ]
208
+ }
209
+ ],
210
+ "jsdoc/sort-tags": [
211
+ "error",
212
+
213
+ {
214
+ "tagSequence": [
215
+ {
216
+ "tags": [
217
+ "private",
218
+ "protected",
219
+ "public",
220
+
221
+ "class",
222
+
223
+ "classdesc",
224
+
225
+ "param",
226
+ "return"
227
+ ]
228
+ }
229
+ ]
230
+ }
231
+ ],
232
+
233
+ // Crisp JSDoc rules
234
+ "crisp/jsdoc-align-params": "error",
235
+ "crisp/jsdoc-check-indentation": "error",
236
+ "crisp/jsdoc-check-optional-params": "error",
237
+ "crisp/jsdoc-enforce-access": "error",
238
+ "crisp/jsdoc-enforce-classdesc": "error",
239
+ "crisp/jsdoc-require-description-uppercase": "error",
240
+
241
+ // General Vue rules
242
+ "vue/attributes-order": [
243
+ "error",
244
+
245
+ {
246
+ "order": [
247
+ "RENDER_MODIFIERS",
248
+ "CONDITIONALS",
249
+ "OTHER_DIRECTIVES",
250
+ "LIST_RENDERING",
251
+ "SLOT",
252
+ "TWO_WAY_BINDING",
253
+ "CONTENT",
254
+ "EVENTS",
255
+ "DEFINITION",
256
+ "ATTR_DYNAMIC",
257
+ "ATTR_STATIC",
258
+ "ATTR_SHORTHAND_BOOL"
259
+ ],
260
+ "alphabetical": false
261
+ }
262
+ ],
263
+ "vue/block-lang": [
264
+ "error",
265
+
266
+ {
267
+ "script": { "allowNoLang": true }
268
+ }
269
+ ],
270
+ "vue/block-order": [
271
+ "error",
272
+
273
+ {
274
+ "order": ["template", "script", "style"]
275
+ }
276
+ ],
277
+ "vue/block-tag-newline": [
278
+ "error",
279
+
280
+ {
281
+ "singleline": "always",
282
+ "multiline": "always",
283
+ "maxEmptyLines": 0
284
+ }
285
+ ],
286
+ "vue/comma-dangle": "error",
287
+ "vue/component-api-style": ["error", ["options"]],
288
+ "vue/component-name-in-template-casing": ["error", "kebab-case"],
289
+ "vue/component-options-name-casing": ["error", "PascalCase"],
290
+ "vue/custom-event-name-casing": [
291
+ "error",
292
+ "camelCase",
293
+
294
+ {
295
+ "ignores": [
296
+ "/^[a-z]+(?:-[a-z]+)*(?::[a-z]+(?:-[a-z]+)*)*$/i"
297
+ ]
298
+ }
299
+ ],
300
+ "vue/eqeqeq": "error",
301
+ "vue/html-comment-content-spacing": ["error", "always"],
302
+ "vue/html-quotes": "off",
303
+ "vue/key-spacing": [
304
+ "error",
305
+
306
+ {
307
+ "beforeColon": false,
308
+ "afterColon": true
309
+ }
310
+ ],
311
+ "vue/match-component-import-name": "error",
312
+ "vue/max-len": [
313
+ "error",
314
+
315
+ {
316
+ "code": 80,
317
+ "template": 999,
318
+ "ignorePattern": "^import|\`(.+?)\`|\/\\*\\* \@type|\@return \\{|\\*{20,}",
319
+ "ignoreStrings": true,
320
+ "ignoreUrls": true,
321
+ "ignoreRegExpLiterals": true
322
+ }
323
+ ],
324
+ "vue/new-line-between-multi-line-property": "error",
325
+ "vue/no-bare-strings-in-template": "error",
326
+ "vue/no-irregular-whitespace": "error",
327
+ "vue/no-multiple-objects-in-class": "error",
328
+ "vue/no-mutating-props": [
329
+ "error",
330
+
331
+ {
332
+ "shallowOnly": true
333
+ }
334
+ ],
335
+ "vue/no-static-inline-styles": "error",
336
+ "vue/no-use-v-else-with-v-for": "error",
337
+ "vue/no-useless-v-bind": "error",
338
+ "vue/no-v-html": "off",
339
+ "vue/padding-line-between-blocks": ["error", "always"],
340
+ "vue/padding-lines-in-component-definition": [
341
+ "error",
342
+
343
+ {
344
+ "groupSingleLineProperties": false
345
+ }
346
+ ],
347
+ "vue/prefer-true-attribute-shorthand": "error",
348
+ "vue/require-direct-export": "error",
349
+ "vue/v-for-delimiter-style": ["error", "in"],
350
+ "vue/v-slot-style": [
351
+ "error",
352
+
353
+ {
354
+ "atComponent": "v-slot",
355
+ "default": "v-slot",
356
+ "named": "longform"
357
+ }
358
+ ],
359
+
360
+ // Crisp Vue rules
361
+ "crisp/vue-attribute-comma": "error",
362
+ "crisp/vue-attribute-linebreak": "error",
363
+ "crisp/vue-computed-order": "error",
364
+ "crisp/vue-emits-order": "error",
365
+ "crisp/vue-header-check": "error",
366
+ "crisp/vue-html-indent": "error",
367
+ "crisp/vue-html-quotes": "error",
368
+ "crisp/vue-no-regex-data": "error",
369
+ "crisp/vue-props-declaration-line-break": "error",
370
+ "crisp/vue-props-declaration-multiline": "error",
371
+ "crisp/vue-props-declaration-order": "error",
372
+ "crisp/vue-ref-case": "error"
373
+ }
366
374
  }
367
- };
375
+ ];
368
376
  }
package/recommended.js CHANGED
@@ -1,225 +1,226 @@
1
1
  import globals from "globals";
2
+ // import pluginJSdoc from "eslint-plugin-jsdoc";
2
3
 
3
4
  export default function configRecommended(plugin) {
4
- return {
5
- languageOptions: {
6
- globals: {
7
- ...globals.browser,
8
- ...globals.node
9
- }
10
- },
11
-
12
- plugins: {
13
- "eslint-plugin-jsdoc",
14
- "eslint-plugin-crisp": plugin
15
- },
16
-
17
- extends: [
18
- "plugin:jsdoc/recommended"
19
- ],
20
-
21
- settings: {
22
- jsdoc: {
23
- tagNamePreference: {
24
- returns: "return"
25
- },
26
-
27
- preferredTypes: {
28
- Function: "function",
29
- Array: "array",
30
- Integer: "number"
5
+ return [
6
+ // pluginJSdoc.configs["flat/recommended"],
7
+
8
+ {
9
+ languageOptions: {
10
+ globals: {
11
+ ...globals.browser,
12
+ ...globals.node
31
13
  }
32
- }
33
- },
14
+ },
34
15
 
35
- rules: {
36
- // General JS rules
37
- "arrow-parens": ["error", "always"],
38
- "brace-style": [
39
- "error",
40
- "1tbs",
16
+ plugins: {
17
+ // "jsdoc": pluginJSdoc,
18
+ "crisp": plugin
19
+ },
41
20
 
42
- {
43
- "allowSingleLine": true
44
- }
45
- ],
46
- "comma-dangle": ["error", "never"],
47
- "comma-style": ["error", "last"],
48
- "curly": "error",
49
- "default-param-last": "error",
50
- "default-case-last": "error",
51
- "dot-notation": "error",
52
- "eqeqeq": "error",
53
- "eol-last": "error",
54
- "for-direction": "error",
55
- "indent": [
56
- "error",
57
- 2,
58
-
59
- {
60
- "SwitchCase": 1,
61
- "FunctionDeclaration": {
62
- "parameters": "off"
21
+ settings: {
22
+ jsdoc: {
23
+ tagNamePreference: {
24
+ returns: "return"
63
25
  },
64
- "FunctionExpression": {
65
- "parameters": "off"
66
- },
67
- "CallExpression": {
68
- "arguments": "off"
69
- },
70
- "VariableDeclarator": "first",
71
- "outerIIFEBody": 0,
72
- "ArrayExpression": "first",
73
- "ObjectExpression": "first",
74
- "ImportDeclaration": "first",
75
- "flatTernaryExpressions": false,
76
- "ignoredNodes": [
77
- "BinaryExpression",
78
- "ConditionalExpression",
79
- "IfStatement *",
80
- "VariableDeclarator",
81
- "VariableDeclarator > CallExpression",
82
- "CallExpression > ArrayExpression"
83
- ]
84
- }
85
- ],
86
- "keyword-spacing": "error",
87
- "linebreak-style": ["error", "unix"],
88
- "max-len": ["error", 80],
89
- "no-console": "warn",
90
- "no-debugger": "warn",
91
- "no-eval": "error",
92
- "no-magic-numbers": [
93
- "error",
94
-
95
- {
96
- "ignore": [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100],
97
- "ignoreArrayIndexes": true,
98
- "ignoreDefaultValues": true
99
- }
100
- ],
101
- "no-multi-str": "error",
102
- "no-mixed-spaces-and-tabs": "error",
103
- "no-tabs": "error",
104
- "no-trailing-spaces": "error",
105
- "no-undef": "error",
106
- "no-unused-vars": "warn",
107
- "no-unsafe-optional-chaining": "error",
108
- "object-curly-newline": [
109
- "error",
110
-
111
- {
112
- "multiline": true, "consistent": true
113
- }
114
- ],
115
- "object-curly-spacing": ["error", "always"],
116
- "padded-blocks": ["error", "never"],
117
- "padding-line-between-statements": [
118
- "error",
119
-
120
- { "blankLine": "always", "prev": "let", "next": "*" },
121
- { "blankLine": "any", "prev": "let", "next": "let" },
122
- { "blankLine": "always", "prev": "const", "next": "*" },
123
- { "blankLine": "any", "prev": "const", "next": "const" },
124
- { "blankLine": "always", "prev": "block-like", "next": "*" },
125
- { "blankLine": "always", "prev": "*", "next": "break" },
126
- { "blankLine": "any", "prev": "empty", "next": "break" },
127
- { "blankLine": "always", "prev": "*", "next": "block-like" },
128
- { "blankLine": "any", "prev": "case", "next": "case" },
129
- { "blankLine": "always", "prev": "continue", "next": "*" },
130
- { "blankLine": "always", "prev": "break", "next": "*" }
131
- ],
132
- "quotes": [
133
- "error",
134
- "double",
135
-
136
- {
137
- "avoidEscape": true, "allowTemplateLiterals": true
138
- }
139
- ],
140
- "quote-props": ["error", "as-needed"],
141
- "semi": ["error", "always"],
142
- "semi-style": ["error", "last"],
143
- "space-before-blocks": "error",
144
- "space-in-parens": ["error", "never"],
145
-
146
- // Crisp JS rules
147
- "crisp/align-comments": "error",
148
- "crisp/align-consecutive-class-assignements": "error",
149
- "crisp/align-one-var": "error",
150
- "crisp/align-requires": "error",
151
- "crisp/const": "error",
152
- "crisp/constructor-variables": "error",
153
- "crisp/enforce-optional": "error",
154
- "crisp/header-check": "error",
155
- "crisp/header-comments-check": "error",
156
- "crisp/methods-naming": "error",
157
- "crisp/methods-ordering": "error",
158
- "crisp/multiline-comment-end-backslash": "error",
159
- "crisp/newline-after-switch-case": "error",
160
- "crisp/no-async": "error",
161
- "crisp/no-extra-line-within-function": "error",
162
- "crisp/no-var-in-blocks": "error",
163
- "crisp/no-short-parameters": [
164
- "error",
165
-
166
- {
167
- "exceptions": ["_", "$"]
168
- }
169
- ],
170
- "crisp/no-space-in-optional-arguments": "error",
171
- "crisp/one-space-after-operator": "error",
172
- "crisp/regex-in-constructor": "error",
173
- "crisp/ternary-parenthesis": "error",
174
- "crisp/two-lines-between-class-members": "error",
175
- "crisp/variable-names": "error",
176
-
177
- // General JSDoc rules
178
- "jsdoc/no-undefined-types": "off",
179
- "jsdoc/require-jsdoc": [
180
- "error",
181
-
182
- {
183
- require: {
184
- "FunctionDeclaration": true,
185
- "MethodDefinition": true,
186
- "ClassDeclaration": true,
187
- "ArrowFunctionExpression": false,
188
- "FunctionExpression": false
26
+
27
+ preferredTypes: {
28
+ Function: "function",
29
+ Array: "array",
30
+ Integer: "number"
189
31
  }
190
32
  }
191
- ],
192
- "jsdoc/require-param-description": "off",
193
- "jsdoc/sort-tags": [
194
- "error",
195
-
196
- {
197
- tagSequence: [
198
- {
199
- tags: [
200
- "private",
201
- "protected",
202
- "public",
203
-
204
- "class",
205
- "classdesc",
206
-
207
- "generator",
208
-
209
- "param",
210
- "return",
211
- "yields"
212
- ]
33
+ },
34
+
35
+ rules: {
36
+ // General JS rules
37
+ "arrow-parens": ["error", "always"],
38
+ "brace-style": [
39
+ "error",
40
+ "1tbs",
41
+
42
+ {
43
+ "allowSingleLine": true
44
+ }
45
+ ],
46
+ "comma-dangle": ["error", "never"],
47
+ "comma-style": ["error", "last"],
48
+ "curly": "error",
49
+ "default-param-last": "error",
50
+ "default-case-last": "error",
51
+ "dot-notation": "error",
52
+ "eqeqeq": "error",
53
+ "eol-last": "error",
54
+ "for-direction": "error",
55
+ "indent": [
56
+ "error",
57
+ 2,
58
+
59
+ {
60
+ "SwitchCase": 1,
61
+ "FunctionDeclaration": {
62
+ "parameters": "off"
63
+ },
64
+ "FunctionExpression": {
65
+ "parameters": "off"
66
+ },
67
+ "CallExpression": {
68
+ "arguments": "off"
69
+ },
70
+ "VariableDeclarator": "first",
71
+ "outerIIFEBody": 0,
72
+ "ArrayExpression": "first",
73
+ "ObjectExpression": "first",
74
+ "ImportDeclaration": "first",
75
+ "flatTernaryExpressions": false,
76
+ "ignoredNodes": [
77
+ "BinaryExpression",
78
+ "ConditionalExpression",
79
+ "IfStatement *",
80
+ "VariableDeclarator",
81
+ "VariableDeclarator > CallExpression",
82
+ "CallExpression > ArrayExpression"
83
+ ]
84
+ }
85
+ ],
86
+ "keyword-spacing": "error",
87
+ "linebreak-style": ["error", "unix"],
88
+ "max-len": ["error", 80],
89
+ "no-console": "warn",
90
+ "no-debugger": "warn",
91
+ "no-eval": "error",
92
+ "no-magic-numbers": [
93
+ "error",
94
+
95
+ {
96
+ "ignore": [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100],
97
+ "ignoreArrayIndexes": true,
98
+ "ignoreDefaultValues": true
99
+ }
100
+ ],
101
+ "no-multi-str": "error",
102
+ "no-mixed-spaces-and-tabs": "error",
103
+ "no-tabs": "error",
104
+ "no-trailing-spaces": "error",
105
+ "no-undef": "error",
106
+ "no-unused-vars": "warn",
107
+ "no-unsafe-optional-chaining": "error",
108
+ "object-curly-newline": [
109
+ "error",
110
+
111
+ {
112
+ "multiline": true, "consistent": true
113
+ }
114
+ ],
115
+ "object-curly-spacing": ["error", "always"],
116
+ "padded-blocks": ["error", "never"],
117
+ "padding-line-between-statements": [
118
+ "error",
119
+
120
+ { "blankLine": "always", "prev": "let", "next": "*" },
121
+ { "blankLine": "any", "prev": "let", "next": "let" },
122
+ { "blankLine": "always", "prev": "const", "next": "*" },
123
+ { "blankLine": "any", "prev": "const", "next": "const" },
124
+ { "blankLine": "always", "prev": "block-like", "next": "*" },
125
+ { "blankLine": "always", "prev": "*", "next": "break" },
126
+ { "blankLine": "any", "prev": "empty", "next": "break" },
127
+ { "blankLine": "always", "prev": "*", "next": "block-like" },
128
+ { "blankLine": "any", "prev": "case", "next": "case" },
129
+ { "blankLine": "always", "prev": "continue", "next": "*" },
130
+ { "blankLine": "always", "prev": "break", "next": "*" }
131
+ ],
132
+ "quotes": [
133
+ "error",
134
+ "double",
135
+
136
+ {
137
+ "avoidEscape": true, "allowTemplateLiterals": true
138
+ }
139
+ ],
140
+ "quote-props": ["error", "as-needed"],
141
+ "semi": ["error", "always"],
142
+ "semi-style": ["error", "last"],
143
+ "space-before-blocks": "error",
144
+ "space-in-parens": ["error", "never"],
145
+
146
+ // Crisp JS rules
147
+ "crisp/align-comments": "error",
148
+ "crisp/align-consecutive-class-assignements": "error",
149
+ "crisp/align-one-var": "error",
150
+ "crisp/align-requires": "error",
151
+ "crisp/const": "error",
152
+ "crisp/constructor-variables": "error",
153
+ "crisp/enforce-optional": "error",
154
+ "crisp/header-check": "error",
155
+ "crisp/header-comments-check": "error",
156
+ "crisp/methods-naming": "error",
157
+ "crisp/methods-ordering": "error",
158
+ "crisp/multiline-comment-end-backslash": "error",
159
+ "crisp/newline-after-switch-case": "error",
160
+ "crisp/no-async": "error",
161
+ "crisp/no-extra-line-within-function": "error",
162
+ "crisp/no-var-in-blocks": "error",
163
+ "crisp/no-short-parameters": [
164
+ "error",
165
+
166
+ {
167
+ "exceptions": ["_", "$"]
168
+ }
169
+ ],
170
+ "crisp/no-space-in-optional-arguments": "error",
171
+ "crisp/one-space-after-operator": "error",
172
+ "crisp/regex-in-constructor": "error",
173
+ "crisp/ternary-parenthesis": "error",
174
+ "crisp/two-lines-between-class-members": "error",
175
+ "crisp/variable-names": "error",
176
+
177
+ // General JSDoc rules
178
+ "jsdoc/no-undefined-types": "off",
179
+ "jsdoc/require-jsdoc": [
180
+ "error",
181
+
182
+ {
183
+ require: {
184
+ "FunctionDeclaration": true,
185
+ "MethodDefinition": true,
186
+ "ClassDeclaration": true,
187
+ "ArrowFunctionExpression": false,
188
+ "FunctionExpression": false
213
189
  }
214
- ]
215
- }
216
- ],
190
+ }
191
+ ],
192
+ "jsdoc/require-param-description": "off",
193
+ "jsdoc/sort-tags": [
194
+ "error",
195
+
196
+ {
197
+ tagSequence: [
198
+ {
199
+ tags: [
200
+ "private",
201
+ "protected",
202
+ "public",
203
+
204
+ "class",
205
+ "classdesc",
206
+
207
+ "generator",
208
+
209
+ "param",
210
+ "return",
211
+ "yields"
212
+ ]
213
+ }
214
+ ]
215
+ }
216
+ ],
217
217
 
218
- // Crisp JSDoc rules
219
- "crisp/jsdoc-align-params": "error",
220
- "crisp/jsdoc-check-indentation": "error",
221
- "crisp/jsdoc-enforce-classdesc": "error",
222
- "crisp/jsdoc-require-description-uppercase": "error"
218
+ // Crisp JSDoc rules
219
+ "crisp/jsdoc-align-params": "error",
220
+ "crisp/jsdoc-check-indentation": "error",
221
+ "crisp/jsdoc-enforce-classdesc": "error",
222
+ "crisp/jsdoc-require-description-uppercase": "error"
223
+ }
223
224
  }
224
- };
225
+ ];
225
226
  }