@momsfriendlydevco/eslint-config 1.0.1 → 1.0.3

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 +23 -3
  2. package/index.js +58 -9
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1,5 +1,25 @@
1
- @MomsFriendlyDevCo/eslint
2
- =========================
1
+ @MomsFriendlyDevCo/ESLint-Config
2
+ ================================
3
3
  ESLint Rules for Mom's Friendly Dev Co.
4
4
 
5
- See [@Doop/ESM-Loader](https://github.com/MomsFriendlyDevCo/doop-esm-loader) for full details + basic `package.json` setup template.
5
+ Installation
6
+ ------------
7
+ Merge the following into `package.json`:
8
+
9
+ ```json
10
+ {
11
+ "scripts": {
12
+ "lint": "eslint --ext .doop --ext .js --ext .vue ."
13
+ },
14
+ "eslintConfig": {
15
+ "extends": [
16
+ "@momsfriendlydevco"
17
+ ],
18
+ "parserOptions": {
19
+ "ecmaVersion": "latest"
20
+ }
21
+ }
22
+ }
23
+ ```
24
+
25
+ See [@Doop/ESM-Loader](https://github.com/MomsFriendlyDevCo/doop-esm-loader) for more integration details.
package/index.js CHANGED
@@ -1,3 +1,10 @@
1
+ // Rules shared by both .doop + .vue files
2
+ let vueCommonRules = {
3
+ 'html-closing-bracket-spacing': ['off'], // Annoying doesn't allow <this-kind-of-thing/>
4
+ 'no-useless-escape': ['off'], // ESlint frequently gets what should and shouldn't be escaped wrong
5
+ 'no-unused-vars': ['warn'], // Dont make unused vars the end of the world
6
+ };
7
+
1
8
  module.exports = {
2
9
  extends: [
3
10
  'plugin:vue/recommended',
@@ -22,8 +29,7 @@ module.exports = {
22
29
  },
23
30
  rules: {
24
31
  'vue/comment-directive': ['off'], // Screws up block parsing and we don't have <template/> anyway
25
- 'no-useless-escape': ['off'], // ESlint frequently gets what should and shouldn't be escaped wrong
26
- 'no-unused-vars': ['warn'],
32
+ ...vueCommonRules,
27
33
  },
28
34
  },
29
35
  // }}}
@@ -42,7 +48,7 @@ module.exports = {
42
48
  app: 'readable', // Global frontend app object
43
49
  },
44
50
  rules: {
45
- 'vue/attributes-order': ['error', {
51
+ 'vue/attributes-order': ['warn', {
46
52
  'order': [
47
53
  'DEFINITION',
48
54
  'LIST_RENDERING',
@@ -51,24 +57,67 @@ module.exports = {
51
57
  'GLOBAL',
52
58
  ['UNIQUE', 'SLOT'],
53
59
  'TWO_WAY_BINDING',
54
- 'OTHER_DIRECTIVES',
55
- 'EVENTS',
60
+ ['OTHER_DIRECTIVES', 'EVENTS'],
56
61
  'CONTENT',
57
62
  'OTHER_ATTR',
58
63
  ],
59
- 'alphabetical': false
64
+ 'alphabetical': false,
60
65
  }],
61
66
  'vue/component-definition-name-casing': ['off', 'PascalCase'], // FIXME: Doesn't support camelCase yet
62
67
  'vue/html-closing-bracket-spacing': ['warn', {
63
- 'selfClosingTag': 'never'
68
+ selfClosingTag: 'never'
64
69
  }],
65
70
  'vue/html-indent': ['error', 'tab'],
66
71
  'vue/max-attributes-per-line': ['warn', {
67
- 'singleline': 4,
68
- 'multiline': 1,
72
+ singleline: 4,
73
+ multiline: 1,
69
74
  }],
70
75
  'vue/multi-word-component-names': ['off'],
76
+ 'vue/multiline-html-element-content-newline': ['warn', {
77
+ allowEmptyLines: true,
78
+ }],
71
79
  'vue/mustache-interpolation-spacing': ['warn', 'never'],
80
+ 'vue/order-in-components': ['warn', {
81
+ 'order': [
82
+ 'el',
83
+ 'name',
84
+ 'key',
85
+ 'parent',
86
+ 'functional',
87
+ ['delimiters', 'comments'],
88
+ ['components', 'directives', 'filters'],
89
+ 'extends',
90
+ 'mixins',
91
+ ['provide', 'inject'],
92
+ 'ROUTER_GUARDS',
93
+ 'layout',
94
+ 'middleware',
95
+ 'validate',
96
+ 'scrollToTop',
97
+ 'transition',
98
+ 'loading',
99
+ 'inheritAttrs',
100
+ 'model',
101
+ ['data', 'asyncData', 'props', 'propsData'],
102
+ 'computed',
103
+ 'emits',
104
+ 'setup',
105
+ 'fetch',
106
+ 'head',
107
+ 'methods',
108
+ 'LIFECYCLE_HOOKS',
109
+ 'watch',
110
+ 'watchQuery',
111
+ ['template', 'render'],
112
+ 'renderError'
113
+ ]
114
+ }],
115
+ 'vue/require-default-prop': ['off'],
116
+ 'vue/singleline-html-element-content-newline': ['warn', {
117
+ ignoreWhenNoAttributes: true,
118
+ ignores: ['pre', 'textarea', 'div', 'INLINE_ELEMENTS'],
119
+ }],
120
+ ...vueCommonRules,
72
121
  },
73
122
  },
74
123
  // }}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momsfriendlydevco/eslint-config",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "ESLint plugin for @MomsFriendlyDevCo projects",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "homepage": "https://github.com/MomsFriendlyDevCo/eslint#readme",
23
23
  "dependencies": {
24
- "eslint-plugin-vue": "^9.10.0"
24
+ "eslint-plugin-vue": "^9.13.0"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "eslint": "^8.37.0"