@cabify/eslint-config 3.0.1-beta-30 → 3.0.1-beta-31
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/dist/{conditionalPackages-bfybcqmF.js → conditionalPackages-D5FhOEVq.mjs} +2 -2
- package/dist/conditionalPackagesLegacy.js +41 -0
- package/dist/eslint.config.cjs +63 -63
- package/dist/eslint.config.js +3834 -3833
- package/package.json +3 -1
- package/dist/conditionalPackages-Dab7xdEt.js +0 -21
- package/dist/conditionalPackages-Dy0F7fZ_.js +0 -25
- package/dist/conditionalPackages-KW6ry4zo.js +0 -21
- package/dist/jest-CMIk9Y97.js +0 -10
- package/dist/jest-EcSTuD7h.js +0 -11
- /package/dist/{jest-TBYNSpnp.js → jest-TBYNSpnp.mjs} +0 -0
- /package/dist/{ts-CiBFLphe.js → ts-CiBFLphe.mjs} +0 -0
|
@@ -8,11 +8,11 @@ async function n(t) {
|
|
|
8
8
|
const l = async () => {
|
|
9
9
|
let t = !1, a = !1, e = [], s = {};
|
|
10
10
|
if (t = await n("typescript"), a = await n("jest"), t) {
|
|
11
|
-
const { tsLintConfig: i } = await import("./ts-CiBFLphe.
|
|
11
|
+
const { tsLintConfig: i } = await import("./ts-CiBFLphe.mjs");
|
|
12
12
|
e = i;
|
|
13
13
|
}
|
|
14
14
|
if (a) {
|
|
15
|
-
const { jestConf: i } = await import("./jest-TBYNSpnp.
|
|
15
|
+
const { jestConf: i } = await import("./jest-TBYNSpnp.mjs");
|
|
16
16
|
s = i;
|
|
17
17
|
}
|
|
18
18
|
return {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
/* eslint-disable import/extensions */
|
|
3
|
+
/* eslint-disable global-require */
|
|
4
|
+
function isPackageAvailable(packageName) {
|
|
5
|
+
try {
|
|
6
|
+
// Dynamically require the package
|
|
7
|
+
require.resolve(packageName);
|
|
8
|
+
return true;
|
|
9
|
+
} catch (_) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const getConditionalPackages = () => {
|
|
15
|
+
let isTSAvailable = false;
|
|
16
|
+
let isJestAvailable = false;
|
|
17
|
+
let tsConfigs = [];
|
|
18
|
+
let jestConfigs = {};
|
|
19
|
+
|
|
20
|
+
isTSAvailable = isPackageAvailable('typescript');
|
|
21
|
+
isJestAvailable = isPackageAvailable('jest');
|
|
22
|
+
|
|
23
|
+
if (isTSAvailable) {
|
|
24
|
+
const tsModule = require('./ts.js');
|
|
25
|
+
tsConfigs = tsModule.tsLintConfig;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (isJestAvailable) {
|
|
29
|
+
const jestModule = require('./jest.js');
|
|
30
|
+
jestConfigs = jestModule.jestConf;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
jestConfigs,
|
|
35
|
+
tsConfigs,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
module.exports = {
|
|
40
|
+
getConditionalPackages,
|
|
41
|
+
};
|