Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typescript-strict-plugin

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typescript-strict-plugin - npm Package Compare versions

Comparing version 2.2.2-beta.2 to 2.2.2-beta.4

19

dist/plugin/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const InMemoryProgram_1 = require("./InMemoryProgram");
const PluginStrictFileChecker_1 = require("./PluginStrictFileChecker");
const utils_1 = require("./utils");
const init = (mod) => {
const ts = mod.typescript;
const init = ({ typescript }) => {
function create(info) {
const inMemoryProgram = new InMemoryProgram_1.InMemoryProgram(ts, info);
const proxy = (0, utils_1.setupProxy)(info);
const proxy = (0, utils_1.setupLanguageServiceProxy)(info);
const strictLanguageServiceHost = (0, utils_1.setupStrictLanguageServiceHostProxy)(info);
const strictLanguageService = typescript.createLanguageService(strictLanguageServiceHost);
(0, utils_1.log)(info, 'Plugin initialized');

@@ -15,3 +14,3 @@ proxy.getSemanticDiagnostics = function (filePath) {

if (strictFile) {
return inMemoryProgram.getSemanticDiagnostics(filePath);
return strictLanguageService.getSemanticDiagnostics(filePath);
}

@@ -22,2 +21,10 @@ else {

};
proxy.cleanupSemanticCache = function () {
strictLanguageService.cleanupSemanticCache();
info.languageService.cleanupSemanticCache();
};
proxy.dispose = function () {
strictLanguageService.dispose();
info.languageService.dispose();
};
return proxy;

@@ -24,0 +31,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.log = exports.setupProxy = exports.turnOffStrictMode = exports.turnOnStrictMode = void 0;
exports.log = exports.setupStrictLanguageServiceHostProxy = exports.setupLanguageServiceProxy = void 0;
const constants_1 = require("../common/constants");
function turnOnStrictMode(info) {
info.project['compilerOptions'].strict = true;
}
exports.turnOnStrictMode = turnOnStrictMode;
function turnOffStrictMode(info) {
info.project['compilerOptions'].strict = false;
}
exports.turnOffStrictMode = turnOffStrictMode;
function setupProxy(info) {
function setupLanguageServiceProxy(info) {
const proxy = Object.create(null);

@@ -22,3 +14,20 @@ for (const k of Object.keys(info.languageService)) {

}
exports.setupProxy = setupProxy;
exports.setupLanguageServiceProxy = setupLanguageServiceProxy;
function setupStrictLanguageServiceHostProxy(info) {
const host = info.languageServiceHost;
const strictGetCompilationSettings = () => {
const settings = info.languageServiceHost.getCompilationSettings();
return { ...settings, strict: true };
};
const proxy = new Proxy(host, {
get(target, prop, receiver) {
if (prop === 'getCompilationSettings') {
return strictGetCompilationSettings;
}
return Reflect.get(target, prop, receiver);
},
});
return proxy;
}
exports.setupStrictLanguageServiceHostProxy = setupStrictLanguageServiceHostProxy;
function log(info, message) {

@@ -25,0 +34,0 @@ info.project.projectService.logger.info(`[${constants_1.PLUGIN_NAME}]: ` + message);

{
"name": "typescript-strict-plugin",
"version": "2.2.2-beta.2",
"version": "2.2.2-beta.4",
"description": "Typescript tools that help with migration to the strict mode",

@@ -5,0 +5,0 @@ "author": "Allegro",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc