@momsfriendlydevco/eslint-config 1.0.0 → 1.0.2

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 +55 -10
  3. package/package.json +1 -1
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
@@ -17,10 +17,13 @@ module.exports = {
17
17
  files: ['*.doop'],
18
18
  parser: 'vue-eslint-parser',
19
19
  globals: {
20
- app: 'readable', // global backend App object
20
+ app: 'readable', // Global backend App object
21
+ db: 'readable', // Global app.db shortcut
21
22
  },
22
23
  rules: {
23
24
  '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'],
24
27
  },
25
28
  },
26
29
  // }}}
@@ -35,11 +38,11 @@ module.exports = {
35
38
  },
36
39
  globals: {
37
40
  $: 'readable', // jQuery
38
- _: 'readable', // lodash
39
- app: 'readable', // global frontend app object
41
+ _: 'readable', // Lodash
42
+ app: 'readable', // Global frontend app object
40
43
  },
41
44
  rules: {
42
- 'vue/attributes-order': ['error', {
45
+ 'vue/attributes-order': ['warn', {
43
46
  'order': [
44
47
  'DEFINITION',
45
48
  'LIST_RENDERING',
@@ -48,24 +51,66 @@ module.exports = {
48
51
  'GLOBAL',
49
52
  ['UNIQUE', 'SLOT'],
50
53
  'TWO_WAY_BINDING',
51
- 'OTHER_DIRECTIVES',
52
- 'EVENTS',
54
+ ['OTHER_DIRECTIVES', 'EVENTS'],
53
55
  'CONTENT',
54
56
  'OTHER_ATTR',
55
57
  ],
56
- 'alphabetical': false
58
+ 'alphabetical': false,
57
59
  }],
58
60
  'vue/component-definition-name-casing': ['off', 'PascalCase'], // FIXME: Doesn't support camelCase yet
59
61
  'vue/html-closing-bracket-spacing': ['warn', {
60
- 'selfClosingTag': 'never'
62
+ selfClosingTag: 'never'
61
63
  }],
62
64
  'vue/html-indent': ['error', 'tab'],
63
65
  'vue/max-attributes-per-line': ['warn', {
64
- 'singleline': 4,
65
- 'multiline': 1,
66
+ singleline: 4,
67
+ multiline: 1,
66
68
  }],
67
69
  'vue/multi-word-component-names': ['off'],
70
+ 'vue/multiline-html-element-content-newline': ['warn', {
71
+ allowEmptyLines: true,
72
+ }],
68
73
  'vue/mustache-interpolation-spacing': ['warn', 'never'],
74
+ 'vue/order-in-components': ['warn', {
75
+ 'order': [
76
+ 'el',
77
+ 'name',
78
+ 'key',
79
+ 'parent',
80
+ 'functional',
81
+ ['delimiters', 'comments'],
82
+ ['components', 'directives', 'filters'],
83
+ 'extends',
84
+ 'mixins',
85
+ ['provide', 'inject'],
86
+ 'ROUTER_GUARDS',
87
+ 'layout',
88
+ 'middleware',
89
+ 'validate',
90
+ 'scrollToTop',
91
+ 'transition',
92
+ 'loading',
93
+ 'inheritAttrs',
94
+ 'model',
95
+ ['data', 'asyncData', 'props', 'propsData'],
96
+ 'computed',
97
+ 'emits',
98
+ 'setup',
99
+ 'fetch',
100
+ 'head',
101
+ 'methods',
102
+ 'LIFECYCLE_HOOKS',
103
+ 'watch',
104
+ 'watchQuery',
105
+ ['template', 'render'],
106
+ 'renderError'
107
+ ]
108
+ }],
109
+ 'vue/require-default-prop': ['off'],
110
+ 'vue/singleline-html-element-content-newline': ['warn', {
111
+ ignoreWhenNoAttributes: true,
112
+ ignores: ['pre', 'textarea', 'div', 'INLINE_ELEMENTS'],
113
+ }],
69
114
  },
70
115
  },
71
116
  // }}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momsfriendlydevco/eslint-config",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "ESLint plugin for @MomsFriendlyDevCo projects",
5
5
  "main": "index.js",
6
6
  "scripts": {