@cabify/eslint-config 3.0.1-beta-12 → 3.0.1-beta-14
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/configs/base.js +3 -31
- package/configs/imports.js +3 -2
- package/configs/ts.js +1 -0
- package/package.json +2 -2
package/configs/base.js
CHANGED
|
@@ -19,45 +19,19 @@ import strict from './strict.js';
|
|
|
19
19
|
import style from './style.js';
|
|
20
20
|
import variables from './variables.js';
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
try {
|
|
24
|
-
// Dynamically import the package
|
|
25
|
-
await import('typescript');
|
|
26
|
-
console.log(`Package typescript is available`);
|
|
27
|
-
return true;
|
|
28
|
-
} catch (error) {
|
|
29
|
-
console.log(error);
|
|
30
|
-
console.log(`Package typescript is not available`);
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async function checkJestTSAvailable() {
|
|
36
|
-
try {
|
|
37
|
-
// Dynamically import the package
|
|
38
|
-
await import('jest');
|
|
39
|
-
console.log(`Package jest is available`);
|
|
40
|
-
return true;
|
|
41
|
-
} catch (error) {
|
|
42
|
-
console.log(error);
|
|
43
|
-
console.log(`Package jest is not available`);
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const isTSAvailable = await checkIsTSAvailable();
|
|
22
|
+
const isTSAvailable = await isPackageAvailable('typescript');
|
|
49
23
|
let tsConfigs = [];
|
|
50
24
|
if (isTSAvailable) {
|
|
51
25
|
const { tsLintConfig } = await import('./ts.js');
|
|
52
26
|
tsConfigs = tsLintConfig;
|
|
53
27
|
}
|
|
54
|
-
const isJestAvailable = await
|
|
28
|
+
const isJestAvailable = await isPackageAvailable('jest');
|
|
55
29
|
|
|
56
30
|
const configs = [
|
|
57
31
|
bestPractices,
|
|
58
32
|
errors,
|
|
59
33
|
es6,
|
|
60
|
-
imports,
|
|
34
|
+
...imports,
|
|
61
35
|
node,
|
|
62
36
|
promises,
|
|
63
37
|
strict,
|
|
@@ -81,8 +55,6 @@ const overrides = [
|
|
|
81
55
|
},
|
|
82
56
|
].filter(Boolean);
|
|
83
57
|
|
|
84
|
-
console.log({ tsConfigs });
|
|
85
|
-
|
|
86
58
|
export default [
|
|
87
59
|
...configs,
|
|
88
60
|
{
|
package/configs/imports.js
CHANGED
|
@@ -2,7 +2,7 @@ import importPlugin from 'eslint-plugin-import';
|
|
|
2
2
|
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
3
3
|
import globals from 'globals';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const configs = {
|
|
6
6
|
name: 'imports-cabify-eslint-config',
|
|
7
7
|
languageOptions: {
|
|
8
8
|
globals: {
|
|
@@ -10,7 +10,6 @@ export default {
|
|
|
10
10
|
},
|
|
11
11
|
},
|
|
12
12
|
plugins: {
|
|
13
|
-
import: importPlugin,
|
|
14
13
|
'simple-import-sort': simpleImportSort,
|
|
15
14
|
},
|
|
16
15
|
settings: {
|
|
@@ -275,3 +274,5 @@ export default {
|
|
|
275
274
|
'import/no-relative-parent-imports': 'off',
|
|
276
275
|
},
|
|
277
276
|
};
|
|
277
|
+
|
|
278
|
+
export default [importPlugin.flatConfigs.recommended, configs];
|
package/configs/ts.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cabify/eslint-config",
|
|
3
|
-
"version": "3.0.1-beta-
|
|
3
|
+
"version": "3.0.1-beta-14",
|
|
4
4
|
"description": "ESLint config for Cabify Javascript projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@typescript-eslint/parser": "^8.4.0",
|
|
43
43
|
"confusing-browser-globals": "^1.0.10",
|
|
44
44
|
"eslint-config-prettier": "^9.1.0",
|
|
45
|
-
"eslint-plugin-import": "^2.
|
|
45
|
+
"eslint-plugin-import": "^2.31.0",
|
|
46
46
|
"eslint-plugin-jest": "^28.8.3",
|
|
47
47
|
"eslint-plugin-jsx-a11y": "^6.10.0",
|
|
48
48
|
"eslint-plugin-lodash": "^7.4.0",
|