@momsfriendlydevco/eslint-config 2.1.6 → 2.2.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/README.md +1 -19
- package/eslint.config.js +21 -0
- package/index.js +38 -2
- package/package.json +3 -3
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,21 @@
|
|
|
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
|
+
// Put custom globals here
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
...RulesMFDC,
|
|
21
|
+
]
|
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
|
|
@@ -24,6 +28,22 @@ export let JSCommon = {
|
|
|
24
28
|
};
|
|
25
29
|
|
|
26
30
|
export default [
|
|
31
|
+
// Generic globals {{{
|
|
32
|
+
{
|
|
33
|
+
languageOptions: {
|
|
34
|
+
globals: {
|
|
35
|
+
clearInterval: 'readonly',
|
|
36
|
+
clearTimeout: 'readonly',
|
|
37
|
+
console: 'readonly',
|
|
38
|
+
fetch: 'readonly',
|
|
39
|
+
setInterval: 'readonly',
|
|
40
|
+
setTimeout: 'readonly',
|
|
41
|
+
window: 'readonly',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
// }}}
|
|
46
|
+
|
|
27
47
|
// eslint-plugin-jsdoc (with custom settings)
|
|
28
48
|
{
|
|
29
49
|
...pluginJSDoc.configs['flat/recommended'],
|
|
@@ -41,7 +61,7 @@ export default [
|
|
|
41
61
|
},
|
|
42
62
|
},
|
|
43
63
|
|
|
44
|
-
// eslint-plugin-unicorn
|
|
64
|
+
// eslint-plugin-unicorn {{{
|
|
45
65
|
{
|
|
46
66
|
...pluginUnicorn.configs['flat/recommended'],
|
|
47
67
|
rules: {
|
|
@@ -75,9 +95,11 @@ export default [
|
|
|
75
95
|
'unicorn/switch-case-braces': ['warn', 'avoid'],
|
|
76
96
|
},
|
|
77
97
|
},
|
|
98
|
+
// }}}
|
|
78
99
|
|
|
79
|
-
// eslint-plugin-vue
|
|
100
|
+
// eslint-plugin-vue {{{
|
|
80
101
|
...pluginVue.configs['flat/recommended'],
|
|
102
|
+
// }}}
|
|
81
103
|
|
|
82
104
|
// .doop backend Files {{{
|
|
83
105
|
{
|
|
@@ -105,6 +127,18 @@ export default [
|
|
|
105
127
|
},
|
|
106
128
|
// }}}
|
|
107
129
|
|
|
130
|
+
// Mocha test files {{{
|
|
131
|
+
{
|
|
132
|
+
files: ['**/test/**/*.js'],
|
|
133
|
+
languageOptions: {
|
|
134
|
+
globals: {
|
|
135
|
+
it: 'readonly',
|
|
136
|
+
describe: 'readonly',
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
// }}}
|
|
141
|
+
|
|
108
142
|
// .vue frontend Files {{{
|
|
109
143
|
{
|
|
110
144
|
files: ['**/*.vue'],
|
|
@@ -113,6 +147,8 @@ export default [
|
|
|
113
147
|
$: 'readable', // jQuery
|
|
114
148
|
_: 'readable', // Lodash
|
|
115
149
|
app: 'readable', // Global frontend app object
|
|
150
|
+
document: 'readable',
|
|
151
|
+
window: 'readable',
|
|
116
152
|
},
|
|
117
153
|
parser: eslintParser,
|
|
118
154
|
parserOptions: {
|
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.1
|
|
4
|
+
"version": "2.2.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "eslint --config index.js test/data"
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
},
|
|
25
25
|
"homepage": "https://github.com/MomsFriendlyDevCo/eslint#readme",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"eslint-plugin-jsdoc": "^
|
|
27
|
+
"eslint-plugin-jsdoc": "^51.0.1",
|
|
28
28
|
"eslint-plugin-unicorn": "^59.0.1",
|
|
29
|
-
"eslint-plugin-vue": "^10.
|
|
29
|
+
"eslint-plugin-vue": "^10.2.0",
|
|
30
30
|
"vue-eslint-parser": "^10.1.3"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|