@maltjoy/eslint-rules 0.1.0 → 0.2.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.
Files changed (3) hide show
  1. package/README.md +26 -3
  2. package/index.js +17 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -14,6 +14,8 @@ Message:
14
14
 
15
15
  ## Usage (flat config)
16
16
 
17
+ **Preset (recommended)** — active toutes les règles du design system d’un coup :
18
+
17
19
  ```js
18
20
  const maltjoyRules = require('@maltjoy/eslint-rules');
19
21
  const vueParser = require('vue-eslint-parser');
@@ -24,11 +26,32 @@ module.exports = [
24
26
  languageOptions: {
25
27
  parser: vueParser,
26
28
  },
27
- plugins: {
28
- '@maltjoy/eslint-rules': maltjoyRules,
29
+ },
30
+ ...maltjoyRules.configs.recommended,
31
+ ];
32
+ ```
33
+
34
+ Les sévérités par défaut du preset sont en `error`. Pour assouplir une règle, ajoute un bloc **après** le spread :
35
+
36
+ ```js
37
+ ...maltjoyRules.configs.recommended,
38
+ {
39
+ rules: {
40
+ '@maltjoy/eslint-rules/no-vjoybutton-circle': 'warn',
29
41
  },
42
+ },
43
+ ```
44
+
45
+ **Règles à la carte** (sans preset) :
46
+
47
+ ```js
48
+ const maltjoyRules = require('@maltjoy/eslint-rules');
49
+
50
+ module.exports = [
51
+ {
52
+ plugins: {'@maltjoy/eslint-rules': maltjoyRules},
30
53
  rules: {
31
- '@maltjoy/eslint-rules/no-vjoybutton-circle': 'warn', // or 'error'
54
+ '@maltjoy/eslint-rules/no-vjoybutton-circle': 'warn',
32
55
  },
33
56
  },
34
57
  ];
package/index.js CHANGED
@@ -6,6 +6,22 @@ const rules = {
6
6
  'no-vjoyinput-type-password': noVJoyInputTypePassword,
7
7
  };
8
8
 
9
- module.exports = {
9
+ const plugin = {
10
10
  rules,
11
+ configs: {},
11
12
  };
13
+
14
+ plugin.configs.recommended = [
15
+ {
16
+ name: '@maltjoy/eslint-rules/recommended',
17
+ plugins: {
18
+ '@maltjoy/eslint-rules': plugin,
19
+ },
20
+ rules: {
21
+ '@maltjoy/eslint-rules/no-vjoybutton-circle': 'error',
22
+ '@maltjoy/eslint-rules/no-vjoyinput-type-password': 'error',
23
+ },
24
+ },
25
+ ];
26
+
27
+ module.exports = plugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maltjoy/eslint-rules",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Custom ESLint rules for the @maltjoy/core-vue design system",
5
5
  "main": "index.js",
6
6
  "files": [