@itstandu/code-style 1.2.2 → 1.2.3

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/eslint/base.js CHANGED
@@ -26,9 +26,6 @@ module.exports = {
26
26
  node: {
27
27
  extensions: ['.js', '.jsx', '.ts', '.tsx', '.mjs', '.cjs'],
28
28
  },
29
- typescript: {
30
- alwaysTryTypes: true,
31
- },
32
29
  },
33
30
  },
34
31
  rules: {
@@ -40,7 +40,7 @@ module.exports = {
40
40
 
41
41
  // Import hygiene
42
42
  'import/no-unresolved': 'off',
43
- 'import/no-cycle': 'warn',
43
+ 'import/no-cycle': 'off', // Requires TypeScript resolver - enable in TypeScript config
44
44
  'import/no-self-import': 'error',
45
45
  'import/no-useless-path-segments': 'error',
46
46
  'import/no-mutable-exports': 'error',
@@ -1,5 +1,26 @@
1
1
  const base = require('./base');
2
2
 
3
+ // Try to load TypeScript resolver, but don't fail if not available
4
+ let typescriptResolver = null;
5
+ try {
6
+ require.resolve('eslint-import-resolver-typescript');
7
+ typescriptResolver = {
8
+ typescript: {
9
+ alwaysTryTypes: true,
10
+ },
11
+ };
12
+ } catch (e) {
13
+ // Resolver not available, skip
14
+ }
15
+
16
+ const settings = {
17
+ ...base.settings,
18
+ 'import/resolver': {
19
+ ...base.settings['import/resolver'],
20
+ ...typescriptResolver,
21
+ },
22
+ };
23
+
3
24
  module.exports = {
4
25
  ...base,
5
26
  files: ['**/*.ts', '**/*.tsx'],
@@ -17,6 +38,7 @@ module.exports = {
17
38
  ...base.plugins,
18
39
  '@typescript-eslint': require('@typescript-eslint/eslint-plugin'),
19
40
  },
41
+ settings,
20
42
  rules: {
21
43
  ...base.rules,
22
44
 
@@ -76,5 +98,8 @@ module.exports = {
76
98
  '@typescript-eslint/no-redundant-type-constituents': 'warn',
77
99
  '@typescript-eslint/no-unsafe-declaration-merging': 'error',
78
100
  '@typescript-eslint/no-useless-empty-export': 'warn',
101
+
102
+ // Import hygiene (only enable if TypeScript resolver is available)
103
+ 'import/no-cycle': typescriptResolver ? 'warn' : 'off',
79
104
  },
80
105
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itstandu/code-style",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "Production-ready shared ESLint + Prettier configuration for JavaScript and TypeScript projects",
5
5
  "type": "commonjs",
6
6
  "main": "./index.js",