Socket
Socket
Sign inDemoInstall

@typescript-eslint/utils

Package Overview
Dependencies
Maintainers
2
Versions
2042
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.15.1-alpha.10 to 7.15.1-alpha.11

dist/eslint-utils/parserSeemsToBeTSESLint.d.ts

17

dist/eslint-utils/getParserServices.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getParserServices = getParserServices;
const parserPathSeemsToBeTSESLint_1 = require("./parserPathSeemsToBeTSESLint");
const parserSeemsToBeTSESLint_1 = require("./parserSeemsToBeTSESLint");
const ERROR_MESSAGE_REQUIRES_PARSER_SERVICES = 'You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.';
const ERROR_MESSAGE_UNKNOWN_PARSER = 'Note: detected a parser other than @typescript-eslint/parser. Make sure the parser is configured to forward "parserOptions.project" to @typescript-eslint/parser.';
function getParserServices(context, allowWithoutFullTypeInformation = false) {
const parser = context.parserPath || context.languageOptions.parser?.meta?.name;
// This check is unnecessary if the user is using the latest version of our parser.

@@ -20,3 +21,3 @@ //

context.sourceCode.parserServices.tsNodeToESTreeNodeMap == null) {
throwError(context.parserPath);
throwError(parser);
}

@@ -27,3 +28,3 @@ // if a rule requires full type information, then hard fail if it doesn't exist

!allowWithoutFullTypeInformation) {
throwError(context.parserPath);
throwError(parser);
}

@@ -33,12 +34,10 @@ return context.sourceCode.parserServices;

/* eslint-enable @typescript-eslint/unified-signatures */
function throwError(parserPath) {
function throwError(parser) {
const messages = [
ERROR_MESSAGE_REQUIRES_PARSER_SERVICES,
`Parser: ${parserPath}`,
];
if (!(0, parserPathSeemsToBeTSESLint_1.parserPathSeemsToBeTSESLint)(parserPath)) {
messages.push(ERROR_MESSAGE_UNKNOWN_PARSER);
}
`Parser: ${parser || '(unknown)'}`,
!(0, parserSeemsToBeTSESLint_1.parserSeemsToBeTSESLint)(parser) && ERROR_MESSAGE_UNKNOWN_PARSER,
].filter(Boolean);
throw new Error(messages.join('\n'));
}
//# sourceMappingURL=getParserServices.js.map

@@ -154,5 +154,5 @@ import type { JSONSchema4 } from '../json-schema';

/**
* The name of the parser from configuration.
* The name of the parser from configuration, if in eslintrc (legacy) config.
*/
parserPath: string;
parserPath: string | undefined;
/**

@@ -159,0 +159,0 @@ * The language options configured for this run

{
"name": "@typescript-eslint/utils",
"version": "7.15.1-alpha.10",
"version": "7.15.1-alpha.11",
"description": "Utilities for working with TypeScript + ESLint together",

@@ -67,5 +67,5 @@ "files": [

"@eslint-community/eslint-utils": "^4.4.0",
"@typescript-eslint/scope-manager": "7.15.1-alpha.10",
"@typescript-eslint/types": "7.15.1-alpha.10",
"@typescript-eslint/typescript-estree": "7.15.1-alpha.10"
"@typescript-eslint/scope-manager": "7.15.1-alpha.11",
"@typescript-eslint/types": "7.15.1-alpha.11",
"@typescript-eslint/typescript-estree": "7.15.1-alpha.11"
},

@@ -72,0 +72,0 @@ "peerDependencies": {

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc