@wkovacs64/eslint-config 7.2.2 → 7.2.4
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/index.js +14 -11
- package/package.json +1 -1
package/index.js
CHANGED
@@ -13,18 +13,21 @@ const ERROR = 'error';
|
|
13
13
|
const WARN = 'warn';
|
14
14
|
const OFF = 'off';
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
()
|
19
|
-
|
20
|
-
|
16
|
+
function has(pkgName) {
|
17
|
+
try {
|
18
|
+
import.meta.resolve(pkgName, import.meta.url);
|
19
|
+
return true;
|
20
|
+
} catch {
|
21
|
+
return false;
|
22
|
+
}
|
23
|
+
}
|
21
24
|
|
22
|
-
const hasTypeScript =
|
23
|
-
const hasReact =
|
24
|
-
const hasTestingLibrary =
|
25
|
-
const hasJestDom =
|
26
|
-
const hasVitest =
|
27
|
-
const hasPlaywright =
|
25
|
+
const hasTypeScript = has('typescript');
|
26
|
+
const hasReact = has('react');
|
27
|
+
const hasTestingLibrary = has('@testing-library/dom');
|
28
|
+
const hasJestDom = has('@testing-library/jest-dom');
|
29
|
+
const hasVitest = has('vitest');
|
30
|
+
const hasPlaywright = has('@playwright/test');
|
28
31
|
|
29
32
|
const vitestFiles = ['**/__tests__/**/*', '**/*.test.*'];
|
30
33
|
const testFiles = ['**/tests/**', '**/#tests/**', ...vitestFiles];
|