New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More β†’
Socket
Sign inDemoInstall
Socket

eslint-plugin-expect-type

Package Overview
Dependencies
Maintainers
0
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-expect-type - npm Package Compare versions

Comparing version 0.5.1 to 0.6.0

lib/meta.d.mts

9

lib/failures/getExpectTypeFailures.d.ts

@@ -1,7 +0,12 @@

import ts__default from 'typescript';
import { Assertions } from '../assertions/types.js';
import { ResolvedVersionToTest } from '../utils/versions.js';
import { ExpectTypeFailures } from './types.js';
import 'typescript';
import '@typescript-eslint/utils/ts-eslint';
import '../meta.js';
import '@typescript-eslint/utils';
import '../utils/programs.js';
declare function getExpectTypeFailures(sourceFile: ts__default.SourceFile, assertions: Pick<Assertions, "twoSlashAssertions" | "typeAssertions">, program: ts__default.Program): ExpectTypeFailures;
declare function getExpectTypeFailures(assertions: Pick<Assertions, "twoSlashAssertions" | "typeAssertions">, { program, sourceFile, tsModule, version }: ResolvedVersionToTest): ExpectTypeFailures;
export { getExpectTypeFailures };
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;

@@ -20,10 +18,2 @@ var __export = (target, all) => {

};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

@@ -35,16 +25,14 @@ var getExpectTypeFailures_exports = {};

module.exports = __toCommonJS(getExpectTypeFailures_exports);
var import_typescript = __toESM(require("typescript"));
var import_locations = require("../utils/locations.js");
var import_locations2 = require("../utils/locations.js");
var import_typescript2 = require("../utils/typescript.js");
var import_typescript = require("../utils/typescript.js");
var import_normalizedTypeToString = require("./normalizedTypeToString.js");
function getExpectTypeFailures(sourceFile, assertions, program) {
function getExpectTypeFailures(assertions, { program, sourceFile, tsModule, version }) {
const checker = program.getTypeChecker();
const languageService = import_typescript.default.createLanguageService(
(0, import_typescript2.getLanguageServiceHost)(program)
const languageService = tsModule.createLanguageService(
(0, import_typescript.getLanguageServiceHost)(program, tsModule)
);
const { twoSlashAssertions, typeAssertions } = assertions;
const unmetExpectations = [];
import_typescript.default.forEachChild(sourceFile, function iterate(node) {
const line = (0, import_locations2.lineOfPosition)(node.getStart(sourceFile), sourceFile);
tsModule.forEachChild(sourceFile, function iterate(node) {
const line = (0, import_locations.lineOfPosition)(node.getStart(sourceFile), sourceFile);
const assertion = typeAssertions.get(line);

@@ -54,6 +42,6 @@ if (assertion !== void 0) {

let nodeToCheck = node;
if (node.kind === import_typescript.default.SyntaxKind.ExpressionStatement) {
if (node.kind === tsModule.SyntaxKind.ExpressionStatement) {
node = node.expression;
}
nodeToCheck = (0, import_typescript2.getNodeForExpectType)(node);
nodeToCheck = (0, import_typescript.getNodeForExpectType)(node, tsModule);
const type = checker.getTypeAtLocation(nodeToCheck);

@@ -64,3 +52,3 @@ const actual = checker.typeToString(

void 0,
import_typescript.default.TypeFormatFlags.NoTruncation
tsModule.TypeFormatFlags.NoTruncation
);

@@ -70,6 +58,6 @@ typeAssertions.delete(line);

if (!candidates || !candidateTypeMatches(actual, candidates)) {
unmetExpectations.push({ actual, assertion, node });
unmetExpectations.push({ actual, assertion, node, version });
}
}
import_typescript.default.forEachChild(node, iterate);
tsModule.forEachChild(node, iterate);
});

@@ -82,4 +70,4 @@ function candidateTypeMatches(actual, candidates) {

}
actualNormalized ??= (0, import_normalizedTypeToString.normalizedTypeToString)(actual);
const candidateNormalized = (0, import_normalizedTypeToString.normalizedTypeToString)(candidate);
actualNormalized ??= (0, import_normalizedTypeToString.normalizedTypeToString)(actual, tsModule);
const candidateNormalized = (0, import_normalizedTypeToString.normalizedTypeToString)(candidate, tsModule);
if (actualNormalized === candidateNormalized) {

@@ -99,3 +87,3 @@ return true;

}
const node = (0, import_locations.getNodeAtPosition)(sourceFile, position);
const node = (0, import_locations.getNodeAtPosition)(sourceFile, position, tsModule);
if (!node) {

@@ -118,3 +106,3 @@ twoSlashFailureLines.push(

const actual = qi.displayParts.map((dp) => dp.text).join("");
if (!(0, import_typescript2.matchModuloWhitespace)(actual, expected)) {
if (!(0, import_typescript.matchModuloWhitespace)(actual, expected)) {
unmetExpectations.push({

@@ -121,0 +109,0 @@ actual,

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

declare function normalizedTypeToString(type: string): string;
import { TSModule } from '../utils/programs.js';
import 'typescript';
declare function normalizedTypeToString(type: string, tsModule: TSModule): string;
export { normalizedTypeToString };
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;

@@ -20,10 +18,2 @@ var __export = (target, all) => {

};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

@@ -35,26 +25,25 @@ var normalizedTypeToString_exports = {};

module.exports = __toCommonJS(normalizedTypeToString_exports);
var import_typescript = __toESM(require("typescript"));
function normalizedTypeToString(type) {
const sourceFile = import_typescript.default.createSourceFile(
function normalizedTypeToString(type, tsModule) {
const sourceFile = tsModule.createSourceFile(
"foo.ts",
`declare var x: ${type};`,
import_typescript.default.ScriptTarget.Latest
tsModule.ScriptTarget.Latest
);
const typeNode = sourceFile.statements[0].declarationList.declarations[0].type;
const printer = import_typescript.default.createPrinter();
const printer = tsModule.createPrinter();
function print(node) {
return printer.printNode(import_typescript.default.EmitHint.Unspecified, node, sourceFile);
return printer.printNode(tsModule.EmitHint.Unspecified, node, sourceFile);
}
const context = import_typescript.default.nullTransformationContext;
const context = tsModule.nullTransformationContext;
function visit(node) {
node = import_typescript.default.visitEachChild(node, visit, context);
if (import_typescript.default.isUnionTypeNode(node)) {
node = tsModule.visitEachChild(node, visit, context);
if (tsModule.isUnionTypeNode(node)) {
const types = node.types.map((t) => [t, print(t)]).sort((a, b) => a[1] < b[1] ? -1 : 1).map((t) => t[0]);
return import_typescript.default.factory.updateUnionTypeNode(
return tsModule.factory.updateUnionTypeNode(
node,
import_typescript.default.factory.createNodeArray(types)
tsModule.factory.createNodeArray(types)
);
}
if (import_typescript.default.isTypeOperatorNode(node) && node.operator === import_typescript.default.SyntaxKind.ReadonlyKeyword && import_typescript.default.isArrayTypeNode(node.type)) {
return import_typescript.default.factory.createTypeReferenceNode("ReadonlyArray", [
if (tsModule.isTypeOperatorNode(node) && node.operator === tsModule.SyntaxKind.ReadonlyKeyword && tsModule.isArrayTypeNode(node.type)) {
return tsModule.factory.createTypeReferenceNode("ReadonlyArray", [
skipTypeParentheses(node.type.elementType)

@@ -67,8 +56,8 @@ ]);

return print(visited);
}
function skipTypeParentheses(node) {
while (import_typescript.default.isParenthesizedTypeNode(node)) {
node = node.type;
function skipTypeParentheses(node) {
while (tsModule.isParenthesizedTypeNode(node)) {
node = node.type;
}
return node;
}
return node;
}

@@ -75,0 +64,0 @@ // Annotate the CommonJS export names for ESM import in node:

@@ -18,4 +18,5 @@ import ts__default from 'typescript';

node: ts__default.Node;
version?: string;
}
export type { ExpectTypeFailures, UnmetExpectation };

@@ -1,20 +0,8 @@

import { ESLintUtils } from '@typescript-eslint/utils';
import { TSESLint } from '@typescript-eslint/utils';
import { Options } from '../meta.js';
declare const messages: {
ExpectedErrorNotFound: string;
FileIsNotIncludedInTSConfig: string;
OrphanAssertion: string;
SyntaxError: string;
TypesDoNotMatch: string;
TypeSnapshotDoNotMatch: string;
TypeSnapshotNotFound: string;
};
type MessageIds = keyof typeof messages;
interface Options {
readonly disableExpectTypeSnapshotFix: boolean;
}
declare const expect: ESLintUtils.RuleModule<"ExpectedErrorNotFound" | "FileIsNotIncludedInTSConfig" | "OrphanAssertion" | "SyntaxError" | "TypesDoNotMatch" | "TypeSnapshotDoNotMatch" | "TypeSnapshotNotFound", [Options], {
declare const expect: TSESLint.RuleModule<"CouldNotRequireTypeScript" | "DuplicateTSVersionName" | "ExpectedErrorNotFound" | "ExpectedErrorNotFoundForVersion" | "Multiple$ExpectTypeAssertions" | "OrphanAssertion" | "SyntaxError" | "TypesDoNotMatch" | "TypesDoNotMatchForVersion" | "TypeSnapshotDoNotMatch" | "TypeSnapshotDoNotMatchForVersion" | "TypeSnapshotNotFound", [Options], {
requiresTypeChecking?: boolean;
}, ESLintUtils.RuleListener>;
}, TSESLint.RuleListener>;
export { type MessageIds, type Options, expect };
export { expect };
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;

@@ -20,10 +18,2 @@ var __export = (target, all) => {

};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

@@ -35,6 +25,5 @@ var expect_exports = {};

module.exports = __toCommonJS(expect_exports);
var import_utils = require("@typescript-eslint/utils");
var import_typescript = __toESM(require("typescript"));
var import_parseAssertions = require("../assertions/parseAssertions.js");
var import_getExpectTypeFailures = require("../failures/getExpectTypeFailures.js");
var import_meta = require("../meta.js");
var import_createRule = require("../utils/createRule.js");

@@ -44,40 +33,49 @@ var import_diagnostics = require("../utils/diagnostics.js");

var import_snapshot = require("../utils/snapshot.js");
const messages = {
ExpectedErrorNotFound: "Expected an error on this line, but found none.",
FileIsNotIncludedInTSConfig: 'Expected to find a file "{{ fileName }}" present.',
OrphanAssertion: "Can not match a node to this assertion.",
SyntaxError: "Syntax Error: {{ message }}",
TypesDoNotMatch: "Expected type to be: {{ expected }}, got: {{ actual }}",
TypeSnapshotDoNotMatch: "Expected type from Snapshot to be: {{ expected }}, got: {{ actual }}",
TypeSnapshotNotFound: "Type Snapshot not found. Please consider running ESLint in FIX mode: eslint --fix"
};
var import_versions = require("../utils/versions.js");
const defaultOptions = {
disableExpectTypeSnapshotFix: false
disableExpectTypeSnapshotFix: false,
versionsToTest: void 0
};
const expect = (0, import_createRule.createRule)({
create(context, [options]) {
const parserServices = import_utils.ESLintUtils.getParserServices(context);
const { program } = parserServices;
const fileName = context.filename || context.getFilename();
const sourceFile = program.getSourceFile(fileName);
if (!/\$Expect(?:Type|Error|\?)|\^\?/.test(sourceFile.text)) {
if (!/\$Expect(?:Type|Error|\?)|\^\?/.test(context.sourceCode.text)) {
return {};
}
const { errorLines, syntaxErrors, twoSlashAssertions, typeAssertions } = (0, import_parseAssertions.parseAssertions)(sourceFile);
reportNotFoundErrors(context, errorLines, program, sourceFile);
reportSyntaxErrors(context, syntaxErrors);
const { unmetExpectations, unusedAssertions } = (0, import_getExpectTypeFailures.getExpectTypeFailures)(
sourceFile,
{ twoSlashAssertions, typeAssertions },
program
);
reportUnmetExpectations(
const fileName = context.filename || context.getFilename();
const versionsResolution = (0, import_versions.resolveVersionsToTest)(
context,
fileName,
options,
unmetExpectations,
sourceFile
options.versionsToTest
);
reportUnusedAssertions(context, unusedAssertions);
if (versionsResolution.error) {
context.report({
...versionsResolution.error,
loc: {
end: { column: 0, line: 0 },
start: { column: 0, line: 0 }
}
});
return {};
}
for (const version of versionsResolution.versionsToTest) {
testInVersion(version);
}
return {};
function testInVersion(version) {
const { errorLines, syntaxErrors, twoSlashAssertions, typeAssertions } = (0, import_parseAssertions.parseAssertions)(version.sourceFile);
reportNotFoundErrors(context, errorLines, version);
reportSyntaxErrors(context, syntaxErrors);
const { unmetExpectations, unusedAssertions } = (0, import_getExpectTypeFailures.getExpectTypeFailures)(
{ twoSlashAssertions, typeAssertions },
version
);
reportUnmetExpectations(
context,
fileName,
options,
unmetExpectations,
version.sourceFile
);
reportUnusedAssertions(context, unusedAssertions);
}
},

@@ -91,14 +89,31 @@ defaultOptions: [defaultOptions],

fixable: "code",
messages,
schema: [
{
additionalProperties: false,
properties: {
disableExpectTypeSnapshotFix: {
type: "boolean"
}
},
type: "object"
}
],
messages: import_meta.messages,
schema: {
$defs: {
version: {
additionalProperties: false,
properties: {
name: { required: true, type: "string" },
path: { required: true, type: "string" }
},
type: "object"
}
},
items: [
{
additionalProperties: false,
properties: {
disableExpectTypeSnapshotFix: {
type: "boolean"
},
versionsToTest: {
items: { $ref: "#/$defs/version" },
type: "array"
}
},
type: "object"
}
],
type: "array"
},
type: "problem"

@@ -108,4 +123,4 @@ },

});
function reportNotFoundErrors(context, errorLines, program, sourceFile) {
const diagnostics = import_typescript.default.getPreEmitDiagnostics(program, sourceFile);
function reportNotFoundErrors(context, errorLines, { program, sourceFile, tsModule, version }) {
const diagnostics = tsModule.getPreEmitDiagnostics(program, sourceFile);
const seenDiagnosticsOnLine = new Set(

@@ -117,2 +132,3 @@ diagnostics.filter(import_diagnostics.isDiagnosticWithStart).map((diagnostic) => (0, import_locations.lineOfPosition)(diagnostic.start, sourceFile))

context.report({
data: { version },
loc: {

@@ -122,3 +138,3 @@ column: 0,

},
messageId: "ExpectedErrorNotFound"
messageId: version ? "ExpectedErrorNotFoundForVersion" : "ExpectedErrorNotFound"
});

@@ -143,7 +159,8 @@ }

function reportUnmetExpectations(context, fileName, options, unmetExpectations, sourceFile) {
for (const { actual, assertion, node } of unmetExpectations) {
for (const { actual, assertion, node, version } of unmetExpectations) {
const templateDescriptor = {
data: {
actual,
expected: assertion.expected
expected: assertion.expected,
...version && { version }
},

@@ -182,3 +199,3 @@ loc: (0, import_locations.locForTSNode)(sourceFile, node)

...templateDescriptor,
messageId: "TypesDoNotMatch",
messageId: templateDescriptor.data.version ? "TypesDoNotMatchForVersion" : "TypesDoNotMatch",
...assertion.assertionType === "twoslash" ? {

@@ -185,0 +202,0 @@ fix: () => {

import { RuleTester } from '@typescript-eslint/rule-tester';
declare const tsconfigRootDir: string;
declare const filename: string;
declare const ruleTester: RuleTester;
export { filename, ruleTester };
export { filename, ruleTester, tsconfigRootDir };

@@ -32,3 +32,4 @@ "use strict";

filename: () => filename,
ruleTester: () => ruleTester
ruleTester: () => ruleTester,
tsconfigRootDir: () => tsconfigRootDir
});

@@ -56,4 +57,5 @@ module.exports = __toCommonJS(ruleTester_exports);

filename,
ruleTester
ruleTester,
tsconfigRootDir
});
//# sourceMappingURL=ruleTester.js.map

@@ -1,4 +0,5 @@

import * as ts from 'typescript';
import ts__default from 'typescript';
import { TSModule } from './programs.js';
declare const locForTSNode: (sourceFile: ts.SourceFile, node: ts.Node) => {
declare const locForTSNode: (sourceFile: ts__default.SourceFile, node: ts__default.Node) => {
end: {

@@ -13,5 +14,5 @@ column: number;

};
declare function getNodeAtPosition(sourceFile: ts.SourceFile, position: number): ts.Node | undefined;
declare function lineOfPosition(pos: number, sourceFile: ts.SourceFile): number;
declare function getNodeAtPosition(sourceFile: ts__default.SourceFile, position: number, tsModule: TSModule): ts__default.Node | undefined;
declare function lineOfPosition(pos: number, sourceFile: ts__default.SourceFile): number;
export { getNodeAtPosition, lineOfPosition, locForTSNode };
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;

@@ -20,10 +18,2 @@ var __export = (target, all) => {

};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

@@ -37,3 +27,2 @@ var locations_exports = {};

module.exports = __toCommonJS(locations_exports);
var ts = __toESM(require("typescript"));
const locForTSNode = (sourceFile, node) => {

@@ -53,5 +42,5 @@ const start = sourceFile.getLineAndCharacterOfPosition(node.getStart());

};
function getNodeAtPosition(sourceFile, position) {
function getNodeAtPosition(sourceFile, position, tsModule) {
let candidate = void 0;
ts.forEachChild(sourceFile, function iterate(node) {
tsModule.forEachChild(sourceFile, function iterate(node) {
const start = node.getStart();

@@ -61,3 +50,3 @@ const end = node.getEnd();

candidate = node;
ts.forEachChild(node, iterate);
tsModule.forEachChild(node, iterate);
}

@@ -64,0 +53,0 @@ });

@@ -1,7 +0,8 @@

import * as ts from 'typescript';
import ts__default from 'typescript';
import { TSModule } from './programs.js';
declare function getLanguageServiceHost(program: ts.Program): ts.LanguageServiceHost;
declare function getNodeForExpectType(node: ts.Node): ts.Node;
declare function getLanguageServiceHost(program: ts__default.Program, tsModule: TSModule): ts__default.LanguageServiceHost;
declare function getNodeForExpectType(node: ts__default.Node, tsModule: TSModule): ts__default.Node;
declare function matchModuloWhitespace(actual: string, expected: string): boolean;
export { getLanguageServiceHost, getNodeForExpectType, matchModuloWhitespace };
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;

@@ -20,10 +18,2 @@ var __export = (target, all) => {

};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

@@ -37,23 +27,24 @@ var typescript_exports = {};

module.exports = __toCommonJS(typescript_exports);
var ts = __toESM(require("typescript"));
function getLanguageServiceHost(program) {
function getLanguageServiceHost(program, tsModule) {
return {
getCompilationSettings: () => program.getCompilerOptions(),
getCurrentDirectory: () => program.getCurrentDirectory(),
getDefaultLibFileName: (options) => ts.getDefaultLibFilePath(options),
getDefaultLibFileName: (options) => tsModule.getDefaultLibFilePath(options),
getScriptFileNames: () => program.getSourceFiles().map((sourceFile) => sourceFile.fileName),
getScriptSnapshot: (name) => ts.ScriptSnapshot.fromString(program.getSourceFile(name)?.text ?? ""),
getScriptSnapshot: (name) => tsModule.ScriptSnapshot.fromString(
program.getSourceFile(name)?.text ?? ""
),
getScriptVersion: () => "1",
// NB: We can't check `program` for files, it won't contain valid files like package.json
/* eslint-disable @typescript-eslint/unbound-method */
directoryExists: ts.sys.directoryExists,
fileExists: ts.sys.fileExists,
getDirectories: ts.sys.getDirectories,
readDirectory: ts.sys.readDirectory,
readFile: ts.sys.readFile
directoryExists: tsModule.sys.directoryExists,
fileExists: tsModule.sys.fileExists,
getDirectories: tsModule.sys.getDirectories,
readDirectory: tsModule.sys.readDirectory,
readFile: tsModule.sys.readFile
/* eslint-enable @typescript-eslint/unbound-method */
};
}
function getNodeForExpectType(node) {
if (ts.isVariableStatement(node)) {
function getNodeForExpectType(node, tsModule) {
if (tsModule.isVariableStatement(node)) {
const {

@@ -60,0 +51,0 @@ declarationList: { declarations }

{
"name": "eslint-plugin-expect-type",
"version": "0.5.1",
"version": "0.6.0",
"description": "ESLint plugin with ^? Twoslash, $ExpectError, and $ExpectType type assertions. 🧩",

@@ -80,3 +80,4 @@ "keywords": [

"@typescript-eslint/utils": "^6.10.0 || ^7.0.1 || ^8",
"fs-extra": "^11.1.1"
"fs-extra": "^11.1.1",
"get-tsconfig": "^4.8.1"
},

@@ -124,2 +125,3 @@ "devDependencies": {

"typescript-eslint": "^8.16.0",
"typescript54": "npm:typescript@5.4.5",
"vitest": "^2.1.6"

@@ -126,0 +128,0 @@ },

@@ -123,3 +123,3 @@ <h1 align="center">eslint-plugin-expect-type</h1>

<td align="center" valign="top" width="14.28%"><a href="https://github.com/ibezkrovnyi"><img src="https://avatars.githubusercontent.com/u/1188919?v=4?s=100" width="100px;" alt="Igor Bezkrovnyi"/><br /><sub><b>Igor Bezkrovnyi</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-expect-type/issues?q=author%3Aibezkrovnyi" title="Bug reports">πŸ›</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-expect-type/commits?author=ibezkrovnyi" title="Code">πŸ’»</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-expect-type/commits?author=ibezkrovnyi" title="Documentation">πŸ“–</a> <a href="#maintenance-ibezkrovnyi" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://www.joshuakgoldberg.com/"><img src="https://avatars.githubusercontent.com/u/3335181?v=4?s=100" width="100px;" alt="Josh Goldberg ✨"/><br /><sub><b>Josh Goldberg ✨</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-expect-type/issues?q=author%3AJoshuaKGoldberg" title="Bug reports">πŸ›</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-expect-type/commits?author=JoshuaKGoldberg" title="Code">πŸ’»</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-expect-type/commits?author=JoshuaKGoldberg" title="Documentation">πŸ“–</a> <a href="#maintenance-JoshuaKGoldberg" title="Maintenance">🚧</a> <a href="#infra-JoshuaKGoldberg" title="Infrastructure (Hosting, Build-Tools, etc)">πŸš‡</a> <a href="#ideas-JoshuaKGoldberg" title="Ideas, Planning, & Feedback">πŸ€”</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://www.joshuakgoldberg.com/"><img src="https://avatars.githubusercontent.com/u/3335181?v=4?s=100" width="100px;" alt="Josh Goldberg ✨"/><br /><sub><b>Josh Goldberg ✨</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-expect-type/issues?q=author%3AJoshuaKGoldberg" title="Bug reports">πŸ›</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-expect-type/commits?author=JoshuaKGoldberg" title="Code">πŸ’»</a> <a href="https://github.com/JoshuaKGoldberg/eslint-plugin-expect-type/commits?author=JoshuaKGoldberg" title="Documentation">πŸ“–</a> <a href="#maintenance-JoshuaKGoldberg" title="Maintenance">🚧</a> <a href="#infra-JoshuaKGoldberg" title="Infrastructure (Hosting, Build-Tools, etc)">πŸš‡</a> <a href="#ideas-JoshuaKGoldberg" title="Ideas, Planning, & Feedback">πŸ€”</a> <a href="#tool-JoshuaKGoldberg" title="Tools">πŸ”§</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://twitter.com/_RussellDavis"><img src="https://avatars.githubusercontent.com/u/551404?v=4?s=100" width="100px;" alt="Russell Davis"/><br /><sub><b>Russell Davis</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-expect-type/commits?author=russelldavis" title="Code">πŸ’»</a></td>

@@ -126,0 +126,0 @@ <td align="center" valign="top" width="14.28%"><a href="https://github.com/mrazauskas"><img src="https://avatars.githubusercontent.com/u/72159681?v=4?s=100" width="100px;" alt="Tom Mrazauskas"/><br /><sub><b>Tom Mrazauskas</b></sub></a><br /><a href="https://github.com/JoshuaKGoldberg/eslint-plugin-expect-type/commits?author=mrazauskas" title="Documentation">πŸ“–</a></td>

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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