You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@typescript-eslint/parser

Package Overview
Dependencies
Maintainers
2
Versions
4279
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@typescript-eslint/parser - npm Package Compare versions

Comparing version

to
6.7.0

2

dist/index.d.ts
export { parse, parseForESLint, ParserOptions } from './parser';
export { ParserServices, clearCaches, createProgram, } from '@typescript-eslint/typescript-estree';
export { ParserServices, ParserServicesWithTypeInformation, ParserServicesWithoutTypeInformation, clearCaches, createProgram, } from '@typescript-eslint/typescript-estree';
export declare const version: string;

@@ -4,0 +4,0 @@ export declare const meta: {

@@ -5,3 +5,4 @@ import type { ScopeManager } from '@typescript-eslint/scope-manager';

import type { ParserServices } from '@typescript-eslint/typescript-estree';
import { visitorKeys } from '@typescript-eslint/typescript-estree';
import { visitorKeys } from '@typescript-eslint/visitor-keys';
import type * as ts from 'typescript';
interface ParseForESLintResult {

@@ -17,5 +18,5 @@ ast: TSESTree.Program & {

}
declare function parse(code: string, options?: ParserOptions): ParseForESLintResult['ast'];
declare function parseForESLint(code: string, options?: ParserOptions | null): ParseForESLintResult;
declare function parse(code: ts.SourceFile | string, options?: ParserOptions): ParseForESLintResult['ast'];
declare function parseForESLint(code: ts.SourceFile | string, options?: ParserOptions | null): ParseForESLintResult;
export { parse, parseForESLint, ParserOptions };
//# sourceMappingURL=parser.d.ts.map

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

const typescript_estree_1 = require("@typescript-eslint/typescript-estree");
const visitor_keys_1 = require("@typescript-eslint/visitor-keys");
const debug_1 = __importDefault(require("debug"));

@@ -21,3 +22,2 @@ const typescript_1 = require("typescript");

function getLib(compilerOptions) {
var _a;
if (compilerOptions.lib) {

@@ -32,3 +32,3 @@ return compilerOptions.lib.reduce((acc, lib) => {

}
const target = (_a = compilerOptions.target) !== null && _a !== void 0 ? _a : typescript_1.ScriptTarget.ES5;
const target = compilerOptions.target ?? typescript_1.ScriptTarget.ES5;
// https://github.com/microsoft/TypeScript/blob/ae582a22ee1bb052e19b7c1bc4cac60509b574e0/src/compiler/utilitiesPublic.ts#L13-L36

@@ -67,3 +67,3 @@ switch (target) {

else {
options = Object.assign({}, options);
options = { ...options };
}

@@ -83,3 +83,2 @@ // https://eslint.org/docs/user-guide/configuring#specifying-parser-options

const analyzeOptions = {
ecmaVersion: options.ecmaVersion === 'latest' ? 1e8 : options.ecmaVersion,
globalReturn: options.ecmaFeatures.globalReturn,

@@ -102,3 +101,3 @@ jsxPragma: options.jsxPragma,

let emitDecoratorMetadata = options.emitDecoratorMetadata === true;
if (services.hasFullTypeInformation) {
if (services.program) {
// automatically apply the options configured for the program

@@ -134,5 +133,5 @@ const compilerOptions = services.program.getCompilerOptions();

const scopeManager = (0, scope_manager_1.analyze)(ast, analyzeOptions);
return { ast, services, scopeManager, visitorKeys: typescript_estree_1.visitorKeys };
return { ast, services, scopeManager, visitorKeys: visitor_keys_1.visitorKeys };
}
exports.parseForESLint = parseForESLint;
//# sourceMappingURL=parser.js.map
{
"name": "@typescript-eslint/parser",
"version": "5.62.0",
"version": "6.7.0",
"description": "An ESLint custom parser which leverages TypeScript ESTree",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist",
"_ts3.4",
"_ts4.3",
"README.md",
"LICENSE"
],
"type": "commonjs",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./package.json": "./package.json"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
"node": "^16.0.0 || >=18.0.0"
},

@@ -36,5 +42,5 @@ "repository": {

"build": "tsc -b tsconfig.build.json",
"postbuild": "downlevel-dts dist _ts3.4/dist",
"postbuild": "downlevel-dts dist _ts4.3/dist --to=4.3",
"clean": "tsc -b tsconfig.build.json --clean",
"postclean": "rimraf dist && rimraf _ts3.4 && rimraf coverage",
"postclean": "rimraf dist && rimraf _ts4.3 && rimraf coverage",
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",

@@ -46,8 +52,9 @@ "lint": "nx lint",

"peerDependencies": {
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
"eslint": "^7.0.0 || ^8.0.0"
},
"dependencies": {
"@typescript-eslint/scope-manager": "5.62.0",
"@typescript-eslint/types": "5.62.0",
"@typescript-eslint/typescript-estree": "5.62.0",
"@typescript-eslint/scope-manager": "6.7.0",
"@typescript-eslint/types": "6.7.0",
"@typescript-eslint/typescript-estree": "6.7.0",
"@typescript-eslint/visitor-keys": "6.7.0",
"debug": "^4.3.4"

@@ -57,3 +64,7 @@ },

"@types/glob": "*",
"downlevel-dts": "*",
"glob": "*",
"jest": "29.6.4",
"prettier": "^2.8.4",
"rimraf": "*",
"typescript": "*"

@@ -71,9 +82,9 @@ },

"typesVersions": {
"<3.8": {
"<4.7": {
"*": [
"_ts3.4/*"
"_ts4.3/*"
]
}
},
"gitHead": "cba0d113bba1bbcee69149c954dc6bd4c658c714"
"gitHead": "79ffff05dbf21796565eef0076ba0bf4fc55e7ed"
}

@@ -11,1 +11,3 @@ # `@typescript-eslint/parser`

> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code.
<!-- Local path for docs: docs/packages/Parser.mdx -->

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