@typescript-eslint/parser
Advanced tools
Comparing version 5.59.9 to 6.14.0
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.59.9", | ||
"version": "6.14.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,7 +42,7 @@ "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", | ||
"lint": "nx lint", | ||
"lint": "npx nx lint", | ||
"test": "jest --coverage", | ||
@@ -46,8 +52,9 @@ "typecheck": "tsc -p tsconfig.json --noEmit" | ||
"peerDependencies": { | ||
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" | ||
"eslint": "^7.0.0 || ^8.0.0" | ||
}, | ||
"dependencies": { | ||
"@typescript-eslint/scope-manager": "5.59.9", | ||
"@typescript-eslint/types": "5.59.9", | ||
"@typescript-eslint/typescript-estree": "5.59.9", | ||
"@typescript-eslint/scope-manager": "6.14.0", | ||
"@typescript-eslint/types": "6.14.0", | ||
"@typescript-eslint/typescript-estree": "6.14.0", | ||
"@typescript-eslint/visitor-keys": "6.14.0", | ||
"debug": "^4.3.4" | ||
@@ -57,3 +64,7 @@ }, | ||
"@types/glob": "*", | ||
"downlevel-dts": "*", | ||
"glob": "*", | ||
"jest": "29.7.0", | ||
"prettier": "^3.0.3", | ||
"rimraf": "*", | ||
"typescript": "*" | ||
@@ -71,9 +82,9 @@ }, | ||
"typesVersions": { | ||
"<3.8": { | ||
"<4.7": { | ||
"*": [ | ||
"_ts3.4/*" | ||
"_ts4.3/*" | ||
] | ||
} | ||
}, | ||
"gitHead": "a2b6b2e0a1ccdfbd5c76ba3fbcffd94d29f5d2b1" | ||
"gitHead": "c7d702f4315f66c75ae16a4b559ef5b4705bb804" | ||
} |
@@ -8,4 +8,6 @@ # `@typescript-eslint/parser` | ||
👉 See **https://typescript-eslint.io/architecture/parser** for documentation on this package. | ||
👉 See **https://typescript-eslint.io/packages/parser** for documentation on this package. | ||
> 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
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
13
17850
6
7
11
171
+ Added@typescript-eslint/scope-manager@6.14.0(transitive)
+ Added@typescript-eslint/types@6.14.0(transitive)
+ Added@typescript-eslint/typescript-estree@6.14.0(transitive)
+ Added@typescript-eslint/visitor-keys@6.14.0(transitive)
+ Addedts-api-utils@1.3.0(transitive)
- Removed@typescript-eslint/scope-manager@5.59.9(transitive)
- Removed@typescript-eslint/types@5.59.9(transitive)
- Removed@typescript-eslint/typescript-estree@5.59.9(transitive)
- Removed@typescript-eslint/visitor-keys@5.59.9(transitive)
- Removedtslib@1.14.1(transitive)
- Removedtsutils@3.21.0(transitive)