ts-reconf 0.4.6 → 0.4.8

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.
@@ -0,0 +1,109 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { isolatedDeclarationsCheckRule } from '../../rules/isolatedDeclarationsCheck.js';
3
+ describe('isolatedDeclarationsCheck', () => {
4
+ it('should return no findings when neither isolatedDeclarations nor isolatedModules is set', () => {
5
+ const config = {
6
+ compilerOptions: {},
7
+ rawConfig: {},
8
+ };
9
+ const findings = isolatedDeclarationsCheckRule.analyze(config);
10
+ expect(findings).toHaveLength(0);
11
+ });
12
+ it('should return no findings when both isolatedDeclarations and isolatedModules are set', () => {
13
+ const config = {
14
+ compilerOptions: {
15
+ isolatedDeclarations: true,
16
+ isolatedModules: true,
17
+ },
18
+ rawConfig: {},
19
+ };
20
+ const findings = isolatedDeclarationsCheckRule.analyze(config);
21
+ expect(findings).toHaveLength(0);
22
+ });
23
+ it('should warn when isolatedDeclarations is true but isolatedModules is false', () => {
24
+ const config = {
25
+ compilerOptions: {
26
+ isolatedDeclarations: true,
27
+ isolatedModules: false,
28
+ },
29
+ rawConfig: {},
30
+ };
31
+ const findings = isolatedDeclarationsCheckRule.analyze(config);
32
+ expect(findings).toHaveLength(1);
33
+ expect(findings[0]?.severity).toBe('warn');
34
+ expect(findings[0]?.category).toBe('suggestion');
35
+ });
36
+ it('should warn when isolatedDeclarations is true but isolatedModules is not set', () => {
37
+ const config = {
38
+ compilerOptions: {
39
+ isolatedDeclarations: true,
40
+ },
41
+ rawConfig: {},
42
+ };
43
+ const findings = isolatedDeclarationsCheckRule.analyze(config);
44
+ expect(findings).toHaveLength(1);
45
+ expect(findings[0]?.severity).toBe('warn');
46
+ });
47
+ it('should mention both options in the warning message', () => {
48
+ const config = {
49
+ compilerOptions: {
50
+ isolatedDeclarations: true,
51
+ },
52
+ rawConfig: {},
53
+ };
54
+ const findings = isolatedDeclarationsCheckRule.analyze(config);
55
+ expect(findings[0]?.message).toContain('isolatedDeclarations');
56
+ expect(findings[0]?.message).toContain('isolatedModules');
57
+ });
58
+ it('should explain the complementary nature of the options', () => {
59
+ const config = {
60
+ compilerOptions: {
61
+ isolatedDeclarations: true,
62
+ },
63
+ rawConfig: {},
64
+ };
65
+ const findings = isolatedDeclarationsCheckRule.analyze(config);
66
+ expect(findings[0]?.message).toContain('type safety');
67
+ expect(findings[0]?.message).toContain('transpilation safety');
68
+ });
69
+ it('should have correct rule id', () => {
70
+ const config = {
71
+ compilerOptions: {
72
+ isolatedDeclarations: true,
73
+ },
74
+ rawConfig: {},
75
+ };
76
+ const findings = isolatedDeclarationsCheckRule.analyze(config);
77
+ expect(findings[0]?.ruleId).toBe('ts.isolatedDeclarations.check');
78
+ });
79
+ it('should return no findings when isolatedModules is set but isolatedDeclarations is not', () => {
80
+ const config = {
81
+ compilerOptions: {
82
+ isolatedModules: true,
83
+ },
84
+ rawConfig: {},
85
+ };
86
+ const findings = isolatedDeclarationsCheckRule.analyze(config);
87
+ expect(findings).toHaveLength(0);
88
+ });
89
+ it('should handle undefined compilerOptions gracefully', () => {
90
+ const config = {
91
+ compilerOptions: undefined,
92
+ rawConfig: {},
93
+ };
94
+ const findings = isolatedDeclarationsCheckRule.analyze(config);
95
+ expect(findings).toHaveLength(0);
96
+ });
97
+ it('should return no findings when isolatedDeclarations is false', () => {
98
+ const config = {
99
+ compilerOptions: {
100
+ isolatedDeclarations: false,
101
+ isolatedModules: false,
102
+ },
103
+ rawConfig: {},
104
+ };
105
+ const findings = isolatedDeclarationsCheckRule.analyze(config);
106
+ expect(findings).toHaveLength(0);
107
+ });
108
+ });
109
+ //# sourceMappingURL=isolatedDeclarationsCheck.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isolatedDeclarationsCheck.test.js","sourceRoot":"","sources":["../../../src/__tests__/rules/isolatedDeclarationsCheck.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,E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,oBAAoB,EAAE,KAAK;gBAC3B,eAAe,EAAE,KAAK;aACvB;YACD,SAAS,EAAE,EAAE;SACd,CAAC;QAEF,MAAM,QAAQ,GAAG,6BAA6B,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAE/D,MAAM,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/dist/analyzer.js CHANGED
@@ -1,4 +1,4 @@
1
- import { legacyOptionRule, strictRedundantRule, skipLibCheckRule, defaultRedundantRule, targetLibConflictRule, moduleKindCheckRule, allowJsCheckRule, noEmitOutDirCheckRule, noIncludeOrFilesCheckRule, moduleResolutionMismatchRule, declarationNoEmitCheckRule, verbatimModuleIsolatedModulesRule, verbatimModuleSyntaxCheckRule, allowSyntheticDefaultImportsRule, noUncheckedIndexedAccessRule, forceConsistentCasingInFileNamesRule, moduleResolutionOutdatedRule, emitDeclarationOnlyRule, legacyJsxTransformCheckRule, declarationMapCheckRule, pathsWithoutBaseUrlRule, outDirRootDirConflictRule, noEmitConflictRule, } from "./rules/index.js";
1
+ import { legacyOptionRule, strictRedundantRule, skipLibCheckRule, defaultRedundantRule, targetLibConflictRule, moduleKindCheckRule, allowJsCheckRule, noEmitOutDirCheckRule, noIncludeOrFilesCheckRule, moduleResolutionMismatchRule, declarationNoEmitCheckRule, verbatimModuleIsolatedModulesRule, verbatimModuleSyntaxCheckRule, allowSyntheticDefaultImportsRule, noUncheckedIndexedAccessRule, forceConsistentCasingInFileNamesRule, moduleResolutionOutdatedRule, emitDeclarationOnlyRule, legacyJsxTransformCheckRule, declarationMapCheckRule, pathsWithoutBaseUrlRule, outDirRootDirConflictRule, noEmitConflictRule, incrementalWithNoEmitConflictRule, resolveJsonModuleCheckRule, sourcemapConflictRule, isolatedDeclarationsCheckRule, } from "./rules/index.js";
2
2
  const rules = [
3
3
  legacyOptionRule,
4
4
  strictRedundantRule,
@@ -23,6 +23,10 @@ const rules = [
23
23
  pathsWithoutBaseUrlRule,
24
24
  outDirRootDirConflictRule,
25
25
  noEmitConflictRule,
26
+ incrementalWithNoEmitConflictRule,
27
+ resolveJsonModuleCheckRule,
28
+ sourcemapConflictRule,
29
+ isolatedDeclarationsCheckRule,
26
30
  ];
27
31
  export function analyze(config) {
28
32
  return rules.flatMap(rule => rule.analyze(config));
@@ -1 +1 @@
1
- {"version":3,"file":"analyzer.js","sourceRoot":"","sources":["../src/analyzer.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,yBAAyB,EACzB,4BAA4B,EAC5B,0BAA0B,EAC1B,iCAAiC,EACjC,6BAA6B,EAC7B,gCAAgC,EAChC,4BAA4B,EAC5B,oCAAoC,EACpC,4BAA4B,EAC5B,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,GACrB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,KAAK,GAAW;IAClB,gBAAgB;IAChB,mBAAmB;IACnB,gBAAgB;IAChB,oBAAoB;IACpB,qBAAqB;IACrB,mBAAmB;IACnB,gBAAgB;IAChB,qBAAqB;IACrB,yBAAyB;IACzB,4BAA4B;IAC5B,0BAA0B;IAC1B,iCAAiC;IACjC,6BAA6B;IAC7B,gCAAgC;IAChC,4BAA4B;IAC5B,oCAAoC;IACpC,4BAA4B;IAC5B,uBAAuB;IACvB,2BAA2B;IAC3B,uBAAuB;IACvB,uBAAuB;IACvB,yBAAyB;IACzB,kBAAkB;CACrB,CAAC;AAEF,MAAM,UAAU,OAAO,CAAC,MAAuB;IAC3C,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AACvD,CAAC"}
1
+ {"version":3,"file":"analyzer.js","sourceRoot":"","sources":["../src/analyzer.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,yBAAyB,EACzB,4BAA4B,EAC5B,0BAA0B,EAC1B,iCAAiC,EACjC,6BAA6B,EAC7B,gCAAgC,EAChC,4BAA4B,EAC5B,oCAAoC,EACpC,4BAA4B,EAC5B,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,EAClB,iCAAiC,EACjC,0BAA0B,EAC1B,qBAAqB,EACrB,6BAA6B,GAChC,MAAM,kBAAkB,CAAC;AAE1B,MAAM,KAAK,GAAW;IAClB,gBAAgB;IAChB,mBAAmB;IACnB,gBAAgB;IAChB,oBAAoB;IACpB,qBAAqB;IACrB,mBAAmB;IACnB,gBAAgB;IAChB,qBAAqB;IACrB,yBAAyB;IACzB,4BAA4B;IAC5B,0BAA0B;IAC1B,iCAAiC;IACjC,6BAA6B;IAC7B,gCAAgC;IAChC,4BAA4B;IAC5B,oCAAoC;IACpC,4BAA4B;IAC5B,uBAAuB;IACvB,2BAA2B;IAC3B,uBAAuB;IACvB,uBAAuB;IACvB,yBAAyB;IACzB,kBAAkB;IAClB,iCAAiC;IACjC,0BAA0B;IAC1B,qBAAqB;IACrB,6BAA6B;CAChC,CAAC;AAEF,MAAM,UAAU,OAAO,CAAC,MAAuB;IAC3C,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AACvD,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { Rule } from "../types.js";
2
+ /**
3
+ * Checks for conflicting incremental and noEmit settings:
4
+ * - Warns if incremental is true but noEmit is also true (pointless cache)
5
+ * The incremental build cache (.tsbuildinfo) is only useful when files are emitted.
6
+ * With noEmit, the cache is wasted and should be disabled.
7
+ */
8
+ export declare const incrementalWithNoEmitConflictRule: Rule;
@@ -0,0 +1,25 @@
1
+ const ruleId = "ts.incremental.noemit.conflict";
2
+ /**
3
+ * Checks for conflicting incremental and noEmit settings:
4
+ * - Warns if incremental is true but noEmit is also true (pointless cache)
5
+ * The incremental build cache (.tsbuildinfo) is only useful when files are emitted.
6
+ * With noEmit, the cache is wasted and should be disabled.
7
+ */
8
+ export const incrementalWithNoEmitConflictRule = {
9
+ id: ruleId,
10
+ analyze(config) {
11
+ const options = config.compilerOptions ?? {};
12
+ const incremental = options.incremental;
13
+ const noEmit = options.noEmit;
14
+ if (!incremental || !noEmit) {
15
+ return [];
16
+ }
17
+ return [{
18
+ ruleId: ruleId,
19
+ severity: "warn",
20
+ message: `incremental is enabled but noEmit is true. The incremental build cache (.tsbuildinfo) is only useful when files are emitted. With noEmit, the incremental cache provides no benefit and wastes disk space. Either disable incremental or disable noEmit if you want faster rebuilds.`,
21
+ category: "conflict"
22
+ }];
23
+ }
24
+ };
25
+ //# sourceMappingURL=incrementalWithNoEmitConflict.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"incrementalWithNoEmitConflict.js","sourceRoot":"","sources":["../../src/rules/incrementalWithNoEmitConflict.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,gCAAgC,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAS;IACnD,EAAE,EAAE,MAAM;IAEV,OAAO,CAAC,MAAuB;QAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,eAAe,IAAI,EAAE,CAAC;QAC7C,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACxC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAE9B,IAAI,CAAC,WAAW,IAAI,CAAC,MAAM,EAAE,CAAC;YAC1B,OAAO,EAAE,CAAC;QACd,CAAC;QAED,OAAO,CAAC;gBACJ,MAAM,EAAE,MAAM;gBACd,QAAQ,EAAE,MAAM;gBAChB,OAAO,EAAE,sRAAsR;gBAC/R,QAAQ,EAAE,UAAU;aACvB,CAAC,CAAC;IACP,CAAC;CACJ,CAAC"}
@@ -21,3 +21,7 @@ export { declarationMapCheckRule } from "./declarationMapCheck.js";
21
21
  export { pathsWithoutBaseUrlRule } from "./pathsWithoutBaseUrl.js";
22
22
  export { noEmitConflictRule } from "./noEmitConflict.js";
23
23
  export { outDirRootDirConflictRule } from "./outDirRootDirConflict.js";
24
+ export { incrementalWithNoEmitConflictRule } from "./incrementalWithNoEmitConflict.js";
25
+ export { resolveJsonModuleCheckRule } from "./resolveJsonModuleCheck.js";
26
+ export { sourcemapConflictRule } from "./sourcemapConflictRule.js";
27
+ export { isolatedDeclarationsCheckRule } from "./isolatedDeclarationsCheck.js";
@@ -21,4 +21,8 @@ export { declarationMapCheckRule } from "./declarationMapCheck.js";
21
21
  export { pathsWithoutBaseUrlRule } from "./pathsWithoutBaseUrl.js";
22
22
  export { noEmitConflictRule } from "./noEmitConflict.js";
23
23
  export { outDirRootDirConflictRule } from "./outDirRootDirConflict.js";
24
+ export { incrementalWithNoEmitConflictRule } from "./incrementalWithNoEmitConflict.js";
25
+ export { resolveJsonModuleCheckRule } from "./resolveJsonModuleCheck.js";
26
+ export { sourcemapConflictRule } from "./sourcemapConflictRule.js";
27
+ export { isolatedDeclarationsCheckRule } from "./isolatedDeclarationsCheck.js";
24
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uB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MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { Rule } from "../types.js";
2
+ /**
3
+ * Checks for incomplete isolated declarations configuration:
4
+ * - Warns if isolatedDeclarations is enabled without isolatedModules
5
+ * - Explains the complementary nature of these options
6
+ *
7
+ * isolatedDeclarations: Ensures each .ts file can be type-checked independently
8
+ * isolatedModules: Ensures each file can be safely transpiled independently
9
+ *
10
+ * These options serve different purposes but are complementary:
11
+ * - isolatedDeclarations catches type safety issues (explicit annotations)
12
+ * - isolatedModules prevents transpilation errors (runtime safety)
13
+ *
14
+ * Both should be enabled together for maximum safety.
15
+ */
16
+ export declare const isolatedDeclarationsCheckRule: Rule;
@@ -0,0 +1,35 @@
1
+ const ruleId = "ts.isolatedDeclarations.check";
2
+ /**
3
+ * Checks for incomplete isolated declarations configuration:
4
+ * - Warns if isolatedDeclarations is enabled without isolatedModules
5
+ * - Explains the complementary nature of these options
6
+ *
7
+ * isolatedDeclarations: Ensures each .ts file can be type-checked independently
8
+ * isolatedModules: Ensures each file can be safely transpiled independently
9
+ *
10
+ * These options serve different purposes but are complementary:
11
+ * - isolatedDeclarations catches type safety issues (explicit annotations)
12
+ * - isolatedModules prevents transpilation errors (runtime safety)
13
+ *
14
+ * Both should be enabled together for maximum safety.
15
+ */
16
+ export const isolatedDeclarationsCheckRule = {
17
+ id: ruleId,
18
+ analyze(config) {
19
+ const options = config.compilerOptions ?? {};
20
+ const isolatedDeclarations = options.isolatedDeclarations;
21
+ const isolatedModules = options.isolatedModules;
22
+ const findings = [];
23
+ // Check if isolatedDeclarations is enabled without isolatedModules
24
+ if (isolatedDeclarations && !isolatedModules) {
25
+ findings.push({
26
+ ruleId: ruleId,
27
+ severity: "warn",
28
+ message: `"isolatedDeclarations" is enabled but "isolatedModules" is not. These options are complementary and should be used together: "isolatedDeclarations" ensures each file's declarations are explicit (type safety), while "isolatedModules" ensures each file can be transpiled independently (transpilation safety). Consider enabling both for maximum safety.`,
29
+ category: "suggestion"
30
+ });
31
+ }
32
+ return findings;
33
+ }
34
+ };
35
+ //# sourceMappingURL=isolatedDeclarationsCheck.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isolatedDeclarationsCheck.js","sourceRoot":"","sources":["../../src/rules/isolatedDeclarationsCheck.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,+BAA+B,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAS;IAC/C,EAAE,EAAE,MAAM;IAEV,OAAO,CAAC,MAAuB;QAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,eAAe,IAAI,EAAE,CAAC;QAC7C,MAAM,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC;QAC1D,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAEhD,MAAM,QAAQ,GAAc,EAAE,CAAC;QAE/B,mEAAmE;QACnE,IAAI,oBAAoB,IAAI,CAAC,eAAe,EAAE,CAAC;YAC3C,QAAQ,CAAC,IAAI,CAAC;gBACV,MAAM,EAAE,MAAM;gBACd,QAAQ,EAAE,MAAM;gBAChB,OAAO,EAAE,+VAA+V;gBACxW,QAAQ,EAAE,YAAY;aACzB,CAAC,CAAC;QACP,CAAC;QAED,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { Rule } from "../types.js";
2
+ /**
3
+ * Checks for resolveJsonModule configuration:
4
+ * - Suggests enabling it when using ESM/Node module resolution with modern TypeScript
5
+ * - Warns if enabled without proper module resolution setup (outdated moduleResolution)
6
+ * - Explains the purpose and implications of this option
7
+ */
8
+ export declare const resolveJsonModuleCheckRule: Rule;
@@ -0,0 +1,39 @@
1
+ import { ModuleResolutionKind } from "typescript";
2
+ const ruleId = "ts.resolveJsonModule.check";
3
+ /**
4
+ * Checks for resolveJsonModule configuration:
5
+ * - Suggests enabling it when using ESM/Node module resolution with modern TypeScript
6
+ * - Warns if enabled without proper module resolution setup (outdated moduleResolution)
7
+ * - Explains the purpose and implications of this option
8
+ */
9
+ export const resolveJsonModuleCheckRule = {
10
+ id: ruleId,
11
+ analyze(config) {
12
+ const options = config.compilerOptions ?? {};
13
+ const resolveJsonModule = options.resolveJsonModule;
14
+ const moduleResolution = options.moduleResolution;
15
+ const esModuleInterop = options.esModuleInterop;
16
+ const allowJs = options.allowJs;
17
+ const findings = [];
18
+ // Suggest enabling resolveJsonModule with modern module resolution
19
+ if (!resolveJsonModule && moduleResolution && moduleResolution !== ModuleResolutionKind.Classic) {
20
+ findings.push({
21
+ ruleId: ruleId,
22
+ severity: "info",
23
+ message: `Consider enabling "resolveJsonModule": true. Modern projects using ${moduleResolution} module resolution typically benefit from being able to import JSON files directly (e.g., package.json, config files). This improves type safety and reduces dynamic require() calls.`,
24
+ category: "suggestion"
25
+ });
26
+ }
27
+ // Warn if resolveJsonModule is enabled with classic/outdated resolution
28
+ if (resolveJsonModule && moduleResolution === ModuleResolutionKind.Classic) {
29
+ findings.push({
30
+ ruleId: ruleId,
31
+ severity: "warn",
32
+ message: `"resolveJsonModule" is enabled but "moduleResolution" is set to "classic", which is outdated. Modern module resolution (like "node", "bundler", or "nodenext") is recommended for JSON imports to work reliably.`,
33
+ category: "conflict"
34
+ });
35
+ }
36
+ return findings;
37
+ }
38
+ };
39
+ //# sourceMappingURL=resolveJsonModuleCheck.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveJsonModuleCheck.js","sourceRoot":"","sources":["../../src/rules/resolveJsonModuleCheck.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAIlD,MAAM,MAAM,GAAG,4BAA4B,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAS;IAC5C,EAAE,EAAE,MAAM;IAEV,OAAO,CAAC,MAAuB;QAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,eAAe,IAAI,EAAE,CAAC;QAC7C,MAAM,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;QACpD,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAClD,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAChD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAEhC,MAAM,QAAQ,GAAc,EAAE,CAAC;QAE/B,mEAAmE;QACnE,IAAI,CAAC,iBAAiB,IAAI,gBAAgB,IAAI,gBAAgB,KAAK,oBAAoB,CAAC,OAAO,EAAE,CAAC;YAC9F,QAAQ,CAAC,IAAI,CAAC;gBACV,MAAM,EAAE,MAAM;gBACd,QAAQ,EAAE,MAAM;gBAChB,OAAO,EAAE,sEAAsE,gBAAgB,uLAAuL;gBACtR,QAAQ,EAAE,YAAY;aACzB,CAAC,CAAC;QACP,CAAC;QAED,wEAAwE;QACxE,IAAI,iBAAiB,IAAI,gBAAgB,KAAK,oBAAoB,CAAC,OAAO,EAAE,CAAC;YACzE,QAAQ,CAAC,IAAI,CAAC;gBACV,MAAM,EAAE,MAAM;gBACd,QAAQ,EAAE,MAAM;gBAChB,OAAO,EAAE,kNAAkN;gBAC3N,QAAQ,EAAE,UAAU;aACvB,CAAC,CAAC;QACP,CAAC;QAED,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Rule } from "../types.js";
2
+ export declare const sourcemapConflictRule: Rule;
@@ -0,0 +1,42 @@
1
+ const ruleId = "ts.sourcemap.conflict";
2
+ export const sourcemapConflictRule = {
3
+ id: ruleId,
4
+ analyze(config) {
5
+ const options = config.compilerOptions ?? {};
6
+ const sourceMap = options.sourceMap;
7
+ const inlineSourceMap = options.inlineSourceMap;
8
+ const inlineSources = options.inlineSources;
9
+ const declaration = options.declaration;
10
+ const declarationMap = options.declarationMap;
11
+ const findings = [];
12
+ // inlineSourceMap and sourceMap are mutually exclusive in effect
13
+ if (inlineSourceMap && sourceMap) {
14
+ findings.push({
15
+ ruleId: ruleId,
16
+ severity: "error",
17
+ message: `Both "inlineSourceMap" and "sourceMap" are enabled. These options are mutually exclusive: inlineSourceMap embeds the map into the generated .js file, while sourceMap emits a separate .map file. Disable one of them.`,
18
+ category: "conflict"
19
+ });
20
+ }
21
+ // inlineSources only makes sense when a source map is generated
22
+ if (inlineSources && !inlineSourceMap && !sourceMap) {
23
+ findings.push({
24
+ ruleId: ruleId,
25
+ severity: "info",
26
+ message: `"inlineSources" is enabled but neither "sourceMap" nor "inlineSourceMap" are enabled. "inlineSources" only has an effect when source maps are generated. Consider enabling a source map option or disabling inlineSources.`,
27
+ category: "explanation"
28
+ });
29
+ }
30
+ // If declarationMap is enabled alongside inlineSourceMap, warn: declaration maps are separate files
31
+ if (declarationMap && inlineSourceMap) {
32
+ findings.push({
33
+ ruleId: ruleId,
34
+ severity: "warn",
35
+ message: `"declarationMap" is enabled together with "inlineSourceMap". declarationMap emits separate .d.ts.map files while inlineSourceMap embeds JS source maps. This combination may be unexpected—verify whether you intended both.`,
36
+ category: "conflict"
37
+ });
38
+ }
39
+ return findings;
40
+ }
41
+ };
42
+ //# sourceMappingURL=sourcemapConflictRule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sourcemapConflictRule.js","sourceRoot":"","sources":["../../src/rules/sourcemapConflictRule.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,uBAAuB,CAAC;AAEvC,MAAM,CAAC,MAAM,qBAAqB,GAAS;IACvC,EAAE,EAAE,MAAM;IAEV,OAAO,CAAC,MAAuB;QAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,eAAe,IAAI,EAAE,CAAC;QAC7C,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACpC,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAChD,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC5C,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACxC,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;QAE9C,MAAM,QAAQ,GAAc,EAAE,CAAC;QAE/B,iEAAiE;QACjE,IAAI,eAAe,IAAI,SAAS,EAAE,CAAC;YAC/B,QAAQ,CAAC,IAAI,CAAC;gBACV,MAAM,EAAE,MAAM;gBACd,QAAQ,EAAE,OAAO;gBACjB,OAAO,EAAE,wNAAwN;gBACjO,QAAQ,EAAE,UAAU;aACvB,CAAC,CAAC;QACP,CAAC;QAED,gEAAgE;QAChE,IAAI,aAAa,IAAI,CAAC,eAAe,IAAI,CAAC,SAAS,EAAE,CAAC;YAClD,QAAQ,CAAC,IAAI,CAAC;gBACV,MAAM,EAAE,MAAM;gBACd,QAAQ,EAAE,MAAM;gBAChB,OAAO,EAAE,4NAA4N;gBACrO,QAAQ,EAAE,aAAa;aAC1B,CAAC,CAAC;QACP,CAAC;QAED,oGAAoG;QACpG,IAAI,cAAc,IAAI,eAAe,EAAE,CAAC;YACpC,QAAQ,CAAC,IAAI,CAAC;gBACV,MAAM,EAAE,MAAM;gBACd,QAAQ,EAAE,MAAM;gBAChB,OAAO,EAAE,8NAA8N;gBACvO,QAAQ,EAAE,UAAU;aACvB,CAAC,CAAC;QACP,CAAC;QAED,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-reconf",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
4
4
  "description": "Understand and simplify (re-conf) your tsconfig.json",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -41,9 +41,9 @@
41
41
  "typescript": "6.0.3"
42
42
  },
43
43
  "devDependencies": {
44
- "@types/node": "26.1.1",
45
- "@vitest/coverage-v8": "4.1.10",
46
- "tsx": "4.23.1",
47
- "vitest": "4.1.10"
44
+ "@types/node": "26.5.1",
45
+ "@vitest/coverage-v8": "5.0.1",
46
+ "tsx": "4.23.13",
47
+ "vitest": "5.0.1"
48
48
  }
49
49
  }