ts-reconf 0.3.0 → 0.4.0

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/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, } 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, } from "./rules/index.js";
2
2
  const rules = [
3
3
  legacyOptionRule,
4
4
  strictRedundantRule,
@@ -15,7 +15,10 @@ const rules = [
15
15
  verbatimModuleSyntaxCheckRule,
16
16
  allowSyntheticDefaultImportsRule,
17
17
  noUncheckedIndexedAccessRule,
18
- forceConsistentCasingInFileNamesRule
18
+ forceConsistentCasingInFileNamesRule,
19
+ moduleResolutionOutdatedRule,
20
+ emitDeclarationOnlyRule,
21
+ legacyJsxTransformCheckRule,
19
22
  ];
20
23
  export function analyze(config) {
21
24
  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,gBA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AC1B,iCAAiC;IACjC,6BAA6B;IAC7B,gCAAgC;IAChC,4BAA4B;IAC5B,oCAAoC;IACpC,4BAA4B;IAC5B,uBAAuB;IACvB,2BAA2B;CAC9B,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,2 @@
1
+ import type { Rule } from "../types.js";
2
+ export declare const emitDeclarationOnlyRule: Rule;
@@ -0,0 +1,19 @@
1
+ const ruleId = "ts.emitDeclarationOnly.noDeclaration";
2
+ export const emitDeclarationOnlyRule = {
3
+ id: ruleId,
4
+ analyze(config) {
5
+ const options = config.compilerOptions ?? {};
6
+ const emitDeclarationOnly = options.emitDeclarationOnly;
7
+ const findings = [];
8
+ if (emitDeclarationOnly && !options.declaration && !options.composite) {
9
+ findings.push({
10
+ ruleId: ruleId,
11
+ category: "conflict",
12
+ severity: "warn",
13
+ message: `"emitDeclarationOnly" is enabled but "declaration" (or "composite") is not. TypeScript requires declaration generation to be enabled for emitDeclarationOnly to work. Either enable "declaration": true or remove "emitDeclarationOnly".`
14
+ });
15
+ }
16
+ return findings;
17
+ }
18
+ };
19
+ //# sourceMappingURL=emitDeclarationOnly.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emitDeclarationOnly.js","sourceRoot":"","sources":["../../src/rules/emitDeclarationOnly.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,sCAAsC,CAAC;AAEtD,MAAM,CAAC,MAAM,uBAAuB,GAAS;IACzC,EAAE,EAAE,MAAM;IAEV,OAAO,CAAC,MAAuB;QAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,eAAe,IAAI,EAAE,CAAC;QAC7C,MAAM,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC;QACxD,MAAM,QAAQ,GAAc,EAAE,CAAC;QAE/B,IAAI,mBAAmB,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;YACpE,QAAQ,CAAC,IAAI,CAAC;gBACV,MAAM,EAAE,MAAM;gBACd,QAAQ,EAAE,UAAU;gBACpB,QAAQ,EAAE,MAAM;gBAChB,OAAO,EAAE,0OAA0O;aACtP,CAAC,CAAC;QACP,CAAC;QAED,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ,CAAC"}
@@ -14,3 +14,6 @@ export { verbatimModuleSyntaxCheckRule } from "./moduleVerbatimModuleSyntaxCheck
14
14
  export { allowSyntheticDefaultImportsRule } from "./allowSyntheticDefaultImportsCheck.js";
15
15
  export { noUncheckedIndexedAccessRule } from "./noUncheckedIndexedAccessCheck.js";
16
16
  export { forceConsistentCasingInFileNamesRule } from "./forceConsistentCasing.js";
17
+ export { moduleResolutionOutdatedRule } from "./moduleResolutionOutdated.js";
18
+ export { emitDeclarationOnlyRule } from "./emitDeclarationOnly.js";
19
+ export { legacyJsxTransformCheckRule } from "./legacyJsxTransformCheck.js";
@@ -14,4 +14,7 @@ export { verbatimModuleSyntaxCheckRule } from "./moduleVerbatimModuleSyntaxCheck
14
14
  export { allowSyntheticDefaultImportsRule } from "./allowSyntheticDefaultImportsCheck.js";
15
15
  export { noUncheckedIndexedAccessRule } from "./noUncheckedIndexedAccessCheck.js";
16
16
  export { forceConsistentCasingInFileNamesRule } from "./forceConsistentCasing.js";
17
+ export { moduleResolutionOutdatedRule } from "./moduleResolutionOutdated.js";
18
+ export { emitDeclarationOnlyRule } from "./emitDeclarationOnly.js";
19
+ export { legacyJsxTransformCheckRule } from "./legacyJsxTransformCheck.js";
17
20
  //# 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,mB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D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,iCAAiC,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AACrF,OAAO,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAC;AAC1F,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,oCAAoC,EAAE,MAAM,4BAA4B,CAAC;AAClF,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { Rule } from "../types.js";
2
+ export declare const legacyJsxTransformCheckRule: Rule;
@@ -0,0 +1,19 @@
1
+ import { JsxEmit } from "typescript";
2
+ const ruleId = "ts.jsx.legacyTransform";
3
+ export const legacyJsxTransformCheckRule = {
4
+ id: ruleId,
5
+ analyze(config) {
6
+ const options = config.compilerOptions ?? {};
7
+ const findings = [];
8
+ if (options.jsx === JsxEmit.React) {
9
+ findings.push({
10
+ ruleId: ruleId,
11
+ category: "suggestion",
12
+ severity: "info",
13
+ message: `"jsx" is set to "react" (legacy transform), which requires \`import React from 'react'\` in every JSX file. Consider switching to "react-jsx" (available since TS 4.1 / React 17). Set "jsx": "react-jsx" for production and "react-jsxdev" for development.`
14
+ });
15
+ }
16
+ return findings;
17
+ }
18
+ };
19
+ //# sourceMappingURL=legacyJsxTransformCheck.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacyJsxTransformCheck.js","sourceRoot":"","sources":["../../src/rules/legacyJsxTransformCheck.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC,MAAM,MAAM,GAAG,wBAAwB,CAAC;AAExC,MAAM,CAAC,MAAM,2BAA2B,GAAS;IAC7C,EAAE,EAAE,MAAM;IAEV,OAAO,CAAC,MAAuB;QAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,eAAe,IAAI,EAAE,CAAC;QAC7C,MAAM,QAAQ,GAAc,EAAE,CAAC;QAE/B,IAAI,OAAO,CAAC,GAAG,KAAK,OAAO,CAAC,KAAK,EAAE,CAAC;YAChC,QAAQ,CAAC,IAAI,CAAC;gBACV,MAAM,EAAE,MAAM;gBACd,QAAQ,EAAE,YAAY;gBACtB,QAAQ,EAAE,MAAM;gBAChB,OAAO,EAAE,8PAA8P;aAC1Q,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 moduleResolutionOutdatedRule: Rule;
@@ -0,0 +1,20 @@
1
+ import { ModuleResolutionKind } from "typescript";
2
+ const ruleId = "ts.moduleResolution.outdated";
3
+ export const moduleResolutionOutdatedRule = {
4
+ id: ruleId,
5
+ analyze(config) {
6
+ const options = config.compilerOptions ?? {};
7
+ const moduleResolution = options.moduleResolution;
8
+ const findings = [];
9
+ if (moduleResolution === ModuleResolutionKind.Node10) {
10
+ findings.push({
11
+ ruleId: ruleId,
12
+ category: "legacy",
13
+ severity: "warn",
14
+ message: `"moduleResolution" is set to "node" (Node10), which is the legacy CommonJS resolution algorithm. It does not support package.json "exports", self-references via "imports", or ESM resolution rules. Consider upgrading to "node16", "nodenext" (for Node.js), or "bundler" (for Vite/Webpack/esbuild).`
15
+ });
16
+ }
17
+ return findings;
18
+ }
19
+ };
20
+ //# sourceMappingURL=moduleResolutionOutdated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moduleResolutionOutdated.js","sourceRoot":"","sources":["../../src/rules/moduleResolutionOutdated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGlD,MAAM,MAAM,GAAG,8BAA8B,CAAC;AAE9C,MAAM,CAAC,MAAM,4BAA4B,GAAS;IAC9C,EAAE,EAAE,MAAM;IAEV,OAAO,CAAC,MAAuB;QAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,eAAe,IAAI,EAAE,CAAC;QAE7C,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QAElD,MAAM,QAAQ,GAAc,EAAE,CAAC;QAE/B,IAAI,gBAAgB,KAAK,oBAAoB,CAAC,MAAM,EAAE,CAAC;YACnD,QAAQ,CAAC,IAAI,CAAC;gBACV,MAAM,EAAE,MAAM;gBACd,QAAQ,EAAE,QAAQ;gBAClB,QAAQ,EAAE,MAAM;gBAChB,OAAO,EAAE,ySAAyS;aACrT,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.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Understand and simplify (re-conf) your tsconfig.json",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -39,7 +39,7 @@
39
39
  "typescript": "6.0.3"
40
40
  },
41
41
  "devDependencies": {
42
- "@types/node": "25.6.0",
43
- "tsx": "4.21.0"
42
+ "@types/node": "25.9.1",
43
+ "tsx": "4.22.3"
44
44
  }
45
45
  }