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

tslint-to-eslint-config

Package Overview
Dependencies
Maintainers
1
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tslint-to-eslint-config - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

.github/ISSUE_TEMPLATE/missing_merger.md

3

.eslintrc.js

@@ -21,6 +21,7 @@ module.exports = {

rules: {
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/consistent-type-definitions": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/generic-type-naming": 0,
"@typescript-eslint/indent": 0,
"@typescript-eslint/member-ordering": 0,
"@typescript-eslint/no-explicit-any": 0,

@@ -27,0 +28,0 @@ "@typescript-eslint/no-extra-parens": 0,

@@ -68,3 +68,3 @@ {

},
"version": "0.2.4"
"version": "0.2.5"
}
import { OriginalConfigurations } from "../../input/findOriginalConfigurations";
export declare const createEnv: ({ packages, typescript, }: Pick<OriginalConfigurations, "typescript" | "packages">) => {};
export declare const createEnv: ({ packages, typescript, }: Pick<OriginalConfigurations, "packages" | "typescript">) => {};

@@ -11,2 +11,2 @@ import { SansDependencies } from "../../binding";

export declare type SimplifiedRuleConversionResults = Pick<RuleConversionResults, "converted" | "failed">;
export declare const simplifyPackageRules: (dependencies: SimplifyPackageRulesDependencies, eslint: Partial<ESLintConfiguration> | undefined, ruleConversionResults: Pick<RuleConversionResults, "converted" | "failed">) => Promise<Pick<RuleConversionResults, "converted" | "failed">>;
export declare const simplifyPackageRules: (dependencies: SimplifyPackageRulesDependencies, eslint: Partial<ESLintConfiguration> | undefined, ruleConversionResults: Pick<RuleConversionResults, "failed" | "converted">) => Promise<Pick<RuleConversionResults, "failed" | "converted">>;

@@ -1,5 +0,7 @@

export declare class ConfigurationError {
readonly error: Error;
readonly complaint: string;
import { ErrorSummary } from "./errorSummary";
export declare class ConfigurationError implements ErrorSummary {
private readonly error;
private readonly complaint;
constructor(error: Error, complaint: string);
getSummary(): string;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const os_1 = require("os");
class ConfigurationError {

@@ -8,4 +9,7 @@ constructor(error, complaint) {

}
getSummary() {
return `${this.complaint}: ${this.error.stack}${os_1.EOL}`;
}
}
exports.ConfigurationError = ConfigurationError;
//# sourceMappingURL=configurationError.js.map
import { TSLintRuleOptions } from "../rules/types";
export declare class ConversionError {
readonly error: Error;
readonly tslintRule: TSLintRuleOptions;
constructor(error: Error, tslintRule: TSLintRuleOptions);
import { ErrorSummary } from "./errorSummary";
export declare class ConversionError implements ErrorSummary {
private readonly summary;
private constructor();
static forMerger: (eslintRule: string) => ConversionError;
getSummary(): string;
static forRuleError: (error: Error, tslintRule: TSLintRuleOptions) => ConversionError;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const os_1 = require("os");
class ConversionError {
constructor(error, tslintRule) {
this.error = error;
this.tslintRule = tslintRule;
constructor(summary) {
this.summary = summary;
}
getSummary() {
return this.summary;
}
}
exports.ConversionError = ConversionError;
ConversionError.forMerger = (eslintRule) => {
return new ConversionError([
`Error: multiple output ${eslintRule} ESLint rule options were generated, but tslint-to-eslint-config doesn't have "merger" logic to deal with this.`,
`Please file an issue at https://github.com/typescript-eslint/tslint-to-eslint-config/issues/new?template=missing_merger.md 🙏`,
].join(os_1.EOL));
};
ConversionError.forRuleError = (error, tslintRule) => {
return new ConversionError(`${tslintRule.ruleName} threw an error during conversion: ${error.stack}${os_1.EOL}`);
};
//# sourceMappingURL=conversionError.js.map

@@ -15,2 +15,2 @@ import { ESLintRuleSeverity } from "../rules/types";

export declare type ESLintConfigurationRuleValue = 0 | 1 | 2 | ESLintRuleSeverity | [ESLintRuleSeverity, any];
export declare const findESLintConfiguration: (dependencies: FindConfigurationDependencies, rawSettings: Pick<TSLintToESLintSettings, "config" | "eslint">) => Promise<Error | ESLintConfiguration>;
export declare const findESLintConfiguration: (dependencies: FindConfigurationDependencies, rawSettings: Pick<TSLintToESLintSettings, "eslint" | "config">) => Promise<Error | ESLintConfiguration>;

@@ -5,3 +5,2 @@ "use strict";

const os_1 = require("os");
const configurationError_1 = require("../errors/configurationError");
exports.reportConversionResults = (dependencies, ruleConversionResults) => {

@@ -34,7 +33,3 @@ if (ruleConversionResults.converted.size !== 0) {

logger.stderr.write(chalk_1.default.redBright(` 💀${os_1.EOL}`));
logger.info.write(failed
.map(failed => failed instanceof configurationError_1.ConfigurationError
? `${failed.complaint}: ${failed.error.stack}${os_1.EOL}`
: `${failed.tslintRule.ruleName} threw an error during conversion: ${failed.error.stack}${os_1.EOL}`)
.join(""));
logger.info.write(failed.map(failed => failed.getSummary()).join(""));
logger.stderr.write(chalk_1.default.gray(`Check ${logger.debugFileName} for details.${os_1.EOL}`));

@@ -41,0 +36,0 @@ };

@@ -0,3 +1,3 @@

import { TSLintRuleOptions } from "./types";
import { ConversionError } from "../errors/conversionError";
import { TSLintRuleOptions } from "./types";
/**

@@ -4,0 +4,0 @@ * Section of a TSLint rule's options used for conversion.

@@ -7,3 +7,3 @@ "use strict";

{
ruleName: "@typescript-eslint/member-ordering",
ruleName: "some-rule",
},

@@ -10,0 +10,0 @@ ],

@@ -7,3 +7,3 @@ "use strict";

{
ruleName: "no-eval",
ruleName: "some-rule",
},

@@ -10,0 +10,0 @@ ],

@@ -13,5 +13,5 @@ "use strict";

catch (error) {
return new conversionError_1.ConversionError(error, tslintRule);
return conversionError_1.ConversionError.forRuleError(error, tslintRule);
}
};
//# sourceMappingURL=convertRule.js.map

@@ -1,3 +0,2 @@

import { ConfigurationError } from "../errors/configurationError";
import { ConversionError } from "../errors/conversionError";
import { ErrorSummary } from "../errors/errorSummary";
import { TSLintConfigurationRules } from "../input/findTSLintConfiguration";

@@ -13,3 +12,3 @@ import { RuleConverter } from "./converter";

converted: Map<string, ESLintRuleOptions>;
failed: (ConfigurationError | ConversionError)[];
failed: ErrorSummary[];
missing: TSLintRuleOptions[];

@@ -16,0 +15,0 @@ plugins: Set<string>;

@@ -37,3 +37,3 @@ "use strict";

if (merger === undefined) {
failed.push(new conversionError_1.ConversionError(new Error(`No merger for multiple output ${changes.ruleName} rule configurations.`), tslintRule));
failed.push(conversionError_1.ConversionError.forMerger(changes.ruleName));
}

@@ -40,0 +40,0 @@ else {

@@ -6,2 +6,2 @@ import { ESLintRuleSeverity, TSLintRuleSeverity } from "./types";

export declare const convertTSLintRuleSeverity: (tslintSeverity: TSLintRuleSeverity) => ESLintRuleSeverity;
export declare const convertRawESLintRuleSeverity: (rawSeverity: 0 | 1 | 2 | "error" | "off" | "warn") => ESLintRuleSeverity;
export declare const convertRawESLintRuleSeverity: (rawSeverity: 0 | "off" | "error" | 2 | 1 | "warn") => ESLintRuleSeverity;

@@ -0,0 +0,0 @@ module.exports = {

@@ -0,0 +0,0 @@ module.exports = {

✨ 17 rules replaced with their ESLint equivalents. ✨
️👀 2 rules do not yet have ESLint equivalents; defaulting to eslint-plugin-tslint. 👀
✅ All is well! ✅

@@ -0,0 +0,0 @@ module.exports = {

✨ 17 rules replaced with their ESLint equivalents. ✨
️👀 2 rules do not yet have ESLint equivalents; defaulting to eslint-plugin-tslint. 👀
✅ All is well! ✅

@@ -0,0 +0,0 @@ module.exports = {

✨ 17 rules replaced with their ESLint equivalents. ✨
️👀 2 rules do not yet have ESLint equivalents; defaulting to eslint-plugin-tslint. 👀
✅ All is well! ✅

@@ -0,0 +0,0 @@ module.exports = {

✨ 17 rules replaced with their ESLint equivalents. ✨
️👀 2 rules do not yet have ESLint equivalents; defaulting to eslint-plugin-tslint. 👀
✅ All is well! ✅
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