@saashub/qoq-eslint-v9-ts-vitest 0.7.12 → 0.8.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/coverage/baseConfig.ts.html +12 -15
- package/coverage/clover.xml +15 -16
- package/coverage/coverage-final.json +2 -2
- package/coverage/eslintConfig.ts.html +14 -32
- package/coverage/index.html +11 -11
- package/lib/baseConfig.cjs +4 -2
- package/lib/baseConfig.d.ts +2 -2
- package/lib/baseConfig.mjs +4 -2
- package/lib/eslintConfig.cjs +5 -7
- package/lib/eslintConfig.d.ts +3 -3
- package/lib/eslintConfig.mjs +5 -7
- package/lib/index.cjs +1 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.mjs +1 -2
- package/package.json +7 -4
- package/qoq.config.js +3 -0
- package/src/baseConfig.spec.ts +1 -1
- package/src/baseConfig.ts +5 -6
- package/src/eslintConfig.spec.ts +4 -2
- package/src/eslintConfig.ts +8 -14
@@ -25,7 +25,7 @@
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
26
26
|
<span class="strong">100% </span>
|
27
27
|
<span class="quiet">Statements</span>
|
28
|
-
<span class='fraction'>
|
28
|
+
<span class='fraction'>18/18</span>
|
29
29
|
</div>
|
30
30
|
|
31
31
|
|
@@ -46,7 +46,7 @@
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
47
47
|
<span class="strong">100% </span>
|
48
48
|
<span class="quiet">Lines</span>
|
49
|
-
<span class='fraction'>
|
49
|
+
<span class='fraction'>18/18</span>
|
50
50
|
</div>
|
51
51
|
|
52
52
|
|
@@ -84,18 +84,16 @@
|
|
84
84
|
<a name='L19'></a><a href='#L19'>19</a>
|
85
85
|
<a name='L20'></a><a href='#L20'>20</a>
|
86
86
|
<a name='L21'></a><a href='#L21'>21</a>
|
87
|
-
<a name='L22'></a><a href='#L22'>22</a>
|
88
|
-
<
|
87
|
+
<a name='L22'></a><a href='#L22'>22</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
88
|
+
<span class="cline-any cline-yes">1x</span>
|
89
89
|
<span class="cline-any cline-yes">1x</span>
|
90
90
|
<span class="cline-any cline-yes">1x</span>
|
91
91
|
<span class="cline-any cline-yes">1x</span>
|
92
|
-
<span class="cline-any cline-neutral"> </span>
|
93
92
|
<span class="cline-any cline-yes">1x</span>
|
94
|
-
<span class="cline-any cline-neutral"> </span>
|
95
|
-
<span class="cline-any cline-neutral"> </span>
|
96
93
|
<span class="cline-any cline-neutral"> </span>
|
97
94
|
<span class="cline-any cline-yes">1x</span>
|
98
95
|
<span class="cline-any cline-yes">1x</span>
|
96
|
+
<span class="cline-any cline-neutral"> </span>
|
99
97
|
<span class="cline-any cline-yes">1x</span>
|
100
98
|
<span class="cline-any cline-yes">1x</span>
|
101
99
|
<span class="cline-any cline-yes">1x</span>
|
@@ -107,17 +105,16 @@
|
|
107
105
|
<span class="cline-any cline-yes">1x</span>
|
108
106
|
<span class="cline-any cline-neutral"> </span>
|
109
107
|
<span class="cline-any cline-yes">1x</span>
|
110
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import {
|
111
|
-
import
|
108
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { EslintConfig } from '@saashub/qoq-eslint-v9-js';
|
109
|
+
import { omitRules } from '@saashub/qoq-eslint-v9-js/tools';
|
112
110
|
import jsVitestBaseConfig from '@saashub/qoq-eslint-v9-js-vitest/baseConfig';
|
113
111
|
import tsBaseConfig from '@saashub/qoq-eslint-v9-ts/baseConfig';
|
114
|
-
|
112
|
+
import * as importPlugin from 'eslint-plugin-import';
|
115
113
|
import merge from 'lodash/merge.js';
|
116
114
|
|
117
|
-
|
118
|
-
|
119
|
-
const config = merge(
|
115
|
+
const config: EslintConfig = merge(
|
120
116
|
{},
|
117
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
|
121
118
|
omitRules(jsVitestBaseConfig, Object.keys(importPlugin.configs.recommended.rules)),
|
122
119
|
tsBaseConfig,
|
123
120
|
{
|
@@ -126,7 +123,7 @@ const config = merge(
|
|
126
123
|
'sonarjs/no-duplicate-string': 0,
|
127
124
|
},
|
128
125
|
}
|
129
|
-
)
|
126
|
+
);
|
130
127
|
|
131
128
|
export default config;
|
132
129
|
</pre></td></tr></table></pre>
|
@@ -136,7 +133,7 @@ export default config;
|
|
136
133
|
<div class='footer quiet pad2 space-top1 center small'>
|
137
134
|
Code coverage generated by
|
138
135
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
139
|
-
at 2024-09-
|
136
|
+
at 2024-09-08T11:48:50.208Z
|
140
137
|
</div>
|
141
138
|
<script src="prettify.js"></script>
|
142
139
|
<script>
|
package/coverage/clover.xml
CHANGED
@@ -1,15 +1,17 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<coverage generated="
|
3
|
-
<project timestamp="
|
4
|
-
<metrics statements="
|
2
|
+
<coverage generated="1725796130229" clover="3.2.0">
|
3
|
+
<project timestamp="1725796130229" name="All files">
|
4
|
+
<metrics statements="34" coveredstatements="34" conditionals="1" coveredconditionals="1" methods="1" coveredmethods="1" elements="36" coveredelements="36" complexity="0" loc="34" ncloc="34" packages="1" files="2" classes="2"/>
|
5
5
|
<file name="baseConfig.ts" path="/home/ladamczyk/Desktop/projects/qoq/packages/eslint-v9-ts-vitest/src/baseConfig.ts">
|
6
|
-
<metrics statements="
|
6
|
+
<metrics statements="18" coveredstatements="18" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
|
7
7
|
<line num="1" count="1" type="stmt"/>
|
8
8
|
<line num="2" count="1" type="stmt"/>
|
9
9
|
<line num="3" count="1" type="stmt"/>
|
10
10
|
<line num="4" count="1" type="stmt"/>
|
11
|
+
<line num="5" count="1" type="stmt"/>
|
11
12
|
<line num="6" count="1" type="stmt"/>
|
12
|
-
<line num="
|
13
|
+
<line num="8" count="1" type="stmt"/>
|
14
|
+
<line num="9" count="1" type="stmt"/>
|
13
15
|
<line num="11" count="1" type="stmt"/>
|
14
16
|
<line num="12" count="1" type="stmt"/>
|
15
17
|
<line num="13" count="1" type="stmt"/>
|
@@ -19,29 +21,26 @@
|
|
19
21
|
<line num="17" count="1" type="stmt"/>
|
20
22
|
<line num="18" count="1" type="stmt"/>
|
21
23
|
<line num="19" count="1" type="stmt"/>
|
22
|
-
<line num="
|
23
|
-
<line num="22" count="1" type="stmt"/>
|
24
|
+
<line num="21" count="1" type="stmt"/>
|
24
25
|
</file>
|
25
26
|
<file name="eslintConfig.ts" path="/home/ladamczyk/Desktop/projects/qoq/packages/eslint-v9-ts-vitest/src/eslintConfig.ts">
|
26
|
-
<metrics statements="
|
27
|
+
<metrics statements="16" coveredstatements="16" conditionals="1" coveredconditionals="1" methods="1" coveredmethods="1"/>
|
27
28
|
<line num="1" count="1" type="stmt"/>
|
28
29
|
<line num="2" count="1" type="stmt"/>
|
29
30
|
<line num="4" count="1" type="stmt"/>
|
31
|
+
<line num="6" count="1" type="stmt"/>
|
30
32
|
<line num="8" count="1" type="stmt"/>
|
31
|
-
<line num="
|
32
|
-
<line num="
|
33
|
+
<line num="12" count="1" type="cond" truecount="1" falsecount="0"/>
|
34
|
+
<line num="13" count="2" type="stmt"/>
|
35
|
+
<line num="14" count="2" type="stmt"/>
|
36
|
+
<line num="15" count="2" type="stmt"/>
|
33
37
|
<line num="16" count="2" type="stmt"/>
|
34
38
|
<line num="17" count="2" type="stmt"/>
|
35
39
|
<line num="18" count="2" type="stmt"/>
|
36
40
|
<line num="19" count="2" type="stmt"/>
|
37
41
|
<line num="20" count="2" type="stmt"/>
|
38
42
|
<line num="21" count="2" type="stmt"/>
|
39
|
-
<line num="
|
40
|
-
<line num="23" count="2" type="stmt"/>
|
41
|
-
<line num="24" count="2" type="stmt"/>
|
42
|
-
<line num="26" count="2" type="cond" truecount="0" falsecount="1"/>
|
43
|
-
<line num="27" count="2" type="stmt"/>
|
44
|
-
<line num="29" count="1" type="stmt"/>
|
43
|
+
<line num="23" count="1" type="stmt"/>
|
45
44
|
</file>
|
46
45
|
</project>
|
47
46
|
</coverage>
|
@@ -1,3 +1,3 @@
|
|
1
|
-
{"/home/ladamczyk/Desktop/projects/qoq/packages/eslint-v9-ts-vitest/src/baseConfig.ts": {"path":"/home/ladamczyk/Desktop/projects/qoq/packages/eslint-v9-ts-vitest/src/baseConfig.ts","all":false,"statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":
|
2
|
-
,"/home/ladamczyk/Desktop/projects/qoq/packages/eslint-v9-ts-vitest/src/eslintConfig.ts": {"path":"/home/ladamczyk/Desktop/projects/qoq/packages/eslint-v9-ts-vitest/src/eslintConfig.ts","all":false,"statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":
|
1
|
+
{"/home/ladamczyk/Desktop/projects/qoq/packages/eslint-v9-ts-vitest/src/baseConfig.ts": {"path":"/home/ladamczyk/Desktop/projects/qoq/packages/eslint-v9-ts-vitest/src/baseConfig.ts","all":false,"statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":60}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":77}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":64}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":53}},"5":{"start":{"line":6,"column":0},"end":{"line":6,"column":36}},"7":{"start":{"line":8,"column":0},"end":{"line":8,"column":35}},"8":{"start":{"line":9,"column":0},"end":{"line":9,"column":5}},"10":{"start":{"line":11,"column":0},"end":{"line":11,"column":85}},"11":{"start":{"line":12,"column":0},"end":{"line":12,"column":15}},"12":{"start":{"line":13,"column":0},"end":{"line":13,"column":3}},"13":{"start":{"line":14,"column":0},"end":{"line":14,"column":45}},"14":{"start":{"line":15,"column":0},"end":{"line":15,"column":12}},"15":{"start":{"line":16,"column":0},"end":{"line":16,"column":39}},"16":{"start":{"line":17,"column":0},"end":{"line":17,"column":6}},"17":{"start":{"line":18,"column":0},"end":{"line":18,"column":3}},"18":{"start":{"line":19,"column":0},"end":{"line":19,"column":2}},"20":{"start":{"line":21,"column":0},"end":{"line":21,"column":22}}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"7":1,"8":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"20":1},"branchMap":{},"b":{},"fnMap":{},"f":{}}
|
2
|
+
,"/home/ladamczyk/Desktop/projects/qoq/packages/eslint-v9-ts-vitest/src/eslintConfig.ts": {"path":"/home/ladamczyk/Desktop/projects/qoq/packages/eslint-v9-ts-vitest/src/eslintConfig.ts","all":false,"statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":36}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":38}},"5":{"start":{"line":6,"column":0},"end":{"line":6,"column":37}},"7":{"start":{"line":8,"column":0},"end":{"line":8,"column":31}},"11":{"start":{"line":12,"column":0},"end":{"line":12,"column":23}},"12":{"start":{"line":13,"column":0},"end":{"line":13,"column":18}},"13":{"start":{"line":14,"column":0},"end":{"line":14,"column":66}},"14":{"start":{"line":15,"column":0},"end":{"line":15,"column":14}},"15":{"start":{"line":16,"column":0},"end":{"line":16,"column":6}},"16":{"start":{"line":17,"column":0},"end":{"line":17,"column":25}},"17":{"start":{"line":18,"column":0},"end":{"line":18,"column":10}},"18":{"start":{"line":19,"column":0},"end":{"line":19,"column":12}},"19":{"start":{"line":20,"column":0},"end":{"line":20,"column":5}},"20":{"start":{"line":21,"column":0},"end":{"line":21,"column":2}},"22":{"start":{"line":23,"column":0},"end":{"line":23,"column":33}}},"s":{"0":1,"1":1,"3":1,"5":1,"7":1,"11":1,"12":2,"13":2,"14":2,"15":2,"16":2,"17":2,"18":2,"19":2,"20":2,"22":1},"branchMap":{"0":{"type":"branch","line":12,"loc":{"start":{"line":12,"column":22},"end":{"line":21,"column":2}},"locations":[{"start":{"line":12,"column":22},"end":{"line":21,"column":2}}]}},"b":{"0":[2]},"fnMap":{"0":{"name":"getEslintConfig","decl":{"start":{"line":12,"column":22},"end":{"line":21,"column":2}},"loc":{"start":{"line":12,"column":22},"end":{"line":21,"column":2}},"line":12}},"f":{"0":2}}
|
3
3
|
}
|
@@ -25,14 +25,14 @@
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
26
26
|
<span class="strong">100% </span>
|
27
27
|
<span class="quiet">Statements</span>
|
28
|
-
<span class='fraction'>
|
28
|
+
<span class='fraction'>16/16</span>
|
29
29
|
</div>
|
30
30
|
|
31
31
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
33
|
-
<span class="strong">
|
33
|
+
<span class="strong">100% </span>
|
34
34
|
<span class="quiet">Branches</span>
|
35
|
-
<span class='fraction'>1/
|
35
|
+
<span class='fraction'>1/1</span>
|
36
36
|
</div>
|
37
37
|
|
38
38
|
|
@@ -46,7 +46,7 @@
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
47
47
|
<span class="strong">100% </span>
|
48
48
|
<span class="quiet">Lines</span>
|
49
|
-
<span class='fraction'>
|
49
|
+
<span class='fraction'>16/16</span>
|
50
50
|
</div>
|
51
51
|
|
52
52
|
|
@@ -86,26 +86,17 @@
|
|
86
86
|
<a name='L21'></a><a href='#L21'>21</a>
|
87
87
|
<a name='L22'></a><a href='#L22'>22</a>
|
88
88
|
<a name='L23'></a><a href='#L23'>23</a>
|
89
|
-
<a name='L24'></a><a href='#L24'>24</a>
|
90
|
-
<a name='L25'></a><a href='#L25'>25</a>
|
91
|
-
<a name='L26'></a><a href='#L26'>26</a>
|
92
|
-
<a name='L27'></a><a href='#L27'>27</a>
|
93
|
-
<a name='L28'></a><a href='#L28'>28</a>
|
94
|
-
<a name='L29'></a><a href='#L29'>29</a>
|
95
|
-
<a name='L30'></a><a href='#L30'>30</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
89
|
+
<a name='L24'></a><a href='#L24'>24</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
96
90
|
<span class="cline-any cline-yes">1x</span>
|
97
91
|
<span class="cline-any cline-neutral"> </span>
|
98
92
|
<span class="cline-any cline-yes">1x</span>
|
99
93
|
<span class="cline-any cline-neutral"> </span>
|
100
|
-
<span class="cline-any cline-neutral"> </span>
|
101
|
-
<span class="cline-any cline-neutral"> </span>
|
102
94
|
<span class="cline-any cline-yes">1x</span>
|
103
95
|
<span class="cline-any cline-neutral"> </span>
|
104
96
|
<span class="cline-any cline-yes">1x</span>
|
105
97
|
<span class="cline-any cline-neutral"> </span>
|
106
98
|
<span class="cline-any cline-neutral"> </span>
|
107
99
|
<span class="cline-any cline-neutral"> </span>
|
108
|
-
<span class="cline-any cline-neutral"> </span>
|
109
100
|
<span class="cline-any cline-yes">1x</span>
|
110
101
|
<span class="cline-any cline-yes">2x</span>
|
111
102
|
<span class="cline-any cline-yes">2x</span>
|
@@ -117,37 +108,28 @@
|
|
117
108
|
<span class="cline-any cline-yes">2x</span>
|
118
109
|
<span class="cline-any cline-yes">2x</span>
|
119
110
|
<span class="cline-any cline-neutral"> </span>
|
120
|
-
<span class="cline-any cline-yes">2x</span>
|
121
|
-
<span class="cline-any cline-yes">2x</span>
|
122
|
-
<span class="cline-any cline-neutral"> </span>
|
123
111
|
<span class="cline-any cline-yes">1x</span>
|
124
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import {
|
112
|
+
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { EslintConfig } from '@saashub/qoq-eslint-v9-js';
|
125
113
|
import merge from 'lodash/merge.js';
|
126
114
|
|
127
115
|
import baseConfig from './baseConfig';
|
128
116
|
|
129
|
-
import type { Linter } from 'eslint';
|
130
|
-
|
131
117
|
const filesExtensions = ['js', 'ts'];
|
132
118
|
|
133
119
|
export const getEslintConfig: (
|
134
120
|
srcPath?: string,
|
135
121
|
files?: string[],
|
136
|
-
ignores?: string[]
|
137
|
-
|
138
|
-
) => Linter.Config[] = (
|
122
|
+
ignores?: string[]
|
123
|
+
) => EslintConfig[] = (
|
139
124
|
srcPath = 'src',
|
140
125
|
files = [`${srcPath}/**/*.spec.{${filesExtensions.join(',')}}`],
|
141
|
-
ignores = []
|
142
|
-
|
143
|
-
|
144
|
-
const eslintConfig = merge({}, baseConfig, {
|
126
|
+
ignores = []
|
127
|
+
) => [
|
128
|
+
merge({}, baseConfig, {
|
145
129
|
files,
|
146
130
|
ignores,
|
147
|
-
})
|
148
|
-
|
149
|
-
return <span class="branch-0 cbranch-no" title="branch not covered" >gitignorePath ? [includeIgnoreFile(gitignorePath), eslintConfig] : [</span>eslintConfig];
|
150
|
-
};
|
131
|
+
}),
|
132
|
+
];
|
151
133
|
|
152
134
|
export default getEslintConfig();
|
153
135
|
</pre></td></tr></table></pre>
|
@@ -157,7 +139,7 @@ export default getEslintConfig();
|
|
157
139
|
<div class='footer quiet pad2 space-top1 center small'>
|
158
140
|
Code coverage generated by
|
159
141
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
160
|
-
at 2024-09-
|
142
|
+
at 2024-09-08T11:48:50.208Z
|
161
143
|
</div>
|
162
144
|
<script src="prettify.js"></script>
|
163
145
|
<script>
|
package/coverage/index.html
CHANGED
@@ -25,14 +25,14 @@
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
26
26
|
<span class="strong">100% </span>
|
27
27
|
<span class="quiet">Statements</span>
|
28
|
-
<span class='fraction'>
|
28
|
+
<span class='fraction'>34/34</span>
|
29
29
|
</div>
|
30
30
|
|
31
31
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
33
|
-
<span class="strong">
|
33
|
+
<span class="strong">100% </span>
|
34
34
|
<span class="quiet">Branches</span>
|
35
|
-
<span class='fraction'>1/
|
35
|
+
<span class='fraction'>1/1</span>
|
36
36
|
</div>
|
37
37
|
|
38
38
|
|
@@ -46,7 +46,7 @@
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
47
47
|
<span class="strong">100% </span>
|
48
48
|
<span class="quiet">Lines</span>
|
49
|
-
<span class='fraction'>
|
49
|
+
<span class='fraction'>34/34</span>
|
50
50
|
</div>
|
51
51
|
|
52
52
|
|
@@ -84,13 +84,13 @@
|
|
84
84
|
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
85
85
|
</td>
|
86
86
|
<td data-value="100" class="pct high">100%</td>
|
87
|
-
<td data-value="
|
87
|
+
<td data-value="18" class="abs high">18/18</td>
|
88
88
|
<td data-value="100" class="pct high">100%</td>
|
89
89
|
<td data-value="0" class="abs high">0/0</td>
|
90
90
|
<td data-value="100" class="pct high">100%</td>
|
91
91
|
<td data-value="0" class="abs high">0/0</td>
|
92
92
|
<td data-value="100" class="pct high">100%</td>
|
93
|
-
<td data-value="
|
93
|
+
<td data-value="18" class="abs high">18/18</td>
|
94
94
|
</tr>
|
95
95
|
|
96
96
|
<tr>
|
@@ -99,13 +99,13 @@
|
|
99
99
|
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
100
100
|
</td>
|
101
101
|
<td data-value="100" class="pct high">100%</td>
|
102
|
-
<td data-value="
|
103
|
-
<td data-value="50" class="pct medium">50%</td>
|
104
|
-
<td data-value="2" class="abs medium">1/2</td>
|
102
|
+
<td data-value="16" class="abs high">16/16</td>
|
105
103
|
<td data-value="100" class="pct high">100%</td>
|
106
104
|
<td data-value="1" class="abs high">1/1</td>
|
107
105
|
<td data-value="100" class="pct high">100%</td>
|
108
|
-
<td data-value="
|
106
|
+
<td data-value="1" class="abs high">1/1</td>
|
107
|
+
<td data-value="100" class="pct high">100%</td>
|
108
|
+
<td data-value="16" class="abs high">16/16</td>
|
109
109
|
</tr>
|
110
110
|
|
111
111
|
</tbody>
|
@@ -116,7 +116,7 @@
|
|
116
116
|
<div class='footer quiet pad2 space-top1 center small'>
|
117
117
|
Code coverage generated by
|
118
118
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
119
|
-
at 2024-09-
|
119
|
+
at 2024-09-08T11:48:50.208Z
|
120
120
|
</div>
|
121
121
|
<script src="prettify.js"></script>
|
122
122
|
<script>
|
package/lib/baseConfig.cjs
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
3
|
var tools = require('@saashub/qoq-eslint-v9-js/tools');
|
4
|
-
var importPlugin = require('eslint-plugin-import');
|
5
4
|
var jsVitestBaseConfig = require('@saashub/qoq-eslint-v9-js-vitest/baseConfig');
|
6
5
|
var tsBaseConfig = require('@saashub/qoq-eslint-v9-ts/baseConfig');
|
6
|
+
var importPlugin = require('eslint-plugin-import');
|
7
7
|
var merge = require('lodash/merge.js');
|
8
8
|
|
9
9
|
function _interopNamespaceDefault(e) {
|
@@ -25,7 +25,9 @@ function _interopNamespaceDefault(e) {
|
|
25
25
|
|
26
26
|
var importPlugin__namespace = /*#__PURE__*/_interopNamespaceDefault(importPlugin);
|
27
27
|
|
28
|
-
const config = merge({},
|
28
|
+
const config = merge({},
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
|
30
|
+
tools.omitRules(jsVitestBaseConfig, Object.keys(importPlugin__namespace.configs.recommended.rules)), tsBaseConfig, {
|
29
31
|
name: '@saashub/qoq-eslint-v9-ts-vitest',
|
30
32
|
rules: {
|
31
33
|
'sonarjs/no-duplicate-string': 0,
|
package/lib/baseConfig.d.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
import
|
2
|
-
declare const config:
|
1
|
+
import { EslintConfig } from '@saashub/qoq-eslint-v9-js';
|
2
|
+
declare const config: EslintConfig;
|
3
3
|
export default config;
|
package/lib/baseConfig.mjs
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
import { omitRules } from '@saashub/qoq-eslint-v9-js/tools';
|
2
|
-
import * as importPlugin from 'eslint-plugin-import';
|
3
2
|
import jsVitestBaseConfig from '@saashub/qoq-eslint-v9-js-vitest/baseConfig';
|
4
3
|
import tsBaseConfig from '@saashub/qoq-eslint-v9-ts/baseConfig';
|
4
|
+
import * as importPlugin from 'eslint-plugin-import';
|
5
5
|
import merge from 'lodash/merge.js';
|
6
6
|
|
7
|
-
const config = merge({},
|
7
|
+
const config = merge({},
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
|
9
|
+
omitRules(jsVitestBaseConfig, Object.keys(importPlugin.configs.recommended.rules)), tsBaseConfig, {
|
8
10
|
name: '@saashub/qoq-eslint-v9-ts-vitest',
|
9
11
|
rules: {
|
10
12
|
'sonarjs/no-duplicate-string': 0,
|
package/lib/eslintConfig.cjs
CHANGED
@@ -2,22 +2,20 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
var compat = require('@eslint/compat');
|
6
5
|
var merge = require('lodash/merge.js');
|
7
6
|
var baseConfig = require('./baseConfig.cjs');
|
8
7
|
require('@saashub/qoq-eslint-v9-js/tools');
|
9
|
-
require('eslint-plugin-import');
|
10
8
|
require('@saashub/qoq-eslint-v9-js-vitest/baseConfig');
|
11
9
|
require('@saashub/qoq-eslint-v9-ts/baseConfig');
|
10
|
+
require('eslint-plugin-import');
|
12
11
|
|
13
12
|
const filesExtensions = ['js', 'ts'];
|
14
|
-
const getEslintConfig = (srcPath = 'src', files = [`${srcPath}/**/*.spec.{${filesExtensions.join(',')}}`], ignores = []
|
15
|
-
|
13
|
+
const getEslintConfig = (srcPath = 'src', files = [`${srcPath}/**/*.spec.{${filesExtensions.join(',')}}`], ignores = []) => [
|
14
|
+
merge({}, baseConfig, {
|
16
15
|
files,
|
17
16
|
ignores,
|
18
|
-
})
|
19
|
-
|
20
|
-
};
|
17
|
+
}),
|
18
|
+
];
|
21
19
|
var eslintConfig = getEslintConfig();
|
22
20
|
|
23
21
|
exports.default = eslintConfig;
|
package/lib/eslintConfig.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
2
|
-
export declare const getEslintConfig: (srcPath?: string, files?: string[], ignores?: string[]
|
3
|
-
declare const _default:
|
1
|
+
import { EslintConfig } from '@saashub/qoq-eslint-v9-js';
|
2
|
+
export declare const getEslintConfig: (srcPath?: string, files?: string[], ignores?: string[]) => EslintConfig[];
|
3
|
+
declare const _default: EslintConfig[];
|
4
4
|
export default _default;
|
package/lib/eslintConfig.mjs
CHANGED
@@ -1,19 +1,17 @@
|
|
1
|
-
import { includeIgnoreFile } from '@eslint/compat';
|
2
1
|
import merge from 'lodash/merge.js';
|
3
2
|
import config from './baseConfig.mjs';
|
4
3
|
import '@saashub/qoq-eslint-v9-js/tools';
|
5
|
-
import 'eslint-plugin-import';
|
6
4
|
import '@saashub/qoq-eslint-v9-js-vitest/baseConfig';
|
7
5
|
import '@saashub/qoq-eslint-v9-ts/baseConfig';
|
6
|
+
import 'eslint-plugin-import';
|
8
7
|
|
9
8
|
const filesExtensions = ['js', 'ts'];
|
10
|
-
const getEslintConfig = (srcPath = 'src', files = [`${srcPath}/**/*.spec.{${filesExtensions.join(',')}}`], ignores = []
|
11
|
-
|
9
|
+
const getEslintConfig = (srcPath = 'src', files = [`${srcPath}/**/*.spec.{${filesExtensions.join(',')}}`], ignores = []) => [
|
10
|
+
merge({}, config, {
|
12
11
|
files,
|
13
12
|
ignores,
|
14
|
-
})
|
15
|
-
|
16
|
-
};
|
13
|
+
}),
|
14
|
+
];
|
17
15
|
var eslintConfig = getEslintConfig();
|
18
16
|
|
19
17
|
export { eslintConfig as default, getEslintConfig };
|
package/lib/index.cjs
CHANGED
@@ -3,11 +3,10 @@
|
|
3
3
|
var baseConfig = require('./baseConfig.cjs');
|
4
4
|
var eslintConfig = require('./eslintConfig.cjs');
|
5
5
|
require('@saashub/qoq-eslint-v9-js/tools');
|
6
|
-
require('eslint-plugin-import');
|
7
6
|
require('@saashub/qoq-eslint-v9-js-vitest/baseConfig');
|
8
7
|
require('@saashub/qoq-eslint-v9-ts/baseConfig');
|
8
|
+
require('eslint-plugin-import');
|
9
9
|
require('lodash/merge.js');
|
10
|
-
require('@eslint/compat');
|
11
10
|
|
12
11
|
var index = { baseConfig, eslintConfig: eslintConfig.default };
|
13
12
|
|
package/lib/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
declare const _default: {
|
2
|
-
baseConfig: import("eslint").
|
3
|
-
eslintConfig: import("eslint").
|
2
|
+
baseConfig: import("@saashub/qoq-eslint-v9-js").EslintConfig;
|
3
|
+
eslintConfig: import("@saashub/qoq-eslint-v9-js").EslintConfig[];
|
4
4
|
};
|
5
5
|
export default _default;
|
package/lib/index.mjs
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
import config from './baseConfig.mjs';
|
2
2
|
import eslintConfig from './eslintConfig.mjs';
|
3
3
|
import '@saashub/qoq-eslint-v9-js/tools';
|
4
|
-
import 'eslint-plugin-import';
|
5
4
|
import '@saashub/qoq-eslint-v9-js-vitest/baseConfig';
|
6
5
|
import '@saashub/qoq-eslint-v9-ts/baseConfig';
|
6
|
+
import 'eslint-plugin-import';
|
7
7
|
import 'lodash/merge.js';
|
8
|
-
import '@eslint/compat';
|
9
8
|
|
10
9
|
var index = { baseConfig: config, eslintConfig };
|
11
10
|
|
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "@saashub/qoq-eslint-v9-ts-vitest",
|
3
3
|
"description": "Eslint flat config template for TS + Vitest",
|
4
4
|
"license": "MIT",
|
5
|
-
"version": "0.
|
5
|
+
"version": "0.8.1",
|
6
6
|
"main": "./lib/index.cjs",
|
7
7
|
"module": "./lib/index.mjs",
|
8
8
|
"types": "./lib/index.d.js",
|
@@ -35,15 +35,18 @@
|
|
35
35
|
"scripts": {
|
36
36
|
"build": "rimraf ./lib && rollup -c --silent",
|
37
37
|
"test": "vitest run --coverage",
|
38
|
+
"qoq:check": "qoq check",
|
39
|
+
"qoq:fix": "qoq fix",
|
38
40
|
"inspect": "npm run build && eslint -c ./lib/eslintConfig.cjs --inspect-config"
|
39
41
|
},
|
40
42
|
"dependencies": {
|
41
|
-
"@saashub/qoq-eslint-v9-js-vitest": "^0.
|
42
|
-
"@saashub/qoq-eslint-v9-ts": "^0.
|
43
|
+
"@saashub/qoq-eslint-v9-js-vitest": "^0.8.1",
|
44
|
+
"@saashub/qoq-eslint-v9-ts": "^0.8.1",
|
43
45
|
"lodash": "4.17.21"
|
44
46
|
},
|
45
47
|
"devDependencies": {
|
46
48
|
"@rollup/plugin-typescript": "11.1.6",
|
49
|
+
"@saashub/qoq-cli": "^0.8.1",
|
47
50
|
"@types/eslint": "^9",
|
48
51
|
"@types/lodash": "4.17.7",
|
49
52
|
"rimraf": "6.0.1",
|
@@ -67,5 +70,5 @@
|
|
67
70
|
"directory": "packages/eslint-v9-ts-vitest"
|
68
71
|
},
|
69
72
|
"homepage": "https://github.com/saashub-it/qoq/tree/master/packages/eslint-v9-ts-vitest",
|
70
|
-
"gitHead": "
|
73
|
+
"gitHead": "27c0f23073c2e02187409ba19a29dc621253932f"
|
71
74
|
}
|
package/qoq.config.js
ADDED
package/src/baseConfig.spec.ts
CHANGED
package/src/baseConfig.ts
CHANGED
@@ -1,14 +1,13 @@
|
|
1
|
+
import { EslintConfig } from '@saashub/qoq-eslint-v9-js';
|
1
2
|
import { omitRules } from '@saashub/qoq-eslint-v9-js/tools';
|
2
|
-
import * as importPlugin from 'eslint-plugin-import';
|
3
3
|
import jsVitestBaseConfig from '@saashub/qoq-eslint-v9-js-vitest/baseConfig';
|
4
4
|
import tsBaseConfig from '@saashub/qoq-eslint-v9-ts/baseConfig';
|
5
|
-
|
5
|
+
import * as importPlugin from 'eslint-plugin-import';
|
6
6
|
import merge from 'lodash/merge.js';
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
const config = merge(
|
8
|
+
const config: EslintConfig = merge(
|
11
9
|
{},
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
|
12
11
|
omitRules(jsVitestBaseConfig, Object.keys(importPlugin.configs.recommended.rules)),
|
13
12
|
tsBaseConfig,
|
14
13
|
{
|
@@ -17,6 +16,6 @@ const config = merge(
|
|
17
16
|
'sonarjs/no-duplicate-string': 0,
|
18
17
|
},
|
19
18
|
}
|
20
|
-
)
|
19
|
+
);
|
21
20
|
|
22
21
|
export default config;
|
package/src/eslintConfig.spec.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
import { describe, test, expect } from 'vitest';
|
2
1
|
import { execSync } from 'child_process';
|
2
|
+
|
3
3
|
import { ESLint } from 'eslint';
|
4
|
+
import { describe, test, expect } from 'vitest';
|
4
5
|
|
5
6
|
import { getEslintConfig } from './eslintConfig';
|
6
7
|
|
@@ -14,10 +15,11 @@ describe('baseConfig', () => {
|
|
14
15
|
).not.toThrowError();
|
15
16
|
});
|
16
17
|
|
17
|
-
test('can execute Eslint with compiled config',
|
18
|
+
test('can execute Eslint with compiled config', () => {
|
18
19
|
const projectPath = __dirname.replace('/src', '');
|
19
20
|
|
20
21
|
expect(() =>
|
22
|
+
// eslint-disable-next-line sonarjs/os-command
|
21
23
|
execSync(`eslint ${projectPath}/lib/index.cjs -c ${projectPath}/lib/eslintConfig.mjs`)
|
22
24
|
).not.toThrowError();
|
23
25
|
});
|
package/src/eslintConfig.ts
CHANGED
@@ -1,29 +1,23 @@
|
|
1
|
-
import {
|
1
|
+
import { EslintConfig } from '@saashub/qoq-eslint-v9-js';
|
2
2
|
import merge from 'lodash/merge.js';
|
3
3
|
|
4
4
|
import baseConfig from './baseConfig';
|
5
5
|
|
6
|
-
import type { Linter } from 'eslint';
|
7
|
-
|
8
6
|
const filesExtensions = ['js', 'ts'];
|
9
7
|
|
10
8
|
export const getEslintConfig: (
|
11
9
|
srcPath?: string,
|
12
10
|
files?: string[],
|
13
|
-
ignores?: string[]
|
14
|
-
|
15
|
-
) => Linter.Config[] = (
|
11
|
+
ignores?: string[]
|
12
|
+
) => EslintConfig[] = (
|
16
13
|
srcPath = 'src',
|
17
14
|
files = [`${srcPath}/**/*.spec.{${filesExtensions.join(',')}}`],
|
18
|
-
ignores = []
|
19
|
-
|
20
|
-
|
21
|
-
const eslintConfig = merge({}, baseConfig, {
|
15
|
+
ignores = []
|
16
|
+
) => [
|
17
|
+
merge({}, baseConfig, {
|
22
18
|
files,
|
23
19
|
ignores,
|
24
|
-
})
|
25
|
-
|
26
|
-
return gitignorePath ? [includeIgnoreFile(gitignorePath), eslintConfig] : [eslintConfig];
|
27
|
-
};
|
20
|
+
}),
|
21
|
+
];
|
28
22
|
|
29
23
|
export default getEslintConfig();
|