typescript-strictly-typed
Advanced tools
Comparing version 3.12.0 to 3.13.0
@@ -45,2 +45,3 @@ import { dump, load } from "js-yaml"; | ||
config = { | ||
source: file, | ||
raw, | ||
@@ -55,2 +56,3 @@ json: parse(raw), | ||
config = { | ||
source: file, | ||
raw: JSON.stringify(json), | ||
@@ -66,2 +68,3 @@ json, | ||
config = { | ||
source: file, | ||
raw: JSON.stringify(json), | ||
@@ -68,0 +71,0 @@ json, |
@@ -38,2 +38,3 @@ import {} from "jsonc-parser"; | ||
config = { | ||
source: file, | ||
raw: JSON.stringify({ rules: {} }), | ||
@@ -49,2 +50,3 @@ json: { rules: {} }, | ||
config = { | ||
source: file, | ||
raw: JSON.stringify(packageJSONConfig.json.eslintConfig), | ||
@@ -104,3 +106,3 @@ json: packageJSONConfig.json.eslintConfig, | ||
function addTSConfig(config, path, rules) { | ||
const typeCheckedEnabled = isTypeCheckedEnabled(config.raw); | ||
const typeCheckedEnabled = isTypeCheckedEnabled(config.source); | ||
config.raw = modifyJSON(config.raw, [...path, "rules", "eqeqeq"], "error"); | ||
@@ -107,0 +109,0 @@ config.raw = modifyJSON(config.raw, [...path, "rules", "prefer-arrow-callback"], "error"); |
{ | ||
"name": "typescript-strictly-typed", | ||
"version": "3.12.0", | ||
"version": "3.13.0", | ||
"description": "Enable configurations for strictly typed TypeScript, ESLint, and optionally Angular.", | ||
@@ -5,0 +5,0 @@ "funding": { |
@@ -42,12 +42,26 @@ import { checkDependencyVersion, findConfig, getConfig, modifyJSON, saveConfig } from "./config-utils.js"; | ||
} | ||
/* Clean up options included in strict mode */ | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "alwaysStrict"], undefined); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "noImplicitAny"], undefined); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "noImplicitThis"], undefined); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "strictBindCallApply"], undefined); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "strictFunctionTypes"], undefined); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "strictNullChecks"], undefined); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "strictPropertyInitialization"], undefined); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "useUnknownInCatchVariables"], undefined); | ||
/* If the configuration is extending another one, specific flags could be disabled | ||
* in the parent configuration, so we enable them individually */ | ||
if (config.json.extends !== undefined) { | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "alwaysStrict"], true); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "noImplicitAny"], true); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "noImplicitThis"], true); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "strictBindCallApply"], true); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "strictFunctionTypes"], true); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "strictNullChecks"], true); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "strictPropertyInitialization"], true); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "useUnknownInCatchVariables"], true); | ||
} | ||
/* Otherwise, clean up options included in strict mode to keep configuration small */ | ||
else { | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "alwaysStrict"], undefined); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "noImplicitAny"], undefined); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "noImplicitThis"], undefined); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "strictBindCallApply"], undefined); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "strictFunctionTypes"], undefined); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "strictNullChecks"], undefined); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "strictPropertyInitialization"], undefined); | ||
config.raw = modifyJSON(config.raw, ["compilerOptions", "useUnknownInCatchVariables"], undefined); | ||
} | ||
return saveConfig(cwd, file, config); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24693
520