@momsfriendlydevco/eslint-config 2.1.5 → 2.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.
- package/README.md +1 -19
- package/eslint.config.js +22 -0
- package/index.js +16 -4
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -10,22 +10,4 @@ Installation
|
|
|
10
10
|
npm i -D eslint @momsfriendlydevco/eslint-config
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
2. Add this template
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
```javascript
|
|
17
|
-
import RulesMFDC from '@momsfriendlydevco/eslint-config';
|
|
18
|
-
|
|
19
|
-
export default [
|
|
20
|
-
{
|
|
21
|
-
// Global ignore rules - Do not add any other keys to this object or eslint doesn't treat this as global
|
|
22
|
-
ignores: [
|
|
23
|
-
'.*',
|
|
24
|
-
'docs/',
|
|
25
|
-
'dist/',
|
|
26
|
-
'node_modules/',
|
|
27
|
-
],
|
|
28
|
-
},
|
|
29
|
-
...RulesMFDC,
|
|
30
|
-
]
|
|
31
|
-
```
|
|
13
|
+
2. Add this template [eslint.config.js](./eslint.config.js) file to the root of your main module / project
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import RulesMFDC from '@momsfriendlydevco/eslint-config';
|
|
2
|
+
|
|
3
|
+
export default [
|
|
4
|
+
{
|
|
5
|
+
// Global ignore rules - Do not add any other keys to this object or eslint doesn't treat this as global
|
|
6
|
+
ignores: [
|
|
7
|
+
'.*',
|
|
8
|
+
'docs/',
|
|
9
|
+
'dist/',
|
|
10
|
+
'node_modules/',
|
|
11
|
+
],
|
|
12
|
+
|
|
13
|
+
// Generic globals
|
|
14
|
+
languageOptions: {
|
|
15
|
+
globals: {
|
|
16
|
+
console: 'readonly',
|
|
17
|
+
fetch: 'readonly',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
...RulesMFDC,
|
|
22
|
+
]
|
package/index.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import eslintParser from 'vue-eslint-parser';
|
|
2
|
+
import pluginEslintJS from '@eslint/js';
|
|
2
3
|
import pluginJSDoc from 'eslint-plugin-jsdoc';
|
|
3
4
|
import pluginUnicorn from 'eslint-plugin-unicorn';
|
|
4
5
|
import pluginVue from 'eslint-plugin-vue';
|
|
5
6
|
|
|
6
7
|
// Rules shared by both .doop + .vue files
|
|
7
8
|
export let JSCommon = {
|
|
9
|
+
// Eslint/JS/recommended
|
|
10
|
+
...pluginEslintJS.configs.recommended.rules,
|
|
11
|
+
|
|
8
12
|
// Generic rules
|
|
9
13
|
'html-closing-bracket-spacing': ['off'], // Annoying doesn't allow <this-kind-of-thing/>
|
|
10
14
|
'no-debugger': ['warn'], // Debuggers are fine, just warn
|
|
@@ -155,9 +159,16 @@ export default [
|
|
|
155
159
|
selfClosingTag: 'never'
|
|
156
160
|
}],
|
|
157
161
|
'vue/html-indent': ['warn', 'tab', {
|
|
158
|
-
ignores: [ // Don't enforce indent rules for attributes that
|
|
159
|
-
'[class]',
|
|
162
|
+
ignores: [ // Don't enforce indent rules for attributes that can have indented logic
|
|
160
163
|
'[v-tooltip]',
|
|
164
|
+
|
|
165
|
+
// NOTE: Annoyingly this doesn't / can't match `[:class]` as that isn't valid esquery
|
|
166
|
+
// I've tried all the following to fix this but none of these work - MC 2025-05-07
|
|
167
|
+
// 'VAttribute[directive=true][key.name.name="class"]',
|
|
168
|
+
// 'VDirective[key.name=class]',
|
|
169
|
+
// 'VDirective[key.name=/class/]',
|
|
170
|
+
// '[/.class/]',
|
|
171
|
+
// NOTE: To fix add `// eslint-disable vue-/html-indent`
|
|
161
172
|
],
|
|
162
173
|
}],
|
|
163
174
|
'vue/html-self-closing': ['warn', {
|
|
@@ -185,10 +196,11 @@ export default [
|
|
|
185
196
|
'parent',
|
|
186
197
|
'functional',
|
|
187
198
|
['delimiters', 'comments'],
|
|
188
|
-
|
|
199
|
+
'inject',
|
|
200
|
+
'provide',
|
|
189
201
|
'extends',
|
|
190
202
|
'mixins',
|
|
191
|
-
['
|
|
203
|
+
['components', 'directives', 'emits', 'filters'],
|
|
192
204
|
'ROUTER_GUARDS',
|
|
193
205
|
'layout',
|
|
194
206
|
'middleware',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momsfriendlydevco/eslint-config",
|
|
3
3
|
"description": "ESLint plugin for @MomsFriendlyDevCo projects",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "eslint --config index.js test/data"
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
},
|
|
25
25
|
"homepage": "https://github.com/MomsFriendlyDevCo/eslint#readme",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"eslint-plugin-jsdoc": "^
|
|
28
|
-
"eslint-plugin-unicorn": "^
|
|
29
|
-
"eslint-plugin-vue": "^10.
|
|
27
|
+
"eslint-plugin-jsdoc": "^51.0.1",
|
|
28
|
+
"eslint-plugin-unicorn": "^59.0.1",
|
|
29
|
+
"eslint-plugin-vue": "^10.2.0",
|
|
30
30
|
"vue-eslint-parser": "^10.1.3"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"eslint": "
|
|
33
|
+
"eslint": "^9.26.0"
|
|
34
34
|
}
|
|
35
35
|
}
|