Update Bot (j'ai plus le repo sur GitHub)
Qui c'est la conne qui a delete le repo sur GitHub? C'EST MOIIIII
This commit is contained in:
5
node_modules/@eslint/config-array/README.md
generated
vendored
5
node_modules/@eslint/config-array/README.md
generated
vendored
@@ -357,12 +357,11 @@ Apache 2.0
|
||||
The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
|
||||
to get your logo on our READMEs and [website](https://eslint.org/sponsors).
|
||||
|
||||
<h3>Diamond Sponsors</h3>
|
||||
<p><a href="https://www.ag-grid.com/"><img src="https://images.opencollective.com/ag-grid/bec0580/logo.png" alt="AG Grid" height="128"></a></p><h3>Platinum Sponsors</h3>
|
||||
<h3>Platinum Sponsors</h3>
|
||||
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="128"></a></p><h3>Gold Sponsors</h3>
|
||||
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://trunk.io/"><img src="https://images.opencollective.com/trunkio/fb92d60/avatar.png" alt="trunk.io" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a></p><h3>Silver Sponsors</h3>
|
||||
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/e6d15e1/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301" alt="American Express" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
|
||||
<p><a href="https://sentry.io"><img src="https://github.com/getsentry.png" alt="Sentry" height="32"></a> <a href="https://syntax.fm"><img src="https://github.com/syntaxfm.png" alt="Syntax" height="32"></a> <a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://nolebase.ayaka.io"><img src="https://avatars.githubusercontent.com/u/11081491" alt="Neko" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="LambdaTest" height="32"></a></p>
|
||||
<p><a href="https://syntax.fm"><img src="https://github.com/syntaxfm.png" alt="Syntax" height="32"></a> <a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://sentry.io"><img src="https://github.com/getsentry.png" alt="Sentry" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="LambdaTest" height="32"></a></p>
|
||||
<h3>Technology Sponsors</h3>
|
||||
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
|
||||
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
|
||||
|
||||
23
node_modules/@eslint/config-array/dist/cjs/index.cjs
generated
vendored
23
node_modules/@eslint/config-array/dist/cjs/index.cjs
generated
vendored
@@ -35,8 +35,9 @@ var windowsPath__namespace = /*#__PURE__*/_interopNamespaceDefault(windowsPath);
|
||||
// Types
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @typedef {import("@eslint/object-schema").PropertyDefinition} PropertyDefinition */
|
||||
/** @typedef {import("@eslint/object-schema").ObjectDefinition} ObjectDefinition */
|
||||
/** @import * as $eslintobjectschema from "@eslint/object-schema"; */
|
||||
/** @typedef {$eslintobjectschema.PropertyDefinition} PropertyDefinition */
|
||||
/** @typedef {$eslintobjectschema.ObjectDefinition} ObjectDefinition */
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
@@ -200,10 +201,12 @@ const filesAndIgnoresSchema = Object.freeze({
|
||||
// Types
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @typedef {import("./types.ts").ConfigObject} ConfigObject */
|
||||
/** @typedef {import("minimatch").IMinimatchStatic} IMinimatchStatic */
|
||||
/** @typedef {import("minimatch").IMinimatch} IMinimatch */
|
||||
/** @typedef {import("@jsr/std__path")} PathImpl */
|
||||
/** @import * as $typests from "./types.ts"; */
|
||||
/** @typedef {$typests.ConfigObject} ConfigObject */
|
||||
/** @import * as $minimatch from "minimatch"; */
|
||||
/** @typedef {$minimatch.IMinimatchStatic} IMinimatchStatic */
|
||||
/** @typedef {$minimatch.IMinimatch} IMinimatch */
|
||||
/** @import * as PathImpl from "@jsr/std__path" */
|
||||
|
||||
/*
|
||||
* This is a bit of a hack to make TypeScript happy with the Rollup-created
|
||||
@@ -212,7 +215,7 @@ const filesAndIgnoresSchema = Object.freeze({
|
||||
* for `ObjectSchema`. To work around that, we just import the type manually
|
||||
* and give it a different name to use in the JSDoc comments.
|
||||
*/
|
||||
/** @typedef {import("@eslint/object-schema").ObjectSchema} ObjectSchemaInstance */
|
||||
/** @typedef {ObjectSchema} ObjectSchemaInstance */
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
@@ -1146,7 +1149,8 @@ class ConfigArray extends Array {
|
||||
* @param {Object} config The config to finalize.
|
||||
* @returns {Object} The finalized config.
|
||||
*/
|
||||
[ConfigArraySymbol.finalizeConfig](config) {
|
||||
// Cast key to `never` to prevent TypeScript from adding the signature `[x: symbol]: (config: any) => any` to the type of the class.
|
||||
[/** @type {never} */ (ConfigArraySymbol.finalizeConfig)](config) {
|
||||
return config;
|
||||
}
|
||||
|
||||
@@ -1158,7 +1162,8 @@ class ConfigArray extends Array {
|
||||
* @param {Object} config The config to preprocess.
|
||||
* @returns {Object} The config to use in place of the argument.
|
||||
*/
|
||||
[ConfigArraySymbol.preprocessConfig](config) {
|
||||
// Cast key to `never` to prevent TypeScript from adding the signature `[x: symbol]: (config: any) => any` to the type of the class.
|
||||
[/** @type {never} */ (ConfigArraySymbol.preprocessConfig)](config) {
|
||||
return config;
|
||||
}
|
||||
|
||||
|
||||
18
node_modules/@eslint/config-array/dist/cjs/index.d.cts
generated
vendored
18
node_modules/@eslint/config-array/dist/cjs/index.d.cts
generated
vendored
@@ -1,17 +1,15 @@
|
||||
export { ObjectSchema } from "@eslint/object-schema";
|
||||
export type PropertyDefinition = import("@eslint/object-schema").PropertyDefinition;
|
||||
export type ObjectDefinition = import("@eslint/object-schema").ObjectDefinition;
|
||||
export type ConfigObject = import("./types.cts").ConfigObject;
|
||||
export type IMinimatchStatic = import("minimatch").IMinimatchStatic;
|
||||
export type IMinimatch = import("minimatch").IMinimatch;
|
||||
export type PathImpl = typeof import("@jsr/std__path");
|
||||
export type ObjectSchemaInstance = import("@eslint/object-schema").ObjectSchema;
|
||||
export type PropertyDefinition = $eslintobjectschema.PropertyDefinition;
|
||||
export type ObjectDefinition = $eslintobjectschema.ObjectDefinition;
|
||||
export type ConfigObject = $typests.ConfigObject;
|
||||
export type IMinimatchStatic = minimatch.IMinimatchStatic;
|
||||
export type IMinimatch = minimatch.IMinimatch;
|
||||
export type ObjectSchemaInstance = ObjectSchema;
|
||||
/**
|
||||
* Represents an array of config objects and provides method for working with
|
||||
* those config objects.
|
||||
*/
|
||||
export class ConfigArray extends Array<any> {
|
||||
[x: symbol]: (config: any) => any;
|
||||
/**
|
||||
* Creates a new instance of ConfigArray.
|
||||
* @param {Iterable|Function|Object} configs An iterable yielding config
|
||||
@@ -141,3 +139,7 @@ export namespace ConfigArraySymbol {
|
||||
let finalizeConfig: symbol;
|
||||
let preprocessConfig: symbol;
|
||||
}
|
||||
import type * as $eslintobjectschema from "@eslint/object-schema";
|
||||
import type * as $typests from "./types.cts";
|
||||
import minimatch from 'minimatch';
|
||||
import { ObjectSchema } from '@eslint/object-schema';
|
||||
|
||||
3
node_modules/@eslint/config-array/dist/cjs/std__path/posix.cjs
generated
vendored
3
node_modules/@eslint/config-array/dist/cjs/std__path/posix.cjs
generated
vendored
@@ -1,3 +1,4 @@
|
||||
// @ts-nocheck
|
||||
'use strict';
|
||||
|
||||
// Copyright 2018-2025 the Deno authors. MIT license.
|
||||
@@ -1223,7 +1224,7 @@ const constants = {
|
||||
"(": ")",
|
||||
"[": "]"
|
||||
};
|
||||
const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
|
||||
const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^[\\\]]+\]|\{[^{\\}]+\}|\(\?[:!=][^\\)]+\)|\([^(|]+\|[^\\)]+\))/;
|
||||
if (str === "") {
|
||||
return false;
|
||||
}
|
||||
|
||||
3
node_modules/@eslint/config-array/dist/cjs/std__path/windows.cjs
generated
vendored
3
node_modules/@eslint/config-array/dist/cjs/std__path/windows.cjs
generated
vendored
@@ -1,3 +1,4 @@
|
||||
// @ts-nocheck
|
||||
'use strict';
|
||||
|
||||
// Copyright 2018-2025 the Deno authors. MIT license.
|
||||
@@ -1564,7 +1565,7 @@ const constants = {
|
||||
"(": ")",
|
||||
"[": "]"
|
||||
};
|
||||
const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
|
||||
const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^[\\\]]+\]|\{[^{\\}]+\}|\(\?[:!=][^\\)]+\)|\([^(|]+\|[^\\)]+\))/;
|
||||
if (str === "") {
|
||||
return false;
|
||||
}
|
||||
|
||||
29
node_modules/@eslint/config-array/dist/cjs/types.ts
generated
vendored
29
node_modules/@eslint/config-array/dist/cjs/types.ts
generated
vendored
@@ -1,29 +0,0 @@
|
||||
/**
|
||||
* @fileoverview Types for the config-array package.
|
||||
* @author Nicholas C. Zakas
|
||||
*/
|
||||
|
||||
export interface ConfigObject {
|
||||
/**
|
||||
* The base path for files and ignores.
|
||||
*/
|
||||
basePath?: string;
|
||||
|
||||
/**
|
||||
* The files to include.
|
||||
*/
|
||||
files?: string[];
|
||||
|
||||
/**
|
||||
* The files to exclude.
|
||||
*/
|
||||
ignores?: string[];
|
||||
|
||||
/**
|
||||
* The name of the config object.
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
// may also have any number of other properties
|
||||
[key: string]: unknown;
|
||||
}
|
||||
18
node_modules/@eslint/config-array/dist/esm/index.d.ts
generated
vendored
18
node_modules/@eslint/config-array/dist/esm/index.d.ts
generated
vendored
@@ -1,17 +1,15 @@
|
||||
export { ObjectSchema } from "@eslint/object-schema";
|
||||
export type PropertyDefinition = import("@eslint/object-schema").PropertyDefinition;
|
||||
export type ObjectDefinition = import("@eslint/object-schema").ObjectDefinition;
|
||||
export type ConfigObject = import("./types.ts").ConfigObject;
|
||||
export type IMinimatchStatic = import("minimatch").IMinimatchStatic;
|
||||
export type IMinimatch = import("minimatch").IMinimatch;
|
||||
export type PathImpl = typeof import("@jsr/std__path");
|
||||
export type ObjectSchemaInstance = import("@eslint/object-schema").ObjectSchema;
|
||||
export type PropertyDefinition = $eslintobjectschema.PropertyDefinition;
|
||||
export type ObjectDefinition = $eslintobjectschema.ObjectDefinition;
|
||||
export type ConfigObject = $typests.ConfigObject;
|
||||
export type IMinimatchStatic = minimatch.IMinimatchStatic;
|
||||
export type IMinimatch = minimatch.IMinimatch;
|
||||
export type ObjectSchemaInstance = ObjectSchema;
|
||||
/**
|
||||
* Represents an array of config objects and provides method for working with
|
||||
* those config objects.
|
||||
*/
|
||||
export class ConfigArray extends Array<any> {
|
||||
[x: symbol]: (config: any) => any;
|
||||
/**
|
||||
* Creates a new instance of ConfigArray.
|
||||
* @param {Iterable|Function|Object} configs An iterable yielding config
|
||||
@@ -141,3 +139,7 @@ export namespace ConfigArraySymbol {
|
||||
let finalizeConfig: symbol;
|
||||
let preprocessConfig: symbol;
|
||||
}
|
||||
import type * as $eslintobjectschema from "@eslint/object-schema";
|
||||
import type * as $typests from "./types.ts";
|
||||
import minimatch from 'minimatch';
|
||||
import { ObjectSchema } from '@eslint/object-schema';
|
||||
|
||||
23
node_modules/@eslint/config-array/dist/esm/index.js
generated
vendored
23
node_modules/@eslint/config-array/dist/esm/index.js
generated
vendored
@@ -15,8 +15,9 @@ export { ObjectSchema } from '@eslint/object-schema';
|
||||
// Types
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @typedef {import("@eslint/object-schema").PropertyDefinition} PropertyDefinition */
|
||||
/** @typedef {import("@eslint/object-schema").ObjectDefinition} ObjectDefinition */
|
||||
/** @import * as $eslintobjectschema from "@eslint/object-schema"; */
|
||||
/** @typedef {$eslintobjectschema.PropertyDefinition} PropertyDefinition */
|
||||
/** @typedef {$eslintobjectschema.ObjectDefinition} ObjectDefinition */
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
@@ -180,10 +181,12 @@ const filesAndIgnoresSchema = Object.freeze({
|
||||
// Types
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @typedef {import("./types.ts").ConfigObject} ConfigObject */
|
||||
/** @typedef {import("minimatch").IMinimatchStatic} IMinimatchStatic */
|
||||
/** @typedef {import("minimatch").IMinimatch} IMinimatch */
|
||||
/** @typedef {import("@jsr/std__path")} PathImpl */
|
||||
/** @import * as $typests from "./types.ts"; */
|
||||
/** @typedef {$typests.ConfigObject} ConfigObject */
|
||||
/** @import * as $minimatch from "minimatch"; */
|
||||
/** @typedef {$minimatch.IMinimatchStatic} IMinimatchStatic */
|
||||
/** @typedef {$minimatch.IMinimatch} IMinimatch */
|
||||
/** @import * as PathImpl from "@jsr/std__path" */
|
||||
|
||||
/*
|
||||
* This is a bit of a hack to make TypeScript happy with the Rollup-created
|
||||
@@ -192,7 +195,7 @@ const filesAndIgnoresSchema = Object.freeze({
|
||||
* for `ObjectSchema`. To work around that, we just import the type manually
|
||||
* and give it a different name to use in the JSDoc comments.
|
||||
*/
|
||||
/** @typedef {import("@eslint/object-schema").ObjectSchema} ObjectSchemaInstance */
|
||||
/** @typedef {ObjectSchema} ObjectSchemaInstance */
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
@@ -1126,7 +1129,8 @@ class ConfigArray extends Array {
|
||||
* @param {Object} config The config to finalize.
|
||||
* @returns {Object} The finalized config.
|
||||
*/
|
||||
[ConfigArraySymbol.finalizeConfig](config) {
|
||||
// Cast key to `never` to prevent TypeScript from adding the signature `[x: symbol]: (config: any) => any` to the type of the class.
|
||||
[/** @type {never} */ (ConfigArraySymbol.finalizeConfig)](config) {
|
||||
return config;
|
||||
}
|
||||
|
||||
@@ -1138,7 +1142,8 @@ class ConfigArray extends Array {
|
||||
* @param {Object} config The config to preprocess.
|
||||
* @returns {Object} The config to use in place of the argument.
|
||||
*/
|
||||
[ConfigArraySymbol.preprocessConfig](config) {
|
||||
// Cast key to `never` to prevent TypeScript from adding the signature `[x: symbol]: (config: any) => any` to the type of the class.
|
||||
[/** @type {never} */ (ConfigArraySymbol.preprocessConfig)](config) {
|
||||
return config;
|
||||
}
|
||||
|
||||
|
||||
3
node_modules/@eslint/config-array/dist/esm/std__path/posix.js
generated
vendored
3
node_modules/@eslint/config-array/dist/esm/std__path/posix.js
generated
vendored
@@ -1,3 +1,4 @@
|
||||
// @ts-nocheck
|
||||
// Copyright 2018-2025 the Deno authors. MIT license.
|
||||
// Copyright the Browserify authors. MIT License.
|
||||
function assertPath(path) {
|
||||
@@ -1221,7 +1222,7 @@ const constants = {
|
||||
"(": ")",
|
||||
"[": "]"
|
||||
};
|
||||
const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
|
||||
const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^[\\\]]+\]|\{[^{\\}]+\}|\(\?[:!=][^\\)]+\)|\([^(|]+\|[^\\)]+\))/;
|
||||
if (str === "") {
|
||||
return false;
|
||||
}
|
||||
|
||||
3
node_modules/@eslint/config-array/dist/esm/std__path/windows.js
generated
vendored
3
node_modules/@eslint/config-array/dist/esm/std__path/windows.js
generated
vendored
@@ -1,3 +1,4 @@
|
||||
// @ts-nocheck
|
||||
// Copyright 2018-2025 the Deno authors. MIT license.
|
||||
// Copyright the Browserify authors. MIT License.
|
||||
function assertPath(path) {
|
||||
@@ -1562,7 +1563,7 @@ const constants = {
|
||||
"(": ")",
|
||||
"[": "]"
|
||||
};
|
||||
const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
|
||||
const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^[\\\]]+\]|\{[^{\\}]+\}|\(\?[:!=][^\\)]+\)|\([^(|]+\|[^\\)]+\))/;
|
||||
if (str === "") {
|
||||
return false;
|
||||
}
|
||||
|
||||
11
node_modules/@eslint/config-array/package.json
generated
vendored
11
node_modules/@eslint/config-array/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@eslint/config-array",
|
||||
"version": "0.21.0",
|
||||
"version": "0.21.1",
|
||||
"description": "General purpose glob-based configuration matching.",
|
||||
"author": "Nicholas C. Zakas",
|
||||
"type": "module",
|
||||
@@ -36,10 +36,11 @@
|
||||
"build:cts": "node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts",
|
||||
"build:std__path": "rollup -c rollup.std__path-config.js && node fix-std__path-imports",
|
||||
"build": "rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:cts && npm run build:std__path",
|
||||
"test:jsr": "npx jsr@latest publish --dry-run",
|
||||
"pretest": "npm run build",
|
||||
"test": "mocha tests/",
|
||||
"test:coverage": "c8 npm test"
|
||||
"test": "mocha \"tests/**/*.test.js\"",
|
||||
"test:coverage": "c8 npm test",
|
||||
"test:jsr": "npx jsr@latest publish --dry-run",
|
||||
"test:types": "tsc -p tests/types/tsconfig.json"
|
||||
},
|
||||
"keywords": [
|
||||
"configuration",
|
||||
@@ -48,7 +49,7 @@
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@eslint/object-schema": "^2.1.6",
|
||||
"@eslint/object-schema": "^2.1.7",
|
||||
"debug": "^4.3.1",
|
||||
"minimatch": "^3.1.2"
|
||||
},
|
||||
|
||||
2
node_modules/@eslint/config-helpers/README.md
generated
vendored
2
node_modules/@eslint/config-helpers/README.md
generated
vendored
@@ -90,7 +90,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).
|
||||
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="128"></a></p><h3>Gold Sponsors</h3>
|
||||
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://trunk.io/"><img src="https://images.opencollective.com/trunkio/fb92d60/avatar.png" alt="trunk.io" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a></p><h3>Silver Sponsors</h3>
|
||||
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/e6d15e1/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301" alt="American Express" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
|
||||
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="LambdaTest" height="32"></a></p>
|
||||
<p><a href="https://syntax.fm"><img src="https://github.com/syntaxfm.png" alt="Syntax" height="32"></a> <a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://sentry.io"><img src="https://github.com/getsentry.png" alt="Sentry" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="LambdaTest" height="32"></a></p>
|
||||
<h3>Technology Sponsors</h3>
|
||||
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
|
||||
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
|
||||
|
||||
67
node_modules/@eslint/config-helpers/dist/cjs/index.cjs
generated
vendored
67
node_modules/@eslint/config-helpers/dist/cjs/index.cjs
generated
vendored
@@ -9,15 +9,17 @@
|
||||
// Type Definitions
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/** @typedef {import("eslint").Linter.Config} Config */
|
||||
/** @typedef {import("eslint").Linter.LegacyConfig} LegacyConfig */
|
||||
/** @typedef {import("eslint").ESLint.Plugin} Plugin */
|
||||
/** @typedef {import("eslint").Linter.RuleEntry} RuleEntry */
|
||||
/** @typedef {import("./types.ts").ExtendsElement} ExtendsElement */
|
||||
/** @typedef {import("./types.ts").SimpleExtendsElement} SimpleExtendsElement */
|
||||
/** @typedef {import("./types.ts").ConfigWithExtends} ConfigWithExtends */
|
||||
/** @typedef {import("./types.ts").InfiniteArray<Config>} InfiniteConfigArray */
|
||||
/** @typedef {import("./types.ts").ConfigWithExtendsArray} ConfigWithExtendsArray */
|
||||
/** @import * as $eslintcore from "@eslint/core"; */
|
||||
/** @typedef {$eslintcore.ConfigObject} Config */
|
||||
/** @typedef {$eslintcore.LegacyConfigObject} LegacyConfig */
|
||||
/** @typedef {$eslintcore.Plugin} Plugin */
|
||||
/** @typedef {$eslintcore.RuleConfig} RuleConfig */
|
||||
/** @import * as $typests from "./types.ts"; */
|
||||
/** @typedef {$typests.ExtendsElement} ExtendsElement */
|
||||
/** @typedef {$typests.SimpleExtendsElement} SimpleExtendsElement */
|
||||
/** @typedef {$typests.ConfigWithExtends} ConfigWithExtends */
|
||||
/** @typedef {$typests.InfiniteArray<Config>} InfiniteConfigArray */
|
||||
/** @typedef {$typests.ConfigWithExtendsArray} ConfigWithExtendsArray */
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Helpers
|
||||
@@ -76,6 +78,11 @@ function getExtensionName(extension, indexPath) {
|
||||
* @return {config is LegacyConfig} `true` if the config object is a legacy config.
|
||||
*/
|
||||
function isLegacyConfig(config) {
|
||||
// eslintrc's plugins must be an array; while flat config's must be an object.
|
||||
if (Array.isArray(config.plugins)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (const key of eslintrcKeys) {
|
||||
if (key in config) {
|
||||
return true;
|
||||
@@ -155,7 +162,7 @@ function normalizePluginConfig(userNamespace, plugin, config) {
|
||||
if (result.rules) {
|
||||
const ruleIds = Object.keys(result.rules);
|
||||
|
||||
/** @type {Record<string,RuleEntry|undefined>} */
|
||||
/** @type {Record<string,RuleConfig|undefined>} */
|
||||
const newRules = {};
|
||||
|
||||
for (let i = 0; i < ruleIds.length; i++) {
|
||||
@@ -253,6 +260,8 @@ function findPluginConfig(config, pluginConfigName) {
|
||||
}
|
||||
|
||||
const directConfig = plugin.configs?.[configName];
|
||||
|
||||
// Prefer direct config, but fall back to flat config if available
|
||||
if (directConfig) {
|
||||
// Arrays are always flat configs, and non-legacy configs can be used directly
|
||||
if (Array.isArray(directConfig) || !isLegacyConfig(directConfig)) {
|
||||
@@ -263,30 +272,28 @@ function findPluginConfig(config, pluginConfigName) {
|
||||
pluginConfigName,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// If it's a legacy config, look for the flat version
|
||||
const flatConfig = plugin.configs?.[`flat/${configName}`];
|
||||
|
||||
if (
|
||||
flatConfig &&
|
||||
(Array.isArray(flatConfig) || !isLegacyConfig(flatConfig))
|
||||
) {
|
||||
return deepNormalizePluginConfig(
|
||||
userPluginNamespace,
|
||||
plugin,
|
||||
flatConfig,
|
||||
pluginConfigName,
|
||||
);
|
||||
}
|
||||
|
||||
throw new TypeError(
|
||||
`Plugin config "${configName}" in plugin "${userPluginNamespace}" is an eslintrc config and cannot be used in this context.`,
|
||||
// If it's a legacy config, or the config does not exist => look for the flat version
|
||||
const flatConfig = plugin.configs?.[`flat/${configName}`];
|
||||
if (
|
||||
flatConfig &&
|
||||
(Array.isArray(flatConfig) || !isLegacyConfig(flatConfig))
|
||||
) {
|
||||
return deepNormalizePluginConfig(
|
||||
userPluginNamespace,
|
||||
plugin,
|
||||
flatConfig,
|
||||
pluginConfigName,
|
||||
);
|
||||
}
|
||||
|
||||
throw new TypeError(
|
||||
`Plugin config "${configName}" not found in plugin "${userPluginNamespace}".`,
|
||||
);
|
||||
// If we get here, then the config was either not found or is a legacy config
|
||||
const message =
|
||||
directConfig || flatConfig
|
||||
? `Plugin config "${configName}" in plugin "${userPluginNamespace}" is an eslintrc config and cannot be used in this context.`
|
||||
: `Plugin config "${configName}" not found in plugin "${userPluginNamespace}".`;
|
||||
throw new TypeError(message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
20
node_modules/@eslint/config-helpers/dist/cjs/index.d.cts
generated
vendored
20
node_modules/@eslint/config-helpers/dist/cjs/index.d.cts
generated
vendored
@@ -1,12 +1,12 @@
|
||||
export type Config = import("eslint").Linter.Config;
|
||||
export type LegacyConfig = import("eslint").Linter.LegacyConfig;
|
||||
export type Plugin = import("eslint").ESLint.Plugin;
|
||||
export type RuleEntry = import("eslint").Linter.RuleEntry;
|
||||
export type ExtendsElement = import("./types.cts").ExtendsElement;
|
||||
export type SimpleExtendsElement = import("./types.cts").SimpleExtendsElement;
|
||||
export type ConfigWithExtends = import("./types.cts").ConfigWithExtends;
|
||||
export type InfiniteConfigArray = import("./types.cts").InfiniteArray<Config>;
|
||||
export type ConfigWithExtendsArray = import("./types.cts").ConfigWithExtendsArray;
|
||||
export type Config = $eslintcore.ConfigObject;
|
||||
export type LegacyConfig = $eslintcore.LegacyConfigObject;
|
||||
export type Plugin = $eslintcore.Plugin;
|
||||
export type RuleConfig = $eslintcore.RuleConfig;
|
||||
export type ExtendsElement = $typests.ExtendsElement;
|
||||
export type SimpleExtendsElement = $typests.SimpleExtendsElement;
|
||||
export type ConfigWithExtends = $typests.ConfigWithExtends;
|
||||
export type InfiniteConfigArray = $typests.InfiniteArray<Config>;
|
||||
export type ConfigWithExtendsArray = $typests.ConfigWithExtendsArray;
|
||||
/**
|
||||
* Helper function to define a config array.
|
||||
* @param {ConfigWithExtendsArray} args The arguments to the function.
|
||||
@@ -22,3 +22,5 @@ export function defineConfig(...args: ConfigWithExtendsArray): Config[];
|
||||
* @throws {TypeError} If ignorePatterns is not an array or if it is empty.
|
||||
*/
|
||||
export function globalIgnores(ignorePatterns: string[], name?: string): Config;
|
||||
import type * as $eslintcore from "@eslint/core";
|
||||
import type * as $typests from "./types.cts";
|
||||
|
||||
10
node_modules/@eslint/config-helpers/dist/cjs/types.cts
generated
vendored
10
node_modules/@eslint/config-helpers/dist/cjs/types.cts
generated
vendored
@@ -2,7 +2,7 @@
|
||||
* @fileoverview Types for this package.
|
||||
*/
|
||||
|
||||
import type { Linter } from "eslint";
|
||||
import type { ConfigObject } from "@eslint/core";
|
||||
|
||||
/**
|
||||
* Infinite array type.
|
||||
@@ -12,19 +12,17 @@ export type InfiniteArray<T> = T | InfiniteArray<T>[];
|
||||
/**
|
||||
* The type of array element in the `extends` property after flattening.
|
||||
*/
|
||||
export type SimpleExtendsElement = string | Linter.Config;
|
||||
export type SimpleExtendsElement = string | ConfigObject;
|
||||
|
||||
/**
|
||||
* The type of array element in the `extends` property before flattening.
|
||||
*/
|
||||
export type ExtendsElement =
|
||||
| SimpleExtendsElement
|
||||
| InfiniteArray<Linter.Config>;
|
||||
export type ExtendsElement = SimpleExtendsElement | InfiniteArray<ConfigObject>;
|
||||
|
||||
/**
|
||||
* Config with extends. Valid only inside of `defineConfig()`.
|
||||
*/
|
||||
export interface ConfigWithExtends extends Linter.Config {
|
||||
export interface ConfigWithExtends extends ConfigObject {
|
||||
extends?: ExtendsElement[];
|
||||
}
|
||||
|
||||
|
||||
20
node_modules/@eslint/config-helpers/dist/esm/index.d.ts
generated
vendored
20
node_modules/@eslint/config-helpers/dist/esm/index.d.ts
generated
vendored
@@ -1,12 +1,12 @@
|
||||
export type Config = import("eslint").Linter.Config;
|
||||
export type LegacyConfig = import("eslint").Linter.LegacyConfig;
|
||||
export type Plugin = import("eslint").ESLint.Plugin;
|
||||
export type RuleEntry = import("eslint").Linter.RuleEntry;
|
||||
export type ExtendsElement = import("./types.ts").ExtendsElement;
|
||||
export type SimpleExtendsElement = import("./types.ts").SimpleExtendsElement;
|
||||
export type ConfigWithExtends = import("./types.ts").ConfigWithExtends;
|
||||
export type InfiniteConfigArray = import("./types.ts").InfiniteArray<Config>;
|
||||
export type ConfigWithExtendsArray = import("./types.ts").ConfigWithExtendsArray;
|
||||
export type Config = $eslintcore.ConfigObject;
|
||||
export type LegacyConfig = $eslintcore.LegacyConfigObject;
|
||||
export type Plugin = $eslintcore.Plugin;
|
||||
export type RuleConfig = $eslintcore.RuleConfig;
|
||||
export type ExtendsElement = $typests.ExtendsElement;
|
||||
export type SimpleExtendsElement = $typests.SimpleExtendsElement;
|
||||
export type ConfigWithExtends = $typests.ConfigWithExtends;
|
||||
export type InfiniteConfigArray = $typests.InfiniteArray<Config>;
|
||||
export type ConfigWithExtendsArray = $typests.ConfigWithExtendsArray;
|
||||
/**
|
||||
* Helper function to define a config array.
|
||||
* @param {ConfigWithExtendsArray} args The arguments to the function.
|
||||
@@ -22,3 +22,5 @@ export function defineConfig(...args: ConfigWithExtendsArray): Config[];
|
||||
* @throws {TypeError} If ignorePatterns is not an array or if it is empty.
|
||||
*/
|
||||
export function globalIgnores(ignorePatterns: string[], name?: string): Config;
|
||||
import type * as $eslintcore from "@eslint/core";
|
||||
import type * as $typests from "./types.ts";
|
||||
|
||||
67
node_modules/@eslint/config-helpers/dist/esm/index.js
generated
vendored
67
node_modules/@eslint/config-helpers/dist/esm/index.js
generated
vendored
@@ -8,15 +8,17 @@
|
||||
// Type Definitions
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/** @typedef {import("eslint").Linter.Config} Config */
|
||||
/** @typedef {import("eslint").Linter.LegacyConfig} LegacyConfig */
|
||||
/** @typedef {import("eslint").ESLint.Plugin} Plugin */
|
||||
/** @typedef {import("eslint").Linter.RuleEntry} RuleEntry */
|
||||
/** @typedef {import("./types.ts").ExtendsElement} ExtendsElement */
|
||||
/** @typedef {import("./types.ts").SimpleExtendsElement} SimpleExtendsElement */
|
||||
/** @typedef {import("./types.ts").ConfigWithExtends} ConfigWithExtends */
|
||||
/** @typedef {import("./types.ts").InfiniteArray<Config>} InfiniteConfigArray */
|
||||
/** @typedef {import("./types.ts").ConfigWithExtendsArray} ConfigWithExtendsArray */
|
||||
/** @import * as $eslintcore from "@eslint/core"; */
|
||||
/** @typedef {$eslintcore.ConfigObject} Config */
|
||||
/** @typedef {$eslintcore.LegacyConfigObject} LegacyConfig */
|
||||
/** @typedef {$eslintcore.Plugin} Plugin */
|
||||
/** @typedef {$eslintcore.RuleConfig} RuleConfig */
|
||||
/** @import * as $typests from "./types.ts"; */
|
||||
/** @typedef {$typests.ExtendsElement} ExtendsElement */
|
||||
/** @typedef {$typests.SimpleExtendsElement} SimpleExtendsElement */
|
||||
/** @typedef {$typests.ConfigWithExtends} ConfigWithExtends */
|
||||
/** @typedef {$typests.InfiniteArray<Config>} InfiniteConfigArray */
|
||||
/** @typedef {$typests.ConfigWithExtendsArray} ConfigWithExtendsArray */
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Helpers
|
||||
@@ -75,6 +77,11 @@ function getExtensionName(extension, indexPath) {
|
||||
* @return {config is LegacyConfig} `true` if the config object is a legacy config.
|
||||
*/
|
||||
function isLegacyConfig(config) {
|
||||
// eslintrc's plugins must be an array; while flat config's must be an object.
|
||||
if (Array.isArray(config.plugins)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (const key of eslintrcKeys) {
|
||||
if (key in config) {
|
||||
return true;
|
||||
@@ -154,7 +161,7 @@ function normalizePluginConfig(userNamespace, plugin, config) {
|
||||
if (result.rules) {
|
||||
const ruleIds = Object.keys(result.rules);
|
||||
|
||||
/** @type {Record<string,RuleEntry|undefined>} */
|
||||
/** @type {Record<string,RuleConfig|undefined>} */
|
||||
const newRules = {};
|
||||
|
||||
for (let i = 0; i < ruleIds.length; i++) {
|
||||
@@ -252,6 +259,8 @@ function findPluginConfig(config, pluginConfigName) {
|
||||
}
|
||||
|
||||
const directConfig = plugin.configs?.[configName];
|
||||
|
||||
// Prefer direct config, but fall back to flat config if available
|
||||
if (directConfig) {
|
||||
// Arrays are always flat configs, and non-legacy configs can be used directly
|
||||
if (Array.isArray(directConfig) || !isLegacyConfig(directConfig)) {
|
||||
@@ -262,30 +271,28 @@ function findPluginConfig(config, pluginConfigName) {
|
||||
pluginConfigName,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// If it's a legacy config, look for the flat version
|
||||
const flatConfig = plugin.configs?.[`flat/${configName}`];
|
||||
|
||||
if (
|
||||
flatConfig &&
|
||||
(Array.isArray(flatConfig) || !isLegacyConfig(flatConfig))
|
||||
) {
|
||||
return deepNormalizePluginConfig(
|
||||
userPluginNamespace,
|
||||
plugin,
|
||||
flatConfig,
|
||||
pluginConfigName,
|
||||
);
|
||||
}
|
||||
|
||||
throw new TypeError(
|
||||
`Plugin config "${configName}" in plugin "${userPluginNamespace}" is an eslintrc config and cannot be used in this context.`,
|
||||
// If it's a legacy config, or the config does not exist => look for the flat version
|
||||
const flatConfig = plugin.configs?.[`flat/${configName}`];
|
||||
if (
|
||||
flatConfig &&
|
||||
(Array.isArray(flatConfig) || !isLegacyConfig(flatConfig))
|
||||
) {
|
||||
return deepNormalizePluginConfig(
|
||||
userPluginNamespace,
|
||||
plugin,
|
||||
flatConfig,
|
||||
pluginConfigName,
|
||||
);
|
||||
}
|
||||
|
||||
throw new TypeError(
|
||||
`Plugin config "${configName}" not found in plugin "${userPluginNamespace}".`,
|
||||
);
|
||||
// If we get here, then the config was either not found or is a legacy config
|
||||
const message =
|
||||
directConfig || flatConfig
|
||||
? `Plugin config "${configName}" in plugin "${userPluginNamespace}" is an eslintrc config and cannot be used in this context.`
|
||||
: `Plugin config "${configName}" not found in plugin "${userPluginNamespace}".`;
|
||||
throw new TypeError(message);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
8
node_modules/@eslint/config-helpers/dist/esm/types.d.ts
generated
vendored
8
node_modules/@eslint/config-helpers/dist/esm/types.d.ts
generated
vendored
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @fileoverview Types for this package.
|
||||
*/
|
||||
import type { Linter } from "eslint";
|
||||
import type { ConfigObject } from "@eslint/core";
|
||||
/**
|
||||
* Infinite array type.
|
||||
*/
|
||||
@@ -9,15 +9,15 @@ export type InfiniteArray<T> = T | InfiniteArray<T>[];
|
||||
/**
|
||||
* The type of array element in the `extends` property after flattening.
|
||||
*/
|
||||
export type SimpleExtendsElement = string | Linter.Config;
|
||||
export type SimpleExtendsElement = string | ConfigObject;
|
||||
/**
|
||||
* The type of array element in the `extends` property before flattening.
|
||||
*/
|
||||
export type ExtendsElement = SimpleExtendsElement | InfiniteArray<Linter.Config>;
|
||||
export type ExtendsElement = SimpleExtendsElement | InfiniteArray<ConfigObject>;
|
||||
/**
|
||||
* Config with extends. Valid only inside of `defineConfig()`.
|
||||
*/
|
||||
export interface ConfigWithExtends extends Linter.Config {
|
||||
export interface ConfigWithExtends extends ConfigObject {
|
||||
extends?: ExtendsElement[];
|
||||
}
|
||||
export type ConfigWithExtendsArray = InfiniteArray<ConfigWithExtends>[];
|
||||
|
||||
10
node_modules/@eslint/config-helpers/dist/esm/types.ts
generated
vendored
10
node_modules/@eslint/config-helpers/dist/esm/types.ts
generated
vendored
@@ -2,7 +2,7 @@
|
||||
* @fileoverview Types for this package.
|
||||
*/
|
||||
|
||||
import type { Linter } from "eslint";
|
||||
import type { ConfigObject } from "@eslint/core";
|
||||
|
||||
/**
|
||||
* Infinite array type.
|
||||
@@ -12,19 +12,17 @@ export type InfiniteArray<T> = T | InfiniteArray<T>[];
|
||||
/**
|
||||
* The type of array element in the `extends` property after flattening.
|
||||
*/
|
||||
export type SimpleExtendsElement = string | Linter.Config;
|
||||
export type SimpleExtendsElement = string | ConfigObject;
|
||||
|
||||
/**
|
||||
* The type of array element in the `extends` property before flattening.
|
||||
*/
|
||||
export type ExtendsElement =
|
||||
| SimpleExtendsElement
|
||||
| InfiniteArray<Linter.Config>;
|
||||
export type ExtendsElement = SimpleExtendsElement | InfiniteArray<ConfigObject>;
|
||||
|
||||
/**
|
||||
* Config with extends. Valid only inside of `defineConfig()`.
|
||||
*/
|
||||
export interface ConfigWithExtends extends Linter.Config {
|
||||
export interface ConfigWithExtends extends ConfigObject {
|
||||
extends?: ExtendsElement[];
|
||||
}
|
||||
|
||||
|
||||
11
node_modules/@eslint/config-helpers/package.json
generated
vendored
11
node_modules/@eslint/config-helpers/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@eslint/config-helpers",
|
||||
"version": "0.3.1",
|
||||
"version": "0.4.2",
|
||||
"description": "Helper utilities for creating ESLint configuration",
|
||||
"type": "module",
|
||||
"main": "dist/esm/index.js",
|
||||
@@ -28,9 +28,10 @@
|
||||
"build:dedupe-types": "node ../../tools/dedupe-types.js dist/cjs/index.cjs dist/esm/index.js",
|
||||
"build:cts": "node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts",
|
||||
"build": "rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:cts",
|
||||
"test:jsr": "npx jsr@latest publish --dry-run",
|
||||
"test": "mocha tests/*.js",
|
||||
"test": "mocha \"tests/**/*.test.js\"",
|
||||
"test:coverage": "c8 npm test",
|
||||
"test:jsr": "npx jsr@latest publish --dry-run",
|
||||
"test:pnpm": "cd tests/pnpm && pnpm install && pnpm exec tsc",
|
||||
"test:types": "tsc -p tests/types/tsconfig.json"
|
||||
},
|
||||
"repository": {
|
||||
@@ -46,8 +47,10 @@
|
||||
"url": "https://github.com/eslint/rewrite/issues"
|
||||
},
|
||||
"homepage": "https://github.com/eslint/rewrite/tree/main/packages/config-helpers#readme",
|
||||
"dependencies": {
|
||||
"@eslint/core": "^0.17.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/core": "^0.15.2",
|
||||
"eslint": "^9.27.0",
|
||||
"rollup-plugin-copy": "^3.5.0"
|
||||
},
|
||||
|
||||
2
node_modules/@eslint/core/README.md
generated
vendored
2
node_modules/@eslint/core/README.md
generated
vendored
@@ -22,7 +22,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).
|
||||
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="128"></a></p><h3>Gold Sponsors</h3>
|
||||
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://trunk.io/"><img src="https://images.opencollective.com/trunkio/fb92d60/avatar.png" alt="trunk.io" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a></p><h3>Silver Sponsors</h3>
|
||||
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/e6d15e1/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301" alt="American Express" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
|
||||
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="LambdaTest" height="32"></a></p>
|
||||
<p><a href="https://syntax.fm"><img src="https://github.com/syntaxfm.png" alt="Syntax" height="32"></a> <a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://sentry.io"><img src="https://github.com/getsentry.png" alt="Sentry" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="LambdaTest" height="32"></a></p>
|
||||
<h3>Technology Sponsors</h3>
|
||||
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
|
||||
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
|
||||
|
||||
360
node_modules/@eslint/core/dist/cjs/types.d.cts
generated
vendored
360
node_modules/@eslint/core/dist/cjs/types.d.cts
generated
vendored
@@ -117,7 +117,7 @@ export interface RulesMeta<MessageIds extends string = string, RuleOptions = unk
|
||||
schema?: JSONSchema4 | JSONSchema4[] | false | undefined;
|
||||
/**
|
||||
* Any default options to be recursively merged on top of any user-provided options.
|
||||
**/
|
||||
*/
|
||||
defaultOptions?: RuleOptions;
|
||||
/**
|
||||
* The messages that the rule can report.
|
||||
@@ -371,17 +371,12 @@ export interface RuleTextEdit {
|
||||
* @param fixer The text editor to apply the fix.
|
||||
* @returns The fix(es) for the violation.
|
||||
*/
|
||||
type RuleFixer = (fixer: RuleTextEditor) => RuleTextEdit | Iterable<RuleTextEdit> | null;
|
||||
interface ViolationReportBase {
|
||||
/**
|
||||
* The type of node that the violation is for.
|
||||
* @deprecated May be removed in the future.
|
||||
*/
|
||||
nodeType?: string | undefined;
|
||||
export type RuleFixer = (fixer: RuleTextEditor) => RuleTextEdit | Iterable<RuleTextEdit> | null;
|
||||
export interface ViolationReportBase {
|
||||
/**
|
||||
* The data to insert into the message.
|
||||
*/
|
||||
data?: Record<string, string> | undefined;
|
||||
data?: Record<string, unknown> | undefined;
|
||||
/**
|
||||
* The fix to be applied for the violation.
|
||||
*/
|
||||
@@ -392,28 +387,28 @@ interface ViolationReportBase {
|
||||
*/
|
||||
suggest?: SuggestedEdit[] | null | undefined;
|
||||
}
|
||||
type ViolationMessage<MessageIds = string> = {
|
||||
export type ViolationMessage<MessageIds = string> = {
|
||||
message: string;
|
||||
} | {
|
||||
messageId: MessageIds;
|
||||
};
|
||||
type ViolationLocation<Node> = {
|
||||
export type ViolationLocation<Node> = {
|
||||
loc: SourceLocation | Position;
|
||||
} | {
|
||||
node: Node;
|
||||
};
|
||||
export type ViolationReport<Node = unknown, MessageIds = string> = ViolationReportBase & ViolationMessage<MessageIds> & ViolationLocation<Node>;
|
||||
interface SuggestedEditBase {
|
||||
export interface SuggestedEditBase {
|
||||
/**
|
||||
* The data to insert into the message.
|
||||
*/
|
||||
data?: Record<string, string> | undefined;
|
||||
data?: Record<string, unknown> | undefined;
|
||||
/**
|
||||
* The fix to be applied for the suggestion.
|
||||
*/
|
||||
fix?: RuleFixer | null | undefined;
|
||||
fix: RuleFixer;
|
||||
}
|
||||
type SuggestionMessage = {
|
||||
export type SuggestionMessage = {
|
||||
desc: string;
|
||||
} | {
|
||||
messageId: string;
|
||||
@@ -422,6 +417,49 @@ type SuggestionMessage = {
|
||||
* A suggested edit for a rule violation.
|
||||
*/
|
||||
export type SuggestedEdit = SuggestedEditBase & SuggestionMessage;
|
||||
/**
|
||||
* The normalized version of a lint suggestion.
|
||||
*/
|
||||
export interface LintSuggestion {
|
||||
/** A short description. */
|
||||
desc: string;
|
||||
/** Fix result info. */
|
||||
fix: RuleTextEdit;
|
||||
/** Id referencing a message for the description. */
|
||||
messageId?: string | undefined;
|
||||
}
|
||||
/**
|
||||
* The normalized version of a lint violation message.
|
||||
*/
|
||||
export interface LintMessage {
|
||||
/** The 1-based column number. */
|
||||
column: number;
|
||||
/** The 1-based line number. */
|
||||
line: number;
|
||||
/** The 1-based column number of the end location. */
|
||||
endColumn?: number | undefined;
|
||||
/** The 1-based line number of the end location. */
|
||||
endLine?: number | undefined;
|
||||
/** The ID of the rule which makes this message. */
|
||||
ruleId: string | null;
|
||||
/** The reported message. */
|
||||
message: string;
|
||||
/** The ID of the message in the rule's meta. */
|
||||
messageId?: string | undefined;
|
||||
/**
|
||||
* Type of node.
|
||||
* @deprecated `nodeType` is deprecated and will be removed in the next major version.
|
||||
*/
|
||||
nodeType?: string | undefined;
|
||||
/** If `true` then this is a fatal error. */
|
||||
fatal?: true | undefined;
|
||||
/** The severity of this message. */
|
||||
severity: Exclude<SeverityLevel, 0>;
|
||||
/** Information for autofix. */
|
||||
fix?: RuleTextEdit | undefined;
|
||||
/** Information for suggestions. */
|
||||
suggestions?: LintSuggestion[] | undefined;
|
||||
}
|
||||
/**
|
||||
* Generic options for the `RuleDefinition` type.
|
||||
*/
|
||||
@@ -498,6 +536,19 @@ export type SeverityLevel = 0 | 1 | 2;
|
||||
* The severity of a rule in a configuration.
|
||||
*/
|
||||
export type Severity = SeverityName | SeverityLevel;
|
||||
/**
|
||||
* Represents the metadata for an object, such as a plugin or processor.
|
||||
*/
|
||||
export interface ObjectMetaProperties {
|
||||
/** @deprecated Use `meta.name` instead. */
|
||||
name?: string | undefined;
|
||||
/** @deprecated Use `meta.version` instead. */
|
||||
version?: string | undefined;
|
||||
meta?: {
|
||||
name?: string | undefined;
|
||||
version?: string | undefined;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Represents the configuration options for the core linter.
|
||||
*/
|
||||
@@ -532,6 +583,285 @@ export interface RulesConfig {
|
||||
export interface SettingsConfig {
|
||||
[key: string]: unknown;
|
||||
}
|
||||
/**
|
||||
* The configuration for a set of files.
|
||||
*/
|
||||
export interface ConfigObject<Rules extends RulesConfig = RulesConfig> {
|
||||
/**
|
||||
* A string to identify the configuration object. Used in error messages and
|
||||
* inspection tools.
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Path to the directory where the configuration object should apply.
|
||||
* `files` and `ignores` patterns in the configuration object are
|
||||
* interpreted as relative to this path.
|
||||
*/
|
||||
basePath?: string;
|
||||
/**
|
||||
* An array of glob patterns indicating the files that the configuration
|
||||
* object should apply to. If not specified, the configuration object applies
|
||||
* to all files
|
||||
*/
|
||||
files?: (string | string[])[];
|
||||
/**
|
||||
* An array of glob patterns indicating the files that the configuration
|
||||
* object should not apply to. If not specified, the configuration object
|
||||
* applies to all files matched by files
|
||||
*/
|
||||
ignores?: string[];
|
||||
/**
|
||||
* The name of the language used for linting. This is used to determine the
|
||||
* parser and other language-specific settings.
|
||||
* @since 9.7.0
|
||||
*/
|
||||
language?: string;
|
||||
/**
|
||||
* An object containing settings related to how the language is configured for
|
||||
* linting.
|
||||
*/
|
||||
languageOptions?: LanguageOptions;
|
||||
/**
|
||||
* An object containing settings related to the linting process
|
||||
*/
|
||||
linterOptions?: LinterOptionsConfig;
|
||||
/**
|
||||
* Either an object containing preprocess() and postprocess() methods or a
|
||||
* string indicating the name of a processor inside of a plugin
|
||||
* (i.e., "pluginName/processorName").
|
||||
*/
|
||||
processor?: string | Processor;
|
||||
/**
|
||||
* An object containing a name-value mapping of plugin names to plugin objects.
|
||||
* When files is specified, these plugins are only available to the matching files.
|
||||
*/
|
||||
plugins?: Record<string, Plugin>;
|
||||
/**
|
||||
* An object containing the configured rules. When files or ignores are specified,
|
||||
* these rule configurations are only available to the matching files.
|
||||
*/
|
||||
rules?: Partial<Rules>;
|
||||
/**
|
||||
* An object containing name-value pairs of information that should be
|
||||
* available to all rules.
|
||||
*/
|
||||
settings?: Record<string, unknown>;
|
||||
}
|
||||
/** @deprecated Only supported in legacy eslintrc config format. */
|
||||
export type GlobalAccess = boolean | "off" | "readable" | "readonly" | "writable" | "writeable";
|
||||
/** @deprecated Only supported in legacy eslintrc config format. */
|
||||
export interface GlobalsConfig {
|
||||
[name: string]: GlobalAccess;
|
||||
}
|
||||
/**
|
||||
* The ECMAScript version of the code being linted.
|
||||
* @deprecated Only supported in legacy eslintrc config format.
|
||||
*/
|
||||
export type EcmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 2026 | "latest";
|
||||
/**
|
||||
* The type of JavaScript source code.
|
||||
* @deprecated Only supported in legacy eslintrc config format.
|
||||
*/
|
||||
export type JavaScriptSourceType = "script" | "module" | "commonjs";
|
||||
/**
|
||||
* Parser options.
|
||||
* @deprecated Only supported in legacy eslintrc config format.
|
||||
* @see [Specifying Parser Options](https://eslint.org/docs/latest/use/configure/language-options#specifying-parser-options)
|
||||
*/
|
||||
export interface JavaScriptParserOptionsConfig {
|
||||
/**
|
||||
* Allow the use of reserved words as identifiers (if `ecmaVersion` is 3).
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
allowReserved?: boolean | undefined;
|
||||
/**
|
||||
* Accepts any valid ECMAScript version number or `'latest'`:
|
||||
*
|
||||
* - A version: es3, es5, es6, es7, es8, es9, es10, es11, es12, es13, es14, ..., or
|
||||
* - A year: es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, ..., or
|
||||
* - `'latest'`
|
||||
*
|
||||
* When it's a version or a year, the value must be a number - so do not include the `es` prefix.
|
||||
*
|
||||
* Specifies the version of ECMAScript syntax you want to use. This is used by the parser to determine how to perform scope analysis, and it affects the default
|
||||
*
|
||||
* @default 5
|
||||
*/
|
||||
ecmaVersion?: EcmaVersion | undefined;
|
||||
/**
|
||||
* The type of JavaScript source code. Possible values are "script" for
|
||||
* traditional script files, "module" for ECMAScript modules (ESM), and
|
||||
* "commonjs" for CommonJS files.
|
||||
*
|
||||
* @default 'script'
|
||||
*
|
||||
* @see https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options
|
||||
*/
|
||||
sourceType?: JavaScriptSourceType | undefined;
|
||||
/**
|
||||
* An object indicating which additional language features you'd like to use.
|
||||
*
|
||||
* @see https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options
|
||||
*/
|
||||
ecmaFeatures?: {
|
||||
globalReturn?: boolean | undefined;
|
||||
impliedStrict?: boolean | undefined;
|
||||
jsx?: boolean | undefined;
|
||||
experimentalObjectRestSpread?: boolean | undefined;
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
[key: string]: any;
|
||||
}
|
||||
/** @deprecated Only supported in legacy eslintrc config format. */
|
||||
export interface EnvironmentConfig {
|
||||
/** The definition of global variables. */
|
||||
globals?: GlobalsConfig | undefined;
|
||||
/** The parser options that will be enabled under this environment. */
|
||||
parserOptions?: JavaScriptParserOptionsConfig | undefined;
|
||||
}
|
||||
/**
|
||||
* A configuration object that may have a `rules` block.
|
||||
*/
|
||||
export interface HasRules<Rules extends RulesConfig = RulesConfig> {
|
||||
rules?: Partial<Rules> | undefined;
|
||||
}
|
||||
/**
|
||||
* ESLint legacy configuration.
|
||||
*
|
||||
* @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
|
||||
*/
|
||||
export interface BaseConfig<Rules extends RulesConfig = RulesConfig, OverrideRules extends RulesConfig = Rules> extends HasRules<Rules> {
|
||||
$schema?: string | undefined;
|
||||
/**
|
||||
* An environment provides predefined global variables.
|
||||
*
|
||||
* @see [Environments](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-environments)
|
||||
*/
|
||||
env?: {
|
||||
[name: string]: boolean;
|
||||
} | undefined;
|
||||
/**
|
||||
* Extending configuration files.
|
||||
*
|
||||
* @see [Extends](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#extending-configuration-files)
|
||||
*/
|
||||
extends?: string | string[] | undefined;
|
||||
/**
|
||||
* Specifying globals.
|
||||
*
|
||||
* @see [Globals](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-globals)
|
||||
*/
|
||||
globals?: GlobalsConfig | undefined;
|
||||
/**
|
||||
* Disable processing of inline comments.
|
||||
*
|
||||
* @see [Disabling Inline Comments](https://eslint.org/docs/latest/use/configure/rules-deprecated#disabling-inline-comments)
|
||||
*/
|
||||
noInlineConfig?: boolean | undefined;
|
||||
/**
|
||||
* Overrides can be used to use a differing configuration for matching sub-directories and files.
|
||||
*
|
||||
* @see [How do overrides work](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#how-do-overrides-work)
|
||||
*/
|
||||
overrides?: ConfigOverride<OverrideRules>[] | undefined;
|
||||
/**
|
||||
* Parser.
|
||||
*
|
||||
* @see [Working with Custom Parsers](https://eslint.org/docs/latest/extend/custom-parsers)
|
||||
* @see [Specifying Parser](https://eslint.org/docs/latest/use/configure/parser-deprecated)
|
||||
*/
|
||||
parser?: string | undefined;
|
||||
/**
|
||||
* Parser options.
|
||||
*
|
||||
* @see [Working with Custom Parsers](https://eslint.org/docs/latest/extend/custom-parsers)
|
||||
* @see [Specifying Parser Options](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options)
|
||||
*/
|
||||
parserOptions?: JavaScriptParserOptionsConfig | undefined;
|
||||
/**
|
||||
* Which third-party plugins define additional rules, environments, configs, etc. for ESLint to use.
|
||||
*
|
||||
* @see [Configuring Plugins](https://eslint.org/docs/latest/use/configure/plugins-deprecated#configure-plugins)
|
||||
*/
|
||||
plugins?: string[] | undefined;
|
||||
/**
|
||||
* Specifying processor.
|
||||
*
|
||||
* @see [processor](https://eslint.org/docs/latest/use/configure/plugins-deprecated#specify-a-processor)
|
||||
*/
|
||||
processor?: string | undefined;
|
||||
/**
|
||||
* Report unused eslint-disable comments as warning.
|
||||
*
|
||||
* @see [Report unused eslint-disable comments](https://eslint.org/docs/latest/use/configure/rules-deprecated#report-unused-eslint-disable-comments)
|
||||
*/
|
||||
reportUnusedDisableDirectives?: boolean | undefined;
|
||||
/**
|
||||
* Settings.
|
||||
*
|
||||
* @see [Settings](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#adding-shared-settings)
|
||||
*/
|
||||
settings?: SettingsConfig | undefined;
|
||||
}
|
||||
/**
|
||||
* The overwrites that apply more differing configuration to specific files or directories.
|
||||
*/
|
||||
export interface ConfigOverride<Rules extends RulesConfig = RulesConfig> extends BaseConfig<Rules> {
|
||||
/**
|
||||
* The glob patterns for excluded files.
|
||||
*/
|
||||
excludedFiles?: string | string[] | undefined;
|
||||
/**
|
||||
* The glob patterns for target files.
|
||||
*/
|
||||
files: string | string[];
|
||||
}
|
||||
/**
|
||||
* ESLint legacy configuration.
|
||||
*
|
||||
* @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
|
||||
*/
|
||||
export interface LegacyConfigObject<Rules extends RulesConfig = RulesConfig, OverrideRules extends RulesConfig = Rules> extends BaseConfig<Rules, OverrideRules> {
|
||||
/**
|
||||
* Tell ESLint to ignore specific files and directories.
|
||||
*
|
||||
* @see [Ignore Patterns](https://eslint.org/docs/latest/use/configure/ignore-deprecated#ignorepatterns-in-config-files)
|
||||
*/
|
||||
ignorePatterns?: string | string[] | undefined;
|
||||
/**
|
||||
* @see [Using Configuration Files](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#using-configuration-files)
|
||||
*/
|
||||
root?: boolean | undefined;
|
||||
}
|
||||
/**
|
||||
* File information passed to a processor.
|
||||
*/
|
||||
export interface ProcessorFile {
|
||||
text: string;
|
||||
filename: string;
|
||||
}
|
||||
/**
|
||||
* A processor is an object that can preprocess and postprocess files.
|
||||
*/
|
||||
export interface Processor<T extends string | ProcessorFile = string | ProcessorFile> extends ObjectMetaProperties {
|
||||
/** If `true` then it means the processor supports autofix. */
|
||||
supportsAutofix?: boolean | undefined;
|
||||
/** The function to extract code blocks. */
|
||||
preprocess?(text: string, filename: string): T[];
|
||||
/** The function to merge messages. */
|
||||
postprocess?(messages: LintMessage[][], filename: string): LintMessage[];
|
||||
}
|
||||
export interface Plugin extends ObjectMetaProperties {
|
||||
meta?: ObjectMetaProperties["meta"] & {
|
||||
namespace?: string | undefined;
|
||||
};
|
||||
configs?: Record<string, LegacyConfigObject | ConfigObject | ConfigObject[]> | undefined;
|
||||
environments?: Record<string, EnvironmentConfig> | undefined;
|
||||
languages?: Record<string, Language> | undefined;
|
||||
processors?: Record<string, Processor> | undefined;
|
||||
rules?: Record<string, RuleDefinition> | undefined;
|
||||
}
|
||||
/**
|
||||
* Generic options for the `Language` type.
|
||||
*/
|
||||
|
||||
360
node_modules/@eslint/core/dist/esm/types.d.ts
generated
vendored
360
node_modules/@eslint/core/dist/esm/types.d.ts
generated
vendored
@@ -117,7 +117,7 @@ export interface RulesMeta<MessageIds extends string = string, RuleOptions = unk
|
||||
schema?: JSONSchema4 | JSONSchema4[] | false | undefined;
|
||||
/**
|
||||
* Any default options to be recursively merged on top of any user-provided options.
|
||||
**/
|
||||
*/
|
||||
defaultOptions?: RuleOptions;
|
||||
/**
|
||||
* The messages that the rule can report.
|
||||
@@ -371,17 +371,12 @@ export interface RuleTextEdit {
|
||||
* @param fixer The text editor to apply the fix.
|
||||
* @returns The fix(es) for the violation.
|
||||
*/
|
||||
type RuleFixer = (fixer: RuleTextEditor) => RuleTextEdit | Iterable<RuleTextEdit> | null;
|
||||
interface ViolationReportBase {
|
||||
/**
|
||||
* The type of node that the violation is for.
|
||||
* @deprecated May be removed in the future.
|
||||
*/
|
||||
nodeType?: string | undefined;
|
||||
export type RuleFixer = (fixer: RuleTextEditor) => RuleTextEdit | Iterable<RuleTextEdit> | null;
|
||||
export interface ViolationReportBase {
|
||||
/**
|
||||
* The data to insert into the message.
|
||||
*/
|
||||
data?: Record<string, string> | undefined;
|
||||
data?: Record<string, unknown> | undefined;
|
||||
/**
|
||||
* The fix to be applied for the violation.
|
||||
*/
|
||||
@@ -392,28 +387,28 @@ interface ViolationReportBase {
|
||||
*/
|
||||
suggest?: SuggestedEdit[] | null | undefined;
|
||||
}
|
||||
type ViolationMessage<MessageIds = string> = {
|
||||
export type ViolationMessage<MessageIds = string> = {
|
||||
message: string;
|
||||
} | {
|
||||
messageId: MessageIds;
|
||||
};
|
||||
type ViolationLocation<Node> = {
|
||||
export type ViolationLocation<Node> = {
|
||||
loc: SourceLocation | Position;
|
||||
} | {
|
||||
node: Node;
|
||||
};
|
||||
export type ViolationReport<Node = unknown, MessageIds = string> = ViolationReportBase & ViolationMessage<MessageIds> & ViolationLocation<Node>;
|
||||
interface SuggestedEditBase {
|
||||
export interface SuggestedEditBase {
|
||||
/**
|
||||
* The data to insert into the message.
|
||||
*/
|
||||
data?: Record<string, string> | undefined;
|
||||
data?: Record<string, unknown> | undefined;
|
||||
/**
|
||||
* The fix to be applied for the suggestion.
|
||||
*/
|
||||
fix?: RuleFixer | null | undefined;
|
||||
fix: RuleFixer;
|
||||
}
|
||||
type SuggestionMessage = {
|
||||
export type SuggestionMessage = {
|
||||
desc: string;
|
||||
} | {
|
||||
messageId: string;
|
||||
@@ -422,6 +417,49 @@ type SuggestionMessage = {
|
||||
* A suggested edit for a rule violation.
|
||||
*/
|
||||
export type SuggestedEdit = SuggestedEditBase & SuggestionMessage;
|
||||
/**
|
||||
* The normalized version of a lint suggestion.
|
||||
*/
|
||||
export interface LintSuggestion {
|
||||
/** A short description. */
|
||||
desc: string;
|
||||
/** Fix result info. */
|
||||
fix: RuleTextEdit;
|
||||
/** Id referencing a message for the description. */
|
||||
messageId?: string | undefined;
|
||||
}
|
||||
/**
|
||||
* The normalized version of a lint violation message.
|
||||
*/
|
||||
export interface LintMessage {
|
||||
/** The 1-based column number. */
|
||||
column: number;
|
||||
/** The 1-based line number. */
|
||||
line: number;
|
||||
/** The 1-based column number of the end location. */
|
||||
endColumn?: number | undefined;
|
||||
/** The 1-based line number of the end location. */
|
||||
endLine?: number | undefined;
|
||||
/** The ID of the rule which makes this message. */
|
||||
ruleId: string | null;
|
||||
/** The reported message. */
|
||||
message: string;
|
||||
/** The ID of the message in the rule's meta. */
|
||||
messageId?: string | undefined;
|
||||
/**
|
||||
* Type of node.
|
||||
* @deprecated `nodeType` is deprecated and will be removed in the next major version.
|
||||
*/
|
||||
nodeType?: string | undefined;
|
||||
/** If `true` then this is a fatal error. */
|
||||
fatal?: true | undefined;
|
||||
/** The severity of this message. */
|
||||
severity: Exclude<SeverityLevel, 0>;
|
||||
/** Information for autofix. */
|
||||
fix?: RuleTextEdit | undefined;
|
||||
/** Information for suggestions. */
|
||||
suggestions?: LintSuggestion[] | undefined;
|
||||
}
|
||||
/**
|
||||
* Generic options for the `RuleDefinition` type.
|
||||
*/
|
||||
@@ -498,6 +536,19 @@ export type SeverityLevel = 0 | 1 | 2;
|
||||
* The severity of a rule in a configuration.
|
||||
*/
|
||||
export type Severity = SeverityName | SeverityLevel;
|
||||
/**
|
||||
* Represents the metadata for an object, such as a plugin or processor.
|
||||
*/
|
||||
export interface ObjectMetaProperties {
|
||||
/** @deprecated Use `meta.name` instead. */
|
||||
name?: string | undefined;
|
||||
/** @deprecated Use `meta.version` instead. */
|
||||
version?: string | undefined;
|
||||
meta?: {
|
||||
name?: string | undefined;
|
||||
version?: string | undefined;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Represents the configuration options for the core linter.
|
||||
*/
|
||||
@@ -532,6 +583,285 @@ export interface RulesConfig {
|
||||
export interface SettingsConfig {
|
||||
[key: string]: unknown;
|
||||
}
|
||||
/**
|
||||
* The configuration for a set of files.
|
||||
*/
|
||||
export interface ConfigObject<Rules extends RulesConfig = RulesConfig> {
|
||||
/**
|
||||
* A string to identify the configuration object. Used in error messages and
|
||||
* inspection tools.
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Path to the directory where the configuration object should apply.
|
||||
* `files` and `ignores` patterns in the configuration object are
|
||||
* interpreted as relative to this path.
|
||||
*/
|
||||
basePath?: string;
|
||||
/**
|
||||
* An array of glob patterns indicating the files that the configuration
|
||||
* object should apply to. If not specified, the configuration object applies
|
||||
* to all files
|
||||
*/
|
||||
files?: (string | string[])[];
|
||||
/**
|
||||
* An array of glob patterns indicating the files that the configuration
|
||||
* object should not apply to. If not specified, the configuration object
|
||||
* applies to all files matched by files
|
||||
*/
|
||||
ignores?: string[];
|
||||
/**
|
||||
* The name of the language used for linting. This is used to determine the
|
||||
* parser and other language-specific settings.
|
||||
* @since 9.7.0
|
||||
*/
|
||||
language?: string;
|
||||
/**
|
||||
* An object containing settings related to how the language is configured for
|
||||
* linting.
|
||||
*/
|
||||
languageOptions?: LanguageOptions;
|
||||
/**
|
||||
* An object containing settings related to the linting process
|
||||
*/
|
||||
linterOptions?: LinterOptionsConfig;
|
||||
/**
|
||||
* Either an object containing preprocess() and postprocess() methods or a
|
||||
* string indicating the name of a processor inside of a plugin
|
||||
* (i.e., "pluginName/processorName").
|
||||
*/
|
||||
processor?: string | Processor;
|
||||
/**
|
||||
* An object containing a name-value mapping of plugin names to plugin objects.
|
||||
* When files is specified, these plugins are only available to the matching files.
|
||||
*/
|
||||
plugins?: Record<string, Plugin>;
|
||||
/**
|
||||
* An object containing the configured rules. When files or ignores are specified,
|
||||
* these rule configurations are only available to the matching files.
|
||||
*/
|
||||
rules?: Partial<Rules>;
|
||||
/**
|
||||
* An object containing name-value pairs of information that should be
|
||||
* available to all rules.
|
||||
*/
|
||||
settings?: Record<string, unknown>;
|
||||
}
|
||||
/** @deprecated Only supported in legacy eslintrc config format. */
|
||||
export type GlobalAccess = boolean | "off" | "readable" | "readonly" | "writable" | "writeable";
|
||||
/** @deprecated Only supported in legacy eslintrc config format. */
|
||||
export interface GlobalsConfig {
|
||||
[name: string]: GlobalAccess;
|
||||
}
|
||||
/**
|
||||
* The ECMAScript version of the code being linted.
|
||||
* @deprecated Only supported in legacy eslintrc config format.
|
||||
*/
|
||||
export type EcmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 2026 | "latest";
|
||||
/**
|
||||
* The type of JavaScript source code.
|
||||
* @deprecated Only supported in legacy eslintrc config format.
|
||||
*/
|
||||
export type JavaScriptSourceType = "script" | "module" | "commonjs";
|
||||
/**
|
||||
* Parser options.
|
||||
* @deprecated Only supported in legacy eslintrc config format.
|
||||
* @see [Specifying Parser Options](https://eslint.org/docs/latest/use/configure/language-options#specifying-parser-options)
|
||||
*/
|
||||
export interface JavaScriptParserOptionsConfig {
|
||||
/**
|
||||
* Allow the use of reserved words as identifiers (if `ecmaVersion` is 3).
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
allowReserved?: boolean | undefined;
|
||||
/**
|
||||
* Accepts any valid ECMAScript version number or `'latest'`:
|
||||
*
|
||||
* - A version: es3, es5, es6, es7, es8, es9, es10, es11, es12, es13, es14, ..., or
|
||||
* - A year: es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, ..., or
|
||||
* - `'latest'`
|
||||
*
|
||||
* When it's a version or a year, the value must be a number - so do not include the `es` prefix.
|
||||
*
|
||||
* Specifies the version of ECMAScript syntax you want to use. This is used by the parser to determine how to perform scope analysis, and it affects the default
|
||||
*
|
||||
* @default 5
|
||||
*/
|
||||
ecmaVersion?: EcmaVersion | undefined;
|
||||
/**
|
||||
* The type of JavaScript source code. Possible values are "script" for
|
||||
* traditional script files, "module" for ECMAScript modules (ESM), and
|
||||
* "commonjs" for CommonJS files.
|
||||
*
|
||||
* @default 'script'
|
||||
*
|
||||
* @see https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options
|
||||
*/
|
||||
sourceType?: JavaScriptSourceType | undefined;
|
||||
/**
|
||||
* An object indicating which additional language features you'd like to use.
|
||||
*
|
||||
* @see https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options
|
||||
*/
|
||||
ecmaFeatures?: {
|
||||
globalReturn?: boolean | undefined;
|
||||
impliedStrict?: boolean | undefined;
|
||||
jsx?: boolean | undefined;
|
||||
experimentalObjectRestSpread?: boolean | undefined;
|
||||
[key: string]: any;
|
||||
} | undefined;
|
||||
[key: string]: any;
|
||||
}
|
||||
/** @deprecated Only supported in legacy eslintrc config format. */
|
||||
export interface EnvironmentConfig {
|
||||
/** The definition of global variables. */
|
||||
globals?: GlobalsConfig | undefined;
|
||||
/** The parser options that will be enabled under this environment. */
|
||||
parserOptions?: JavaScriptParserOptionsConfig | undefined;
|
||||
}
|
||||
/**
|
||||
* A configuration object that may have a `rules` block.
|
||||
*/
|
||||
export interface HasRules<Rules extends RulesConfig = RulesConfig> {
|
||||
rules?: Partial<Rules> | undefined;
|
||||
}
|
||||
/**
|
||||
* ESLint legacy configuration.
|
||||
*
|
||||
* @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
|
||||
*/
|
||||
export interface BaseConfig<Rules extends RulesConfig = RulesConfig, OverrideRules extends RulesConfig = Rules> extends HasRules<Rules> {
|
||||
$schema?: string | undefined;
|
||||
/**
|
||||
* An environment provides predefined global variables.
|
||||
*
|
||||
* @see [Environments](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-environments)
|
||||
*/
|
||||
env?: {
|
||||
[name: string]: boolean;
|
||||
} | undefined;
|
||||
/**
|
||||
* Extending configuration files.
|
||||
*
|
||||
* @see [Extends](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#extending-configuration-files)
|
||||
*/
|
||||
extends?: string | string[] | undefined;
|
||||
/**
|
||||
* Specifying globals.
|
||||
*
|
||||
* @see [Globals](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-globals)
|
||||
*/
|
||||
globals?: GlobalsConfig | undefined;
|
||||
/**
|
||||
* Disable processing of inline comments.
|
||||
*
|
||||
* @see [Disabling Inline Comments](https://eslint.org/docs/latest/use/configure/rules-deprecated#disabling-inline-comments)
|
||||
*/
|
||||
noInlineConfig?: boolean | undefined;
|
||||
/**
|
||||
* Overrides can be used to use a differing configuration for matching sub-directories and files.
|
||||
*
|
||||
* @see [How do overrides work](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#how-do-overrides-work)
|
||||
*/
|
||||
overrides?: ConfigOverride<OverrideRules>[] | undefined;
|
||||
/**
|
||||
* Parser.
|
||||
*
|
||||
* @see [Working with Custom Parsers](https://eslint.org/docs/latest/extend/custom-parsers)
|
||||
* @see [Specifying Parser](https://eslint.org/docs/latest/use/configure/parser-deprecated)
|
||||
*/
|
||||
parser?: string | undefined;
|
||||
/**
|
||||
* Parser options.
|
||||
*
|
||||
* @see [Working with Custom Parsers](https://eslint.org/docs/latest/extend/custom-parsers)
|
||||
* @see [Specifying Parser Options](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options)
|
||||
*/
|
||||
parserOptions?: JavaScriptParserOptionsConfig | undefined;
|
||||
/**
|
||||
* Which third-party plugins define additional rules, environments, configs, etc. for ESLint to use.
|
||||
*
|
||||
* @see [Configuring Plugins](https://eslint.org/docs/latest/use/configure/plugins-deprecated#configure-plugins)
|
||||
*/
|
||||
plugins?: string[] | undefined;
|
||||
/**
|
||||
* Specifying processor.
|
||||
*
|
||||
* @see [processor](https://eslint.org/docs/latest/use/configure/plugins-deprecated#specify-a-processor)
|
||||
*/
|
||||
processor?: string | undefined;
|
||||
/**
|
||||
* Report unused eslint-disable comments as warning.
|
||||
*
|
||||
* @see [Report unused eslint-disable comments](https://eslint.org/docs/latest/use/configure/rules-deprecated#report-unused-eslint-disable-comments)
|
||||
*/
|
||||
reportUnusedDisableDirectives?: boolean | undefined;
|
||||
/**
|
||||
* Settings.
|
||||
*
|
||||
* @see [Settings](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#adding-shared-settings)
|
||||
*/
|
||||
settings?: SettingsConfig | undefined;
|
||||
}
|
||||
/**
|
||||
* The overwrites that apply more differing configuration to specific files or directories.
|
||||
*/
|
||||
export interface ConfigOverride<Rules extends RulesConfig = RulesConfig> extends BaseConfig<Rules> {
|
||||
/**
|
||||
* The glob patterns for excluded files.
|
||||
*/
|
||||
excludedFiles?: string | string[] | undefined;
|
||||
/**
|
||||
* The glob patterns for target files.
|
||||
*/
|
||||
files: string | string[];
|
||||
}
|
||||
/**
|
||||
* ESLint legacy configuration.
|
||||
*
|
||||
* @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
|
||||
*/
|
||||
export interface LegacyConfigObject<Rules extends RulesConfig = RulesConfig, OverrideRules extends RulesConfig = Rules> extends BaseConfig<Rules, OverrideRules> {
|
||||
/**
|
||||
* Tell ESLint to ignore specific files and directories.
|
||||
*
|
||||
* @see [Ignore Patterns](https://eslint.org/docs/latest/use/configure/ignore-deprecated#ignorepatterns-in-config-files)
|
||||
*/
|
||||
ignorePatterns?: string | string[] | undefined;
|
||||
/**
|
||||
* @see [Using Configuration Files](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#using-configuration-files)
|
||||
*/
|
||||
root?: boolean | undefined;
|
||||
}
|
||||
/**
|
||||
* File information passed to a processor.
|
||||
*/
|
||||
export interface ProcessorFile {
|
||||
text: string;
|
||||
filename: string;
|
||||
}
|
||||
/**
|
||||
* A processor is an object that can preprocess and postprocess files.
|
||||
*/
|
||||
export interface Processor<T extends string | ProcessorFile = string | ProcessorFile> extends ObjectMetaProperties {
|
||||
/** If `true` then it means the processor supports autofix. */
|
||||
supportsAutofix?: boolean | undefined;
|
||||
/** The function to extract code blocks. */
|
||||
preprocess?(text: string, filename: string): T[];
|
||||
/** The function to merge messages. */
|
||||
postprocess?(messages: LintMessage[][], filename: string): LintMessage[];
|
||||
}
|
||||
export interface Plugin extends ObjectMetaProperties {
|
||||
meta?: ObjectMetaProperties["meta"] & {
|
||||
namespace?: string | undefined;
|
||||
};
|
||||
configs?: Record<string, LegacyConfigObject | ConfigObject | ConfigObject[]> | undefined;
|
||||
environments?: Record<string, EnvironmentConfig> | undefined;
|
||||
languages?: Record<string, Language> | undefined;
|
||||
processors?: Record<string, Processor> | undefined;
|
||||
rules?: Record<string, RuleDefinition> | undefined;
|
||||
}
|
||||
/**
|
||||
* Generic options for the `Language` type.
|
||||
*/
|
||||
|
||||
2
node_modules/@eslint/core/package.json
generated
vendored
2
node_modules/@eslint/core/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@eslint/core",
|
||||
"version": "0.15.2",
|
||||
"version": "0.17.0",
|
||||
"description": "Runtime-agnostic core of ESLint",
|
||||
"type": "module",
|
||||
"types": "./dist/esm/types.d.ts",
|
||||
|
||||
19
node_modules/@eslint/eslintrc/README.md
generated
vendored
19
node_modules/@eslint/eslintrc/README.md
generated
vendored
@@ -122,7 +122,24 @@ The `recommendedConfig` option is required when any config uses `eslint:recommen
|
||||
|
||||
The `allConfig` option is required when any config uses `eslint:all`, including any config in an `extends` clause. To fix this, follow the example above using `@eslint/js` to provide the `eslint:all` config.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT License
|
||||
|
||||
<!-- NOTE: This section is autogenerated. Do not manually edit.-->
|
||||
<!--sponsorsstart-->
|
||||
|
||||
## Sponsors
|
||||
|
||||
The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
|
||||
to get your logo on our READMEs and [website](https://eslint.org/sponsors).
|
||||
|
||||
<h3>Platinum Sponsors</h3>
|
||||
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="128"></a></p><h3>Gold Sponsors</h3>
|
||||
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a></p><h3>Silver Sponsors</h3>
|
||||
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/e6d15e1/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301" alt="American Express" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
|
||||
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://syntax.fm"><img src="https://github.com/syntaxfm.png" alt="Syntax" height="32"></a> <a href="https://www.n-ix.com/"><img src="https://images.opencollective.com/n-ix-ltd/575a7a5/logo.png" alt="N-iX Ltd" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="LambdaTest" height="32"></a></p>
|
||||
<h3>Technology Sponsors</h3>
|
||||
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
|
||||
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
|
||||
<!--sponsorsend-->
|
||||
|
||||
14
node_modules/@eslint/eslintrc/dist/eslintrc.cjs
generated
vendored
14
node_modules/@eslint/eslintrc/dist/eslintrc.cjs
generated
vendored
@@ -4332,7 +4332,12 @@ class FlatCompat {
|
||||
throw new TypeError("Missing parameter 'allConfig' in FlatCompat constructor.");
|
||||
}
|
||||
|
||||
return allConfig;
|
||||
// remove name property if it exists
|
||||
const config = { ...allConfig };
|
||||
|
||||
delete config.name;
|
||||
|
||||
return config;
|
||||
},
|
||||
getEslintRecommendedConfig() {
|
||||
|
||||
@@ -4340,7 +4345,12 @@ class FlatCompat {
|
||||
throw new TypeError("Missing parameter 'recommendedConfig' in FlatCompat constructor.");
|
||||
}
|
||||
|
||||
return recommendedConfig;
|
||||
// remove name property if it exists
|
||||
const config = { ...recommendedConfig };
|
||||
|
||||
delete config.name;
|
||||
|
||||
return config;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
2
node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map
generated
vendored
2
node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map
generated
vendored
File diff suppressed because one or more lines are too long
14
node_modules/@eslint/eslintrc/lib/flat-compat.js
generated
vendored
14
node_modules/@eslint/eslintrc/lib/flat-compat.js
generated
vendored
@@ -226,7 +226,12 @@ class FlatCompat {
|
||||
throw new TypeError("Missing parameter 'allConfig' in FlatCompat constructor.");
|
||||
}
|
||||
|
||||
return allConfig;
|
||||
// remove name property if it exists
|
||||
const config = { ...allConfig };
|
||||
|
||||
delete config.name;
|
||||
|
||||
return config;
|
||||
},
|
||||
getEslintRecommendedConfig() {
|
||||
|
||||
@@ -234,7 +239,12 @@ class FlatCompat {
|
||||
throw new TypeError("Missing parameter 'recommendedConfig' in FlatCompat constructor.");
|
||||
}
|
||||
|
||||
return recommendedConfig;
|
||||
// remove name property if it exists
|
||||
const config = { ...recommendedConfig };
|
||||
|
||||
delete config.name;
|
||||
|
||||
return config;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
10
node_modules/@eslint/eslintrc/package.json
generated
vendored
10
node_modules/@eslint/eslintrc/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@eslint/eslintrc",
|
||||
"version": "3.3.1",
|
||||
"version": "3.3.3",
|
||||
"description": "The legacy ESLintRC config file format for ESLint",
|
||||
"type": "module",
|
||||
"main": "./dist/eslintrc.cjs",
|
||||
@@ -32,11 +32,6 @@
|
||||
"lint": "eslint . --report-unused-disable-directives",
|
||||
"lint:fix": "npm run lint -- --fix",
|
||||
"prepare": "npm run build",
|
||||
"release:generate:latest": "eslint-generate-release",
|
||||
"release:generate:alpha": "eslint-generate-prerelease alpha",
|
||||
"release:generate:beta": "eslint-generate-prerelease beta",
|
||||
"release:generate:rc": "eslint-generate-prerelease rc",
|
||||
"release:publish": "eslint-publish-release",
|
||||
"test": "mocha -R progress -c 'tests/lib/*.cjs' && c8 mocha -R progress -c 'tests/lib/**/*.js'",
|
||||
"test:types": "tsc -p tests/lib/types/tsconfig.json"
|
||||
},
|
||||
@@ -58,7 +53,6 @@
|
||||
"chai": "^4.3.4",
|
||||
"eslint": "^9.20.1",
|
||||
"eslint-config-eslint": "^11.0.0",
|
||||
"eslint-release": "^3.2.0",
|
||||
"fs-teardown": "^0.1.3",
|
||||
"mocha": "^9.0.3",
|
||||
"rollup": "^2.70.1",
|
||||
@@ -74,7 +68,7 @@
|
||||
"globals": "^14.0.0",
|
||||
"ignore": "^5.2.0",
|
||||
"import-fresh": "^3.2.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"js-yaml": "^4.1.1",
|
||||
"minimatch": "^3.1.2",
|
||||
"strip-json-comments": "^3.1.1"
|
||||
},
|
||||
|
||||
36
node_modules/@eslint/js/README.md
generated
vendored
36
node_modules/@eslint/js/README.md
generated
vendored
@@ -1,8 +1,22 @@
|
||||
[](https://www.npmjs.com/package/@eslint/js)
|
||||
[](https://www.npmjs.com/package/@eslint/js)
|
||||
[](https://github.com/eslint/eslint/actions)
|
||||
<br>
|
||||
[](https://opencollective.com/eslint)
|
||||
[](https://opencollective.com/eslint)
|
||||
|
||||
# ESLint JavaScript Plugin
|
||||
|
||||
[Website](https://eslint.org) | [Configure ESLint](https://eslint.org/docs/latest/use/configure) | [Rules](https://eslint.org/docs/rules/) | [Contributing](https://eslint.org/docs/latest/contribute) | [Twitter](https://twitter.com/geteslint) | [Chatroom](https://eslint.org/chat)
|
||||
[Website](https://eslint.org) |
|
||||
[Configure ESLint](https://eslint.org/docs/latest/use/configure) |
|
||||
[Rules](https://eslint.org/docs/rules/) |
|
||||
[Contribute to ESLint](https://eslint.org/docs/latest/contribute) |
|
||||
[Report Bugs](https://eslint.org/docs/latest/contribute/report-bugs) |
|
||||
[Code of Conduct](https://eslint.org/conduct) |
|
||||
[X](https://x.com/geteslint) |
|
||||
[Discord](https://eslint.org/chat) |
|
||||
[Mastodon](https://fosstodon.org/@eslint) |
|
||||
[Bluesky](https://bsky.app/profile/eslint.org)
|
||||
|
||||
The beginnings of separating out JavaScript-specific functionality from ESLint.
|
||||
|
||||
@@ -13,8 +27,28 @@ Right now, this plugin contains two configurations:
|
||||
|
||||
## Installation
|
||||
|
||||
You can install ESLint using npm or other package managers:
|
||||
|
||||
```shell
|
||||
npm install eslint -D
|
||||
# or
|
||||
yarn add eslint -D
|
||||
# or
|
||||
pnpm install eslint -D
|
||||
# or
|
||||
bun add eslint -D
|
||||
```
|
||||
|
||||
Then install this plugin:
|
||||
|
||||
```shell
|
||||
npm install @eslint/js -D
|
||||
# or
|
||||
yarn add @eslint/js -D
|
||||
# or
|
||||
pnpm install @eslint/js -D
|
||||
# or
|
||||
bun add @eslint/js -D
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
2
node_modules/@eslint/js/package.json
generated
vendored
2
node_modules/@eslint/js/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@eslint/js",
|
||||
"version": "9.36.0",
|
||||
"version": "9.39.2",
|
||||
"description": "ESLint JavaScript language implementation",
|
||||
"funding": "https://eslint.org/donate",
|
||||
"main": "./src/index.js",
|
||||
|
||||
136
node_modules/@eslint/js/src/configs/eslint-recommended.js
generated
vendored
136
node_modules/@eslint/js/src/configs/eslint-recommended.js
generated
vendored
@@ -1,13 +1,9 @@
|
||||
/**
|
||||
* @fileoverview Configuration applied when a user configuration extends from
|
||||
* eslint:recommended.
|
||||
* @author Nicholas C. Zakas
|
||||
/*
|
||||
* WARNING: This file is autogenerated using the tools/update-eslint-recommended.js
|
||||
* script. Do not edit manually.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
/* eslint sort-keys: ["error", "asc"] -- Long, so make more readable */
|
||||
|
||||
/*
|
||||
* IMPORTANT!
|
||||
*
|
||||
@@ -17,67 +13,67 @@
|
||||
*/
|
||||
|
||||
module.exports = Object.freeze({
|
||||
rules: Object.freeze({
|
||||
"constructor-super": "error",
|
||||
"for-direction": "error",
|
||||
"getter-return": "error",
|
||||
"no-async-promise-executor": "error",
|
||||
"no-case-declarations": "error",
|
||||
"no-class-assign": "error",
|
||||
"no-compare-neg-zero": "error",
|
||||
"no-cond-assign": "error",
|
||||
"no-const-assign": "error",
|
||||
"no-constant-binary-expression": "error",
|
||||
"no-constant-condition": "error",
|
||||
"no-control-regex": "error",
|
||||
"no-debugger": "error",
|
||||
"no-delete-var": "error",
|
||||
"no-dupe-args": "error",
|
||||
"no-dupe-class-members": "error",
|
||||
"no-dupe-else-if": "error",
|
||||
"no-dupe-keys": "error",
|
||||
"no-duplicate-case": "error",
|
||||
"no-empty": "error",
|
||||
"no-empty-character-class": "error",
|
||||
"no-empty-pattern": "error",
|
||||
"no-empty-static-block": "error",
|
||||
"no-ex-assign": "error",
|
||||
"no-extra-boolean-cast": "error",
|
||||
"no-fallthrough": "error",
|
||||
"no-func-assign": "error",
|
||||
"no-global-assign": "error",
|
||||
"no-import-assign": "error",
|
||||
"no-invalid-regexp": "error",
|
||||
"no-irregular-whitespace": "error",
|
||||
"no-loss-of-precision": "error",
|
||||
"no-misleading-character-class": "error",
|
||||
"no-new-native-nonconstructor": "error",
|
||||
"no-nonoctal-decimal-escape": "error",
|
||||
"no-obj-calls": "error",
|
||||
"no-octal": "error",
|
||||
"no-prototype-builtins": "error",
|
||||
"no-redeclare": "error",
|
||||
"no-regex-spaces": "error",
|
||||
"no-self-assign": "error",
|
||||
"no-setter-return": "error",
|
||||
"no-shadow-restricted-names": "error",
|
||||
"no-sparse-arrays": "error",
|
||||
"no-this-before-super": "error",
|
||||
"no-undef": "error",
|
||||
"no-unexpected-multiline": "error",
|
||||
"no-unreachable": "error",
|
||||
"no-unsafe-finally": "error",
|
||||
"no-unsafe-negation": "error",
|
||||
"no-unsafe-optional-chaining": "error",
|
||||
"no-unused-labels": "error",
|
||||
"no-unused-private-class-members": "error",
|
||||
"no-unused-vars": "error",
|
||||
"no-useless-backreference": "error",
|
||||
"no-useless-catch": "error",
|
||||
"no-useless-escape": "error",
|
||||
"no-with": "error",
|
||||
"require-yield": "error",
|
||||
"use-isnan": "error",
|
||||
"valid-typeof": "error",
|
||||
}),
|
||||
rules: Object.freeze({
|
||||
"constructor-super": "error",
|
||||
"for-direction": "error",
|
||||
"getter-return": "error",
|
||||
"no-async-promise-executor": "error",
|
||||
"no-case-declarations": "error",
|
||||
"no-class-assign": "error",
|
||||
"no-compare-neg-zero": "error",
|
||||
"no-cond-assign": "error",
|
||||
"no-const-assign": "error",
|
||||
"no-constant-binary-expression": "error",
|
||||
"no-constant-condition": "error",
|
||||
"no-control-regex": "error",
|
||||
"no-debugger": "error",
|
||||
"no-delete-var": "error",
|
||||
"no-dupe-args": "error",
|
||||
"no-dupe-class-members": "error",
|
||||
"no-dupe-else-if": "error",
|
||||
"no-dupe-keys": "error",
|
||||
"no-duplicate-case": "error",
|
||||
"no-empty": "error",
|
||||
"no-empty-character-class": "error",
|
||||
"no-empty-pattern": "error",
|
||||
"no-empty-static-block": "error",
|
||||
"no-ex-assign": "error",
|
||||
"no-extra-boolean-cast": "error",
|
||||
"no-fallthrough": "error",
|
||||
"no-func-assign": "error",
|
||||
"no-global-assign": "error",
|
||||
"no-import-assign": "error",
|
||||
"no-invalid-regexp": "error",
|
||||
"no-irregular-whitespace": "error",
|
||||
"no-loss-of-precision": "error",
|
||||
"no-misleading-character-class": "error",
|
||||
"no-new-native-nonconstructor": "error",
|
||||
"no-nonoctal-decimal-escape": "error",
|
||||
"no-obj-calls": "error",
|
||||
"no-octal": "error",
|
||||
"no-prototype-builtins": "error",
|
||||
"no-redeclare": "error",
|
||||
"no-regex-spaces": "error",
|
||||
"no-self-assign": "error",
|
||||
"no-setter-return": "error",
|
||||
"no-shadow-restricted-names": "error",
|
||||
"no-sparse-arrays": "error",
|
||||
"no-this-before-super": "error",
|
||||
"no-undef": "error",
|
||||
"no-unexpected-multiline": "error",
|
||||
"no-unreachable": "error",
|
||||
"no-unsafe-finally": "error",
|
||||
"no-unsafe-negation": "error",
|
||||
"no-unsafe-optional-chaining": "error",
|
||||
"no-unused-labels": "error",
|
||||
"no-unused-private-class-members": "error",
|
||||
"no-unused-vars": "error",
|
||||
"no-useless-backreference": "error",
|
||||
"no-useless-catch": "error",
|
||||
"no-useless-escape": "error",
|
||||
"no-with": "error",
|
||||
"require-yield": "error",
|
||||
"use-isnan": "error",
|
||||
"valid-typeof": "error"
|
||||
}),
|
||||
});
|
||||
|
||||
8
node_modules/@eslint/object-schema/README.md
generated
vendored
8
node_modules/@eslint/object-schema/README.md
generated
vendored
@@ -15,7 +15,7 @@ yarn add @eslint/object-schema
|
||||
# or
|
||||
pnpm install @eslint/object-schema
|
||||
# or
|
||||
bun install @eslint/object-schema
|
||||
bun add @eslint/object-schema
|
||||
```
|
||||
|
||||
For Deno:
|
||||
@@ -233,9 +233,9 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).
|
||||
|
||||
<h3>Platinum Sponsors</h3>
|
||||
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="128"></a></p><h3>Gold Sponsors</h3>
|
||||
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://trunk.io/"><img src="https://images.opencollective.com/trunkio/fb92d60/avatar.png" alt="trunk.io" height="96"></a></p><h3>Silver Sponsors</h3>
|
||||
<p><a href="https://www.serptriumph.com/"><img src="https://images.opencollective.com/serp-triumph5/fea3074/logo.png" alt="SERP Triumph" height="64"></a> <a href="https://www.jetbrains.com/"><img src="https://images.opencollective.com/jetbrains/fe76f99/logo.png" alt="JetBrains" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301" alt="American Express" height="64"></a></p><h3>Bronze Sponsors</h3>
|
||||
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://nolebase.ayaka.io"><img src="https://avatars.githubusercontent.com/u/11081491" alt="Neko" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a></p>
|
||||
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://trunk.io/"><img src="https://images.opencollective.com/trunkio/fb92d60/avatar.png" alt="trunk.io" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a></p><h3>Silver Sponsors</h3>
|
||||
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/e6d15e1/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301" alt="American Express" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
|
||||
<p><a href="https://syntax.fm"><img src="https://github.com/syntaxfm.png" alt="Syntax" height="32"></a> <a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://sentry.io"><img src="https://github.com/getsentry.png" alt="Sentry" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="LambdaTest" height="32"></a></p>
|
||||
<h3>Technology Sponsors</h3>
|
||||
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
|
||||
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
|
||||
|
||||
14
node_modules/@eslint/object-schema/dist/cjs/index.cjs
generated
vendored
14
node_modules/@eslint/object-schema/dist/cjs/index.cjs
generated
vendored
@@ -155,8 +155,9 @@ class ValidationStrategy {
|
||||
// Types
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/** @typedef {import("./types.ts").ObjectDefinition} ObjectDefinition */
|
||||
/** @typedef {import("./types.ts").PropertyDefinition} PropertyDefinition */
|
||||
/** @import * as $typests from "./types.ts"; */
|
||||
/** @typedef {$typests.ObjectDefinition} ObjectDefinition */
|
||||
/** @typedef {$typests.PropertyDefinition} PropertyDefinition */
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Private
|
||||
@@ -167,9 +168,9 @@ class ValidationStrategy {
|
||||
* @param {string} name The name of the key this strategy is for.
|
||||
* @param {PropertyDefinition} definition The strategy for the object key.
|
||||
* @returns {void}
|
||||
* @throws {Error} When the strategy is missing a name.
|
||||
* @throws {Error} When the strategy is missing a merge() method.
|
||||
* @throws {Error} When the strategy is missing a validate() method.
|
||||
* @throws {TypeError} When the strategy is missing a name.
|
||||
* @throws {TypeError} When the strategy is missing a merge() method.
|
||||
* @throws {TypeError} When the strategy is missing a validate() method.
|
||||
*/
|
||||
function validateDefinition(name, definition) {
|
||||
let hasSchema = false;
|
||||
@@ -294,6 +295,7 @@ class ObjectSchema {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
* @param {ObjectDefinition} definitions The schema definitions.
|
||||
* @throws {Error} When the definitions are missing or invalid.
|
||||
*/
|
||||
constructor(definitions) {
|
||||
if (!definitions) {
|
||||
@@ -363,7 +365,7 @@ class ObjectSchema {
|
||||
* strategy.
|
||||
* @param {...Object} objects The objects to merge.
|
||||
* @returns {Object} A new object with a mix of all objects' keys.
|
||||
* @throws {Error} If any object is invalid.
|
||||
* @throws {TypeError} If any object is invalid.
|
||||
*/
|
||||
merge(...objects) {
|
||||
// double check arguments
|
||||
|
||||
8
node_modules/@eslint/object-schema/dist/cjs/index.d.cts
generated
vendored
8
node_modules/@eslint/object-schema/dist/cjs/index.d.cts
generated
vendored
@@ -1,5 +1,5 @@
|
||||
export type ObjectDefinition = import("./types.cts").ObjectDefinition;
|
||||
export type PropertyDefinition = import("./types.cts").PropertyDefinition;
|
||||
export type ObjectDefinition = $typests.ObjectDefinition;
|
||||
export type PropertyDefinition = $typests.PropertyDefinition;
|
||||
/**
|
||||
* @fileoverview Merge Strategy
|
||||
*/
|
||||
@@ -38,6 +38,7 @@ export class ObjectSchema {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
* @param {ObjectDefinition} definitions The schema definitions.
|
||||
* @throws {Error} When the definitions are missing or invalid.
|
||||
*/
|
||||
constructor(definitions: ObjectDefinition);
|
||||
/**
|
||||
@@ -52,7 +53,7 @@ export class ObjectSchema {
|
||||
* strategy.
|
||||
* @param {...Object} objects The objects to merge.
|
||||
* @returns {Object} A new object with a mix of all objects' keys.
|
||||
* @throws {Error} If any object is invalid.
|
||||
* @throws {TypeError} If any object is invalid.
|
||||
*/
|
||||
merge(...objects: any[]): any;
|
||||
/**
|
||||
@@ -121,3 +122,4 @@ export class ValidationStrategy {
|
||||
*/
|
||||
static "string!"(value: any): void;
|
||||
}
|
||||
import type * as $typests from "./types.cts";
|
||||
|
||||
57
node_modules/@eslint/object-schema/dist/cjs/types.ts
generated
vendored
57
node_modules/@eslint/object-schema/dist/cjs/types.ts
generated
vendored
@@ -1,57 +0,0 @@
|
||||
/**
|
||||
* @fileoverview Types for object-schema package.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Built-in validation strategies.
|
||||
*/
|
||||
export type BuiltInValidationStrategy =
|
||||
| "array"
|
||||
| "boolean"
|
||||
| "number"
|
||||
| "object"
|
||||
| "object?"
|
||||
| "string"
|
||||
| "string!";
|
||||
|
||||
/**
|
||||
* Built-in merge strategies.
|
||||
*/
|
||||
export type BuiltInMergeStrategy = "assign" | "overwrite" | "replace";
|
||||
|
||||
/**
|
||||
* Property definition.
|
||||
*/
|
||||
export interface PropertyDefinition {
|
||||
/**
|
||||
* Indicates if the property is required.
|
||||
*/
|
||||
required: boolean;
|
||||
|
||||
/**
|
||||
* The other properties that must be present when this property is used.
|
||||
*/
|
||||
requires?: string[];
|
||||
|
||||
/**
|
||||
* The strategy to merge the property.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/eslint/rewrite/pull/90#discussion_r1687206213
|
||||
merge: BuiltInMergeStrategy | ((target: any, source: any) => any);
|
||||
|
||||
/**
|
||||
* The strategy to validate the property.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/eslint/rewrite/pull/90#discussion_r1687206213
|
||||
validate: BuiltInValidationStrategy | ((value: any) => void);
|
||||
|
||||
/**
|
||||
* The schema for the object value of this property.
|
||||
*/
|
||||
schema?: ObjectDefinition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Object definition.
|
||||
*/
|
||||
export type ObjectDefinition = Record<string, PropertyDefinition>;
|
||||
8
node_modules/@eslint/object-schema/dist/esm/index.d.ts
generated
vendored
8
node_modules/@eslint/object-schema/dist/esm/index.d.ts
generated
vendored
@@ -1,5 +1,5 @@
|
||||
export type ObjectDefinition = import("./types.ts").ObjectDefinition;
|
||||
export type PropertyDefinition = import("./types.ts").PropertyDefinition;
|
||||
export type ObjectDefinition = $typests.ObjectDefinition;
|
||||
export type PropertyDefinition = $typests.PropertyDefinition;
|
||||
/**
|
||||
* @fileoverview Merge Strategy
|
||||
*/
|
||||
@@ -38,6 +38,7 @@ export class ObjectSchema {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
* @param {ObjectDefinition} definitions The schema definitions.
|
||||
* @throws {Error} When the definitions are missing or invalid.
|
||||
*/
|
||||
constructor(definitions: ObjectDefinition);
|
||||
/**
|
||||
@@ -52,7 +53,7 @@ export class ObjectSchema {
|
||||
* strategy.
|
||||
* @param {...Object} objects The objects to merge.
|
||||
* @returns {Object} A new object with a mix of all objects' keys.
|
||||
* @throws {Error} If any object is invalid.
|
||||
* @throws {TypeError} If any object is invalid.
|
||||
*/
|
||||
merge(...objects: any[]): any;
|
||||
/**
|
||||
@@ -121,3 +122,4 @@ export class ValidationStrategy {
|
||||
*/
|
||||
static "string!"(value: any): void;
|
||||
}
|
||||
import type * as $typests from "./types.ts";
|
||||
|
||||
14
node_modules/@eslint/object-schema/dist/esm/index.js
generated
vendored
14
node_modules/@eslint/object-schema/dist/esm/index.js
generated
vendored
@@ -154,8 +154,9 @@ class ValidationStrategy {
|
||||
// Types
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/** @typedef {import("./types.ts").ObjectDefinition} ObjectDefinition */
|
||||
/** @typedef {import("./types.ts").PropertyDefinition} PropertyDefinition */
|
||||
/** @import * as $typests from "./types.ts"; */
|
||||
/** @typedef {$typests.ObjectDefinition} ObjectDefinition */
|
||||
/** @typedef {$typests.PropertyDefinition} PropertyDefinition */
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Private
|
||||
@@ -166,9 +167,9 @@ class ValidationStrategy {
|
||||
* @param {string} name The name of the key this strategy is for.
|
||||
* @param {PropertyDefinition} definition The strategy for the object key.
|
||||
* @returns {void}
|
||||
* @throws {Error} When the strategy is missing a name.
|
||||
* @throws {Error} When the strategy is missing a merge() method.
|
||||
* @throws {Error} When the strategy is missing a validate() method.
|
||||
* @throws {TypeError} When the strategy is missing a name.
|
||||
* @throws {TypeError} When the strategy is missing a merge() method.
|
||||
* @throws {TypeError} When the strategy is missing a validate() method.
|
||||
*/
|
||||
function validateDefinition(name, definition) {
|
||||
let hasSchema = false;
|
||||
@@ -293,6 +294,7 @@ class ObjectSchema {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
* @param {ObjectDefinition} definitions The schema definitions.
|
||||
* @throws {Error} When the definitions are missing or invalid.
|
||||
*/
|
||||
constructor(definitions) {
|
||||
if (!definitions) {
|
||||
@@ -362,7 +364,7 @@ class ObjectSchema {
|
||||
* strategy.
|
||||
* @param {...Object} objects The objects to merge.
|
||||
* @returns {Object} A new object with a mix of all objects' keys.
|
||||
* @throws {Error} If any object is invalid.
|
||||
* @throws {TypeError} If any object is invalid.
|
||||
*/
|
||||
merge(...objects) {
|
||||
// double check arguments
|
||||
|
||||
21
node_modules/@eslint/object-schema/package.json
generated
vendored
21
node_modules/@eslint/object-schema/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@eslint/object-schema",
|
||||
"version": "2.1.6",
|
||||
"version": "2.1.7",
|
||||
"description": "An object schema merger/validator",
|
||||
"type": "module",
|
||||
"main": "dist/esm/index.js",
|
||||
@@ -25,15 +25,18 @@
|
||||
"test": "tests"
|
||||
},
|
||||
"scripts": {
|
||||
"build:dedupe-types": "node ../../tools/dedupe-types.js dist/cjs/index.cjs dist/esm/index.js",
|
||||
"build:cts": "node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts",
|
||||
"build": "rollup -c && tsc -p tsconfig.esm.json && npm run build:cts",
|
||||
"build": "rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:cts",
|
||||
"test": "mocha \"tests/**/*.test.js\"",
|
||||
"test:coverage": "c8 npm test",
|
||||
"test:jsr": "npx jsr@latest publish --dry-run",
|
||||
"test": "mocha tests/",
|
||||
"test:coverage": "c8 npm test"
|
||||
"test:types": "tsc -p tests/types/tsconfig.json"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/eslint/rewrite.git"
|
||||
"url": "git+https://github.com/eslint/rewrite.git",
|
||||
"directory": "packages/object-schema"
|
||||
},
|
||||
"keywords": [
|
||||
"object",
|
||||
@@ -46,13 +49,9 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/eslint/rewrite/issues"
|
||||
},
|
||||
"homepage": "https://github.com/eslint/rewrite#readme",
|
||||
"homepage": "https://github.com/eslint/rewrite/tree/main/packages/object-schema#readme",
|
||||
"devDependencies": {
|
||||
"c8": "^9.1.0",
|
||||
"mocha": "^10.4.0",
|
||||
"rollup": "^4.16.2",
|
||||
"rollup-plugin-copy": "^3.5.0",
|
||||
"typescript": "^5.4.5"
|
||||
"rollup-plugin-copy": "^3.5.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
|
||||
10
node_modules/@eslint/plugin-kit/README.md
generated
vendored
10
node_modules/@eslint/plugin-kit/README.md
generated
vendored
@@ -204,9 +204,11 @@ class MySourceCode {
|
||||
The `TextSourceCodeBase` class is intended to be a base class that has several of the common members found in `SourceCode` objects already implemented. Those members are:
|
||||
|
||||
- `lines` - an array of text lines that is created automatically when the constructor is called.
|
||||
- `getLoc(node)` - gets the location of a node. Works for nodes that have the ESLint-style `loc` property and nodes that have the Unist-style [`position` property](https://github.com/syntax-tree/unist?tab=readme-ov-file#position). If you're using an AST with a different location format, you'll still need to implement this method yourself.
|
||||
- `getRange(node)` - gets the range of a node within the source text. Works for nodes that have the ESLint-style `range` property and nodes that have the Unist-style [`position` property](https://github.com/syntax-tree/unist?tab=readme-ov-file#position). If you're using an AST with a different range format, you'll still need to implement this method yourself.
|
||||
- `getText(nodeOrToken, charsBefore, charsAfter)` - gets the source text for the given node or token that has range information attached. Optionally, can return additional characters before and after the given node or token. As long as `getRange()` is properly implemented, this method will just work.
|
||||
- `getLoc(nodeOrToken)` - gets the location of a node or token. Works for nodes that have the ESLint-style `loc` property and nodes that have the Unist-style [`position` property](https://github.com/syntax-tree/unist?tab=readme-ov-file#position). If you're using an AST with a different location format, you'll still need to implement this method yourself.
|
||||
- `getLocFromIndex(index)` - Converts a source text index into a `{ line: number, column: number }` pair. (For this method to work, the root node should always cover the entire source code text, and the `getLoc()` method needs to be implemented correctly.)
|
||||
- `getIndexFromLoc(loc)` - Converts a `{ line: number, column: number }` pair into a source text index. (For this method to work, the root node should always cover the entire source code text, and the `getLoc()` method needs to be implemented correctly.)
|
||||
- `getRange(nodeOrToken)` - gets the range of a node or token within the source text. Works for nodes that have the ESLint-style `range` property and nodes that have the Unist-style [`position` property](https://github.com/syntax-tree/unist?tab=readme-ov-file#position). If you're using an AST with a different range format, you'll still need to implement this method yourself.
|
||||
- `getText(node, beforeCount, afterCount)` - gets the source text for the given node that has range information attached. Optionally, can return additional characters before and after the given node. As long as `getRange()` is properly implemented, this method will just work.
|
||||
- `getAncestors(node)` - returns the ancestry of the node. In order for this to work, you must implement the `getParent()` method yourself.
|
||||
|
||||
Here's an example:
|
||||
@@ -264,7 +266,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).
|
||||
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="128"></a></p><h3>Gold Sponsors</h3>
|
||||
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://trunk.io/"><img src="https://images.opencollective.com/trunkio/fb92d60/avatar.png" alt="trunk.io" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a></p><h3>Silver Sponsors</h3>
|
||||
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/e6d15e1/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301" alt="American Express" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
|
||||
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="LambdaTest" height="32"></a></p>
|
||||
<p><a href="https://syntax.fm"><img src="https://github.com/syntaxfm.png" alt="Syntax" height="32"></a> <a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://sentry.io"><img src="https://github.com/getsentry.png" alt="Sentry" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104" alt="Nx" height="32"></a> <a href="https://opensource.mercedes-benz.com/"><img src="https://avatars.githubusercontent.com/u/34240465" alt="Mercedes-Benz Group" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="LambdaTest" height="32"></a></p>
|
||||
<h3>Technology Sponsors</h3>
|
||||
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
|
||||
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
|
||||
|
||||
300
node_modules/@eslint/plugin-kit/dist/cjs/index.cjs
generated
vendored
300
node_modules/@eslint/plugin-kit/dist/cjs/index.cjs
generated
vendored
@@ -12,10 +12,12 @@ var levn = require('levn');
|
||||
// Type Definitions
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/** @typedef {import("@eslint/core").RuleConfig} RuleConfig */
|
||||
/** @typedef {import("@eslint/core").RulesConfig} RulesConfig */
|
||||
/** @typedef {import("./types.ts").StringConfig} StringConfig */
|
||||
/** @typedef {import("./types.ts").BooleanConfig} BooleanConfig */
|
||||
/** @import * as $eslintcore from "@eslint/core"; */
|
||||
/** @typedef {$eslintcore.RuleConfig} RuleConfig */
|
||||
/** @typedef {$eslintcore.RulesConfig} RulesConfig */
|
||||
/** @import * as $typests from "./types.ts"; */
|
||||
/** @typedef {$typests.StringConfig} StringConfig */
|
||||
/** @typedef {$typests.BooleanConfig} BooleanConfig */
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Helpers
|
||||
@@ -153,7 +155,7 @@ class ConfigCommentParser {
|
||||
*/
|
||||
const normalizedString = string
|
||||
.replace(/(?<![-a-zA-Z0-9/])([-a-zA-Z0-9/]+):/gu, '"$1":')
|
||||
.replace(/(\]|[0-9])\s+(?=")/u, "$1,");
|
||||
.replace(/([\]0-9])\s+(?=")/u, "$1,");
|
||||
|
||||
try {
|
||||
const items = JSON.parse(`{${normalizedString}}`);
|
||||
@@ -254,15 +256,15 @@ class ConfigCommentParser {
|
||||
// Type Definitions
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/** @typedef {import("@eslint/core").VisitTraversalStep} VisitTraversalStep */
|
||||
/** @typedef {import("@eslint/core").CallTraversalStep} CallTraversalStep */
|
||||
/** @typedef {import("@eslint/core").TraversalStep} TraversalStep */
|
||||
/** @typedef {import("@eslint/core").SourceLocation} SourceLocation */
|
||||
/** @typedef {import("@eslint/core").SourceLocationWithOffset} SourceLocationWithOffset */
|
||||
/** @typedef {import("@eslint/core").SourceRange} SourceRange */
|
||||
/** @typedef {import("@eslint/core").Directive} IDirective */
|
||||
/** @typedef {import("@eslint/core").DirectiveType} DirectiveType */
|
||||
/** @typedef {import("@eslint/core").SourceCodeBaseTypeOptions} SourceCodeBaseTypeOptions */
|
||||
/** @typedef {$eslintcore.VisitTraversalStep} VisitTraversalStep */
|
||||
/** @typedef {$eslintcore.CallTraversalStep} CallTraversalStep */
|
||||
/** @typedef {$eslintcore.TraversalStep} TraversalStep */
|
||||
/** @typedef {$eslintcore.SourceLocation} SourceLocation */
|
||||
/** @typedef {$eslintcore.SourceLocationWithOffset} SourceLocationWithOffset */
|
||||
/** @typedef {$eslintcore.SourceRange} SourceRange */
|
||||
/** @typedef {$eslintcore.Directive} IDirective */
|
||||
/** @typedef {$eslintcore.DirectiveType} DirectiveType */
|
||||
/** @typedef {$eslintcore.SourceCodeBaseTypeOptions} SourceCodeBaseTypeOptions */
|
||||
/**
|
||||
* @typedef {import("@eslint/core").TextSourceCode<Options>} TextSourceCode<Options>
|
||||
* @template {SourceCodeBaseTypeOptions} [Options=SourceCodeBaseTypeOptions]
|
||||
@@ -308,6 +310,32 @@ function hasPosStyleRange(node) {
|
||||
return "position" in node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs binary search to find the line number containing a given target index.
|
||||
* Returns the lower bound - the index of the first element greater than the target.
|
||||
* **Please note that the `lineStartIndices` should be sorted in ascending order**.
|
||||
* - Time Complexity: O(log n) - Significantly faster than linear search for large files.
|
||||
* @param {number[]} lineStartIndices Sorted array of line start indices.
|
||||
* @param {number} targetIndex The target index to find the line number for.
|
||||
* @returns {number} The line number for the target index.
|
||||
*/
|
||||
function findLineNumberBinarySearch(lineStartIndices, targetIndex) {
|
||||
let low = 0;
|
||||
let high = lineStartIndices.length - 1;
|
||||
|
||||
while (low < high) {
|
||||
const mid = ((low + high) / 2) | 0; // Use bitwise OR to floor the division.
|
||||
|
||||
if (targetIndex < lineStartIndices[mid]) {
|
||||
high = mid;
|
||||
} else {
|
||||
low = mid + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return low;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Exports
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -461,7 +489,7 @@ class Directive {
|
||||
|
||||
/**
|
||||
* Source Code Base Object
|
||||
* @template {SourceCodeBaseTypeOptions & {SyntaxElementWithLoc: object}} [Options=SourceCodeBaseTypeOptions & {SyntaxElementWithLoc: object}]
|
||||
* @template {SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}} [Options=SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}]
|
||||
* @implements {TextSourceCode<Options>}
|
||||
*/
|
||||
class TextSourceCodeBase {
|
||||
@@ -469,7 +497,19 @@ class TextSourceCodeBase {
|
||||
* The lines of text in the source code.
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
#lines;
|
||||
#lines = [];
|
||||
|
||||
/**
|
||||
* The indices of the start of each line in the source code.
|
||||
* @type {Array<number>}
|
||||
*/
|
||||
#lineStartIndices = [0];
|
||||
|
||||
/**
|
||||
* The pattern to match lineEndings in the source code.
|
||||
* @type {RegExp}
|
||||
*/
|
||||
#lineEndingPattern;
|
||||
|
||||
/**
|
||||
* The AST of the source code.
|
||||
@@ -488,12 +528,105 @@ class TextSourceCodeBase {
|
||||
* @param {Object} options The options for the instance.
|
||||
* @param {string} options.text The source code text.
|
||||
* @param {Options['RootNode']} options.ast The root AST node.
|
||||
* @param {RegExp} [options.lineEndingPattern] The pattern to match lineEndings in the source code.
|
||||
* @param {RegExp} [options.lineEndingPattern] The pattern to match lineEndings in the source code. Defaults to `/\r?\n/u`.
|
||||
*/
|
||||
constructor({ text, ast, lineEndingPattern = /\r?\n/u }) {
|
||||
this.ast = ast;
|
||||
this.text = text;
|
||||
this.#lines = text.split(lineEndingPattern);
|
||||
// Remove the global(`g`) and sticky(`y`) flags from the `lineEndingPattern` to avoid issues with lastIndex.
|
||||
this.#lineEndingPattern = new RegExp(
|
||||
lineEndingPattern.source,
|
||||
lineEndingPattern.flags.replace(/[gy]/gu, ""),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the next line in the source text and updates `#lines` and `#lineStartIndices`.
|
||||
* @param {string} text The text to search for the next line.
|
||||
* @returns {boolean} `true` if a next line was found, `false` otherwise.
|
||||
*/
|
||||
#findNextLine(text) {
|
||||
const match = this.#lineEndingPattern.exec(text);
|
||||
|
||||
if (!match) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.#lines.push(text.slice(0, match.index));
|
||||
this.#lineStartIndices.push(
|
||||
(this.#lineStartIndices.at(-1) ?? 0) +
|
||||
match.index +
|
||||
match[0].length,
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures `#lines` is lazily calculated from the source text.
|
||||
* @returns {void}
|
||||
*/
|
||||
#ensureLines() {
|
||||
// If `#lines` has already been calculated, do nothing.
|
||||
if (this.#lines.length === this.#lineStartIndices.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
while (
|
||||
this.#findNextLine(this.text.slice(this.#lineStartIndices.at(-1)))
|
||||
) {
|
||||
// Continue parsing until no more matches are found.
|
||||
}
|
||||
|
||||
this.#lines.push(this.text.slice(this.#lineStartIndices.at(-1)));
|
||||
|
||||
Object.freeze(this.#lines);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures `#lineStartIndices` is lazily calculated up to the specified index.
|
||||
* @param {number} index The index of a character in a file.
|
||||
* @returns {void}
|
||||
*/
|
||||
#ensureLineStartIndicesFromIndex(index) {
|
||||
// If we've already parsed up to or beyond this index, do nothing.
|
||||
if (index <= (this.#lineStartIndices.at(-1) ?? 0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
while (
|
||||
index > (this.#lineStartIndices.at(-1) ?? 0) &&
|
||||
this.#findNextLine(this.text.slice(this.#lineStartIndices.at(-1)))
|
||||
) {
|
||||
// Continue parsing until no more matches are found.
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures `#lineStartIndices` is lazily calculated up to the specified loc.
|
||||
* @param {Object} loc A line/column location.
|
||||
* @param {number} loc.line The line number of the location. (0 or 1-indexed based on language.)
|
||||
* @param {number} lineStart The line number at which the parser starts counting.
|
||||
* @returns {void}
|
||||
*/
|
||||
#ensureLineStartIndicesFromLoc(loc, lineStart) {
|
||||
// Calculate line indices up to the potentially next line, as it is needed for the follow‑up calculation.
|
||||
const nextLocLineIndex = loc.line - lineStart + 1;
|
||||
const lastCalculatedLineIndex = this.#lineStartIndices.length - 1;
|
||||
let additionalLinesNeeded = nextLocLineIndex - lastCalculatedLineIndex;
|
||||
|
||||
// If we've already parsed up to or beyond this line, do nothing.
|
||||
if (additionalLinesNeeded <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
while (
|
||||
additionalLinesNeeded > 0 &&
|
||||
this.#findNextLine(this.text.slice(this.#lineStartIndices.at(-1)))
|
||||
) {
|
||||
// Continue parsing until no more matches are found or we have enough lines.
|
||||
additionalLinesNeeded -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -516,6 +649,135 @@ class TextSourceCodeBase {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a source text index into a `{ line: number, column: number }` pair.
|
||||
* @param {number} index The index of a character in a file.
|
||||
* @throws {TypeError|RangeError} If non-numeric index or index out of range.
|
||||
* @returns {{line: number, column: number}} A `{ line: number, column: number }` location object with 0 or 1-indexed line and 0 or 1-indexed column based on language.
|
||||
* @public
|
||||
*/
|
||||
getLocFromIndex(index) {
|
||||
if (typeof index !== "number") {
|
||||
throw new TypeError("Expected `index` to be a number.");
|
||||
}
|
||||
|
||||
if (index < 0 || index > this.text.length) {
|
||||
throw new RangeError(
|
||||
`Index out of range (requested index ${index}, but source text has length ${this.text.length}).`,
|
||||
);
|
||||
}
|
||||
|
||||
const {
|
||||
start: { line: lineStart, column: columnStart },
|
||||
end: { line: lineEnd, column: columnEnd },
|
||||
} = this.getLoc(this.ast);
|
||||
|
||||
// If the index is at the start, return the start location of the root node.
|
||||
if (index === 0) {
|
||||
return {
|
||||
line: lineStart,
|
||||
column: columnStart,
|
||||
};
|
||||
}
|
||||
|
||||
// If the index is `this.text.length`, return the location one "spot" past the last character of the file.
|
||||
if (index === this.text.length) {
|
||||
return {
|
||||
line: lineEnd,
|
||||
column: columnEnd,
|
||||
};
|
||||
}
|
||||
|
||||
// Ensure `#lineStartIndices` are lazily calculated.
|
||||
this.#ensureLineStartIndicesFromIndex(index);
|
||||
|
||||
/*
|
||||
* To figure out which line `index` is on, determine the last place at which index could
|
||||
* be inserted into `#lineStartIndices` to keep the list sorted.
|
||||
*/
|
||||
const lineNumber =
|
||||
(index >= (this.#lineStartIndices.at(-1) ?? 0)
|
||||
? this.#lineStartIndices.length
|
||||
: findLineNumberBinarySearch(this.#lineStartIndices, index)) -
|
||||
1 +
|
||||
lineStart;
|
||||
|
||||
return {
|
||||
line: lineNumber,
|
||||
column:
|
||||
index -
|
||||
this.#lineStartIndices[lineNumber - lineStart] +
|
||||
columnStart,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a `{ line: number, column: number }` pair into a source text index.
|
||||
* @param {Object} loc A line/column location.
|
||||
* @param {number} loc.line The line number of the location. (0 or 1-indexed based on language.)
|
||||
* @param {number} loc.column The column number of the location. (0 or 1-indexed based on language.)
|
||||
* @throws {TypeError|RangeError} If `loc` is not an object with a numeric
|
||||
* `line` and `column`, if the `line` is less than or equal to zero or
|
||||
* the `line` or `column` is out of the expected range.
|
||||
* @returns {number} The index of the line/column location in a file.
|
||||
* @public
|
||||
*/
|
||||
getIndexFromLoc(loc) {
|
||||
if (
|
||||
loc === null ||
|
||||
typeof loc !== "object" ||
|
||||
typeof loc.line !== "number" ||
|
||||
typeof loc.column !== "number"
|
||||
) {
|
||||
throw new TypeError(
|
||||
"Expected `loc` to be an object with numeric `line` and `column` properties.",
|
||||
);
|
||||
}
|
||||
|
||||
const {
|
||||
start: { line: lineStart, column: columnStart },
|
||||
end: { line: lineEnd, column: columnEnd },
|
||||
} = this.getLoc(this.ast);
|
||||
|
||||
if (loc.line < lineStart || lineEnd < loc.line) {
|
||||
throw new RangeError(
|
||||
`Line number out of range (line ${loc.line} requested). Valid range: ${lineStart}-${lineEnd}`,
|
||||
);
|
||||
}
|
||||
|
||||
// If the loc is at the start, return the start index of the root node.
|
||||
if (loc.line === lineStart && loc.column === columnStart) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// If the loc is at the end, return the index one "spot" past the last character of the file.
|
||||
if (loc.line === lineEnd && loc.column === columnEnd) {
|
||||
return this.text.length;
|
||||
}
|
||||
|
||||
// Ensure `#lineStartIndices` are lazily calculated.
|
||||
this.#ensureLineStartIndicesFromLoc(loc, lineStart);
|
||||
|
||||
const isLastLine = loc.line === lineEnd;
|
||||
const lineStartIndex = this.#lineStartIndices[loc.line - lineStart];
|
||||
const lineEndIndex = isLastLine
|
||||
? this.text.length
|
||||
: this.#lineStartIndices[loc.line - lineStart + 1];
|
||||
const positionIndex = lineStartIndex + loc.column - columnStart;
|
||||
|
||||
if (
|
||||
loc.column < columnStart ||
|
||||
(isLastLine && positionIndex > lineEndIndex) ||
|
||||
(!isLastLine && positionIndex >= lineEndIndex)
|
||||
) {
|
||||
throw new RangeError(
|
||||
`Column number out of range (column ${loc.column} requested). Valid range for line ${loc.line}: ${columnStart}-${lineEndIndex - lineStartIndex + columnStart + (isLastLine ? 0 : -1)}`,
|
||||
);
|
||||
}
|
||||
|
||||
return positionIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the range information for the given node or token.
|
||||
* @param {Options['SyntaxElementWithLoc']} nodeOrToken The node or token to get the range information for.
|
||||
@@ -601,6 +863,8 @@ class TextSourceCodeBase {
|
||||
* @public
|
||||
*/
|
||||
get lines() {
|
||||
this.#ensureLines(); // Ensure `#lines` is lazily calculated.
|
||||
|
||||
return this.#lines;
|
||||
}
|
||||
|
||||
|
||||
64
node_modules/@eslint/plugin-kit/dist/cjs/index.d.cts
generated
vendored
64
node_modules/@eslint/plugin-kit/dist/cjs/index.d.cts
generated
vendored
@@ -1,20 +1,20 @@
|
||||
export type VisitTraversalStep = import("@eslint/core").VisitTraversalStep;
|
||||
export type CallTraversalStep = import("@eslint/core").CallTraversalStep;
|
||||
export type TraversalStep = import("@eslint/core").TraversalStep;
|
||||
export type SourceLocation = import("@eslint/core").SourceLocation;
|
||||
export type SourceLocationWithOffset = import("@eslint/core").SourceLocationWithOffset;
|
||||
export type SourceRange = import("@eslint/core").SourceRange;
|
||||
export type IDirective = import("@eslint/core").Directive;
|
||||
export type DirectiveType = import("@eslint/core").DirectiveType;
|
||||
export type SourceCodeBaseTypeOptions = import("@eslint/core").SourceCodeBaseTypeOptions;
|
||||
export type VisitTraversalStep = $eslintcore.VisitTraversalStep;
|
||||
export type CallTraversalStep = $eslintcore.CallTraversalStep;
|
||||
export type TraversalStep = $eslintcore.TraversalStep;
|
||||
export type SourceLocation = $eslintcore.SourceLocation;
|
||||
export type SourceLocationWithOffset = $eslintcore.SourceLocationWithOffset;
|
||||
export type SourceRange = $eslintcore.SourceRange;
|
||||
export type IDirective = $eslintcore.Directive;
|
||||
export type DirectiveType = $eslintcore.DirectiveType;
|
||||
export type SourceCodeBaseTypeOptions = $eslintcore.SourceCodeBaseTypeOptions;
|
||||
/**
|
||||
* <Options>
|
||||
*/
|
||||
export type TextSourceCode<Options extends SourceCodeBaseTypeOptions = import("@eslint/core").SourceCodeBaseTypeOptions> = import("@eslint/core").TextSourceCode<Options>;
|
||||
export type RuleConfig = import("@eslint/core").RuleConfig;
|
||||
export type RulesConfig = import("@eslint/core").RulesConfig;
|
||||
export type StringConfig = import("./types.cts").StringConfig;
|
||||
export type BooleanConfig = import("./types.cts").BooleanConfig;
|
||||
export type TextSourceCode<Options extends SourceCodeBaseTypeOptions = $eslintcore.SourceCodeBaseTypeOptions> = import("@eslint/core").TextSourceCode<Options>;
|
||||
export type RuleConfig = $eslintcore.RuleConfig;
|
||||
export type RulesConfig = $eslintcore.RulesConfig;
|
||||
export type StringConfig = $typests.StringConfig;
|
||||
export type BooleanConfig = $typests.BooleanConfig;
|
||||
/**
|
||||
* A class to represent a step in the traversal process where a
|
||||
* method is called.
|
||||
@@ -141,12 +141,14 @@ export class Directive implements IDirective {
|
||||
}
|
||||
/**
|
||||
* Source Code Base Object
|
||||
* @template {SourceCodeBaseTypeOptions & {SyntaxElementWithLoc: object}} [Options=SourceCodeBaseTypeOptions & {SyntaxElementWithLoc: object}]
|
||||
* @template {SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}} [Options=SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}]
|
||||
* @implements {TextSourceCode<Options>}
|
||||
*/
|
||||
export class TextSourceCodeBase<Options extends SourceCodeBaseTypeOptions & {
|
||||
RootNode: object;
|
||||
SyntaxElementWithLoc: object;
|
||||
} = import("@eslint/core").SourceCodeBaseTypeOptions & {
|
||||
} = $eslintcore.SourceCodeBaseTypeOptions & {
|
||||
RootNode: object;
|
||||
SyntaxElementWithLoc: object;
|
||||
}> implements TextSourceCode<Options> {
|
||||
/**
|
||||
@@ -154,7 +156,7 @@ export class TextSourceCodeBase<Options extends SourceCodeBaseTypeOptions & {
|
||||
* @param {Object} options The options for the instance.
|
||||
* @param {string} options.text The source code text.
|
||||
* @param {Options['RootNode']} options.ast The root AST node.
|
||||
* @param {RegExp} [options.lineEndingPattern] The pattern to match lineEndings in the source code.
|
||||
* @param {RegExp} [options.lineEndingPattern] The pattern to match lineEndings in the source code. Defaults to `/\r?\n/u`.
|
||||
*/
|
||||
constructor({ text, ast, lineEndingPattern }: {
|
||||
text: string;
|
||||
@@ -178,6 +180,32 @@ export class TextSourceCodeBase<Options extends SourceCodeBaseTypeOptions & {
|
||||
* @throws {Error} If the node or token does not have loc information.
|
||||
*/
|
||||
getLoc(nodeOrToken: Options["SyntaxElementWithLoc"]): SourceLocation;
|
||||
/**
|
||||
* Converts a source text index into a `{ line: number, column: number }` pair.
|
||||
* @param {number} index The index of a character in a file.
|
||||
* @throws {TypeError|RangeError} If non-numeric index or index out of range.
|
||||
* @returns {{line: number, column: number}} A `{ line: number, column: number }` location object with 0 or 1-indexed line and 0 or 1-indexed column based on language.
|
||||
* @public
|
||||
*/
|
||||
public getLocFromIndex(index: number): {
|
||||
line: number;
|
||||
column: number;
|
||||
};
|
||||
/**
|
||||
* Converts a `{ line: number, column: number }` pair into a source text index.
|
||||
* @param {Object} loc A line/column location.
|
||||
* @param {number} loc.line The line number of the location. (0 or 1-indexed based on language.)
|
||||
* @param {number} loc.column The column number of the location. (0 or 1-indexed based on language.)
|
||||
* @throws {TypeError|RangeError} If `loc` is not an object with a numeric
|
||||
* `line` and `column`, if the `line` is less than or equal to zero or
|
||||
* the `line` or `column` is out of the expected range.
|
||||
* @returns {number} The index of the line/column location in a file.
|
||||
* @public
|
||||
*/
|
||||
public getIndexFromLoc(loc: {
|
||||
line: number;
|
||||
column: number;
|
||||
}): number;
|
||||
/**
|
||||
* Returns the range information for the given node or token.
|
||||
* @param {Options['SyntaxElementWithLoc']} nodeOrToken The node or token to get the range information for.
|
||||
@@ -268,6 +296,8 @@ export class VisitNodeStep implements VisitTraversalStep {
|
||||
*/
|
||||
args: Array<any>;
|
||||
}
|
||||
import type * as $eslintcore from "@eslint/core";
|
||||
import type * as $typests from "./types.cts";
|
||||
/**
|
||||
* Represents a directive comment.
|
||||
*/
|
||||
|
||||
64
node_modules/@eslint/plugin-kit/dist/esm/index.d.ts
generated
vendored
64
node_modules/@eslint/plugin-kit/dist/esm/index.d.ts
generated
vendored
@@ -1,20 +1,20 @@
|
||||
export type VisitTraversalStep = import("@eslint/core").VisitTraversalStep;
|
||||
export type CallTraversalStep = import("@eslint/core").CallTraversalStep;
|
||||
export type TraversalStep = import("@eslint/core").TraversalStep;
|
||||
export type SourceLocation = import("@eslint/core").SourceLocation;
|
||||
export type SourceLocationWithOffset = import("@eslint/core").SourceLocationWithOffset;
|
||||
export type SourceRange = import("@eslint/core").SourceRange;
|
||||
export type IDirective = import("@eslint/core").Directive;
|
||||
export type DirectiveType = import("@eslint/core").DirectiveType;
|
||||
export type SourceCodeBaseTypeOptions = import("@eslint/core").SourceCodeBaseTypeOptions;
|
||||
export type VisitTraversalStep = $eslintcore.VisitTraversalStep;
|
||||
export type CallTraversalStep = $eslintcore.CallTraversalStep;
|
||||
export type TraversalStep = $eslintcore.TraversalStep;
|
||||
export type SourceLocation = $eslintcore.SourceLocation;
|
||||
export type SourceLocationWithOffset = $eslintcore.SourceLocationWithOffset;
|
||||
export type SourceRange = $eslintcore.SourceRange;
|
||||
export type IDirective = $eslintcore.Directive;
|
||||
export type DirectiveType = $eslintcore.DirectiveType;
|
||||
export type SourceCodeBaseTypeOptions = $eslintcore.SourceCodeBaseTypeOptions;
|
||||
/**
|
||||
* <Options>
|
||||
*/
|
||||
export type TextSourceCode<Options extends SourceCodeBaseTypeOptions = import("@eslint/core").SourceCodeBaseTypeOptions> = import("@eslint/core").TextSourceCode<Options>;
|
||||
export type RuleConfig = import("@eslint/core").RuleConfig;
|
||||
export type RulesConfig = import("@eslint/core").RulesConfig;
|
||||
export type StringConfig = import("./types.ts").StringConfig;
|
||||
export type BooleanConfig = import("./types.ts").BooleanConfig;
|
||||
export type TextSourceCode<Options extends SourceCodeBaseTypeOptions = $eslintcore.SourceCodeBaseTypeOptions> = import("@eslint/core").TextSourceCode<Options>;
|
||||
export type RuleConfig = $eslintcore.RuleConfig;
|
||||
export type RulesConfig = $eslintcore.RulesConfig;
|
||||
export type StringConfig = $typests.StringConfig;
|
||||
export type BooleanConfig = $typests.BooleanConfig;
|
||||
/**
|
||||
* A class to represent a step in the traversal process where a
|
||||
* method is called.
|
||||
@@ -141,12 +141,14 @@ export class Directive implements IDirective {
|
||||
}
|
||||
/**
|
||||
* Source Code Base Object
|
||||
* @template {SourceCodeBaseTypeOptions & {SyntaxElementWithLoc: object}} [Options=SourceCodeBaseTypeOptions & {SyntaxElementWithLoc: object}]
|
||||
* @template {SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}} [Options=SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}]
|
||||
* @implements {TextSourceCode<Options>}
|
||||
*/
|
||||
export class TextSourceCodeBase<Options extends SourceCodeBaseTypeOptions & {
|
||||
RootNode: object;
|
||||
SyntaxElementWithLoc: object;
|
||||
} = import("@eslint/core").SourceCodeBaseTypeOptions & {
|
||||
} = $eslintcore.SourceCodeBaseTypeOptions & {
|
||||
RootNode: object;
|
||||
SyntaxElementWithLoc: object;
|
||||
}> implements TextSourceCode<Options> {
|
||||
/**
|
||||
@@ -154,7 +156,7 @@ export class TextSourceCodeBase<Options extends SourceCodeBaseTypeOptions & {
|
||||
* @param {Object} options The options for the instance.
|
||||
* @param {string} options.text The source code text.
|
||||
* @param {Options['RootNode']} options.ast The root AST node.
|
||||
* @param {RegExp} [options.lineEndingPattern] The pattern to match lineEndings in the source code.
|
||||
* @param {RegExp} [options.lineEndingPattern] The pattern to match lineEndings in the source code. Defaults to `/\r?\n/u`.
|
||||
*/
|
||||
constructor({ text, ast, lineEndingPattern }: {
|
||||
text: string;
|
||||
@@ -178,6 +180,32 @@ export class TextSourceCodeBase<Options extends SourceCodeBaseTypeOptions & {
|
||||
* @throws {Error} If the node or token does not have loc information.
|
||||
*/
|
||||
getLoc(nodeOrToken: Options["SyntaxElementWithLoc"]): SourceLocation;
|
||||
/**
|
||||
* Converts a source text index into a `{ line: number, column: number }` pair.
|
||||
* @param {number} index The index of a character in a file.
|
||||
* @throws {TypeError|RangeError} If non-numeric index or index out of range.
|
||||
* @returns {{line: number, column: number}} A `{ line: number, column: number }` location object with 0 or 1-indexed line and 0 or 1-indexed column based on language.
|
||||
* @public
|
||||
*/
|
||||
public getLocFromIndex(index: number): {
|
||||
line: number;
|
||||
column: number;
|
||||
};
|
||||
/**
|
||||
* Converts a `{ line: number, column: number }` pair into a source text index.
|
||||
* @param {Object} loc A line/column location.
|
||||
* @param {number} loc.line The line number of the location. (0 or 1-indexed based on language.)
|
||||
* @param {number} loc.column The column number of the location. (0 or 1-indexed based on language.)
|
||||
* @throws {TypeError|RangeError} If `loc` is not an object with a numeric
|
||||
* `line` and `column`, if the `line` is less than or equal to zero or
|
||||
* the `line` or `column` is out of the expected range.
|
||||
* @returns {number} The index of the line/column location in a file.
|
||||
* @public
|
||||
*/
|
||||
public getIndexFromLoc(loc: {
|
||||
line: number;
|
||||
column: number;
|
||||
}): number;
|
||||
/**
|
||||
* Returns the range information for the given node or token.
|
||||
* @param {Options['SyntaxElementWithLoc']} nodeOrToken The node or token to get the range information for.
|
||||
@@ -268,6 +296,8 @@ export class VisitNodeStep implements VisitTraversalStep {
|
||||
*/
|
||||
args: Array<any>;
|
||||
}
|
||||
import type * as $eslintcore from "@eslint/core";
|
||||
import type * as $typests from "./types.ts";
|
||||
/**
|
||||
* Represents a directive comment.
|
||||
*/
|
||||
|
||||
300
node_modules/@eslint/plugin-kit/dist/esm/index.js
generated
vendored
300
node_modules/@eslint/plugin-kit/dist/esm/index.js
generated
vendored
@@ -11,10 +11,12 @@ import levn from 'levn';
|
||||
// Type Definitions
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/** @typedef {import("@eslint/core").RuleConfig} RuleConfig */
|
||||
/** @typedef {import("@eslint/core").RulesConfig} RulesConfig */
|
||||
/** @typedef {import("./types.ts").StringConfig} StringConfig */
|
||||
/** @typedef {import("./types.ts").BooleanConfig} BooleanConfig */
|
||||
/** @import * as $eslintcore from "@eslint/core"; */
|
||||
/** @typedef {$eslintcore.RuleConfig} RuleConfig */
|
||||
/** @typedef {$eslintcore.RulesConfig} RulesConfig */
|
||||
/** @import * as $typests from "./types.ts"; */
|
||||
/** @typedef {$typests.StringConfig} StringConfig */
|
||||
/** @typedef {$typests.BooleanConfig} BooleanConfig */
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Helpers
|
||||
@@ -152,7 +154,7 @@ class ConfigCommentParser {
|
||||
*/
|
||||
const normalizedString = string
|
||||
.replace(/(?<![-a-zA-Z0-9/])([-a-zA-Z0-9/]+):/gu, '"$1":')
|
||||
.replace(/(\]|[0-9])\s+(?=")/u, "$1,");
|
||||
.replace(/([\]0-9])\s+(?=")/u, "$1,");
|
||||
|
||||
try {
|
||||
const items = JSON.parse(`{${normalizedString}}`);
|
||||
@@ -253,15 +255,15 @@ class ConfigCommentParser {
|
||||
// Type Definitions
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
/** @typedef {import("@eslint/core").VisitTraversalStep} VisitTraversalStep */
|
||||
/** @typedef {import("@eslint/core").CallTraversalStep} CallTraversalStep */
|
||||
/** @typedef {import("@eslint/core").TraversalStep} TraversalStep */
|
||||
/** @typedef {import("@eslint/core").SourceLocation} SourceLocation */
|
||||
/** @typedef {import("@eslint/core").SourceLocationWithOffset} SourceLocationWithOffset */
|
||||
/** @typedef {import("@eslint/core").SourceRange} SourceRange */
|
||||
/** @typedef {import("@eslint/core").Directive} IDirective */
|
||||
/** @typedef {import("@eslint/core").DirectiveType} DirectiveType */
|
||||
/** @typedef {import("@eslint/core").SourceCodeBaseTypeOptions} SourceCodeBaseTypeOptions */
|
||||
/** @typedef {$eslintcore.VisitTraversalStep} VisitTraversalStep */
|
||||
/** @typedef {$eslintcore.CallTraversalStep} CallTraversalStep */
|
||||
/** @typedef {$eslintcore.TraversalStep} TraversalStep */
|
||||
/** @typedef {$eslintcore.SourceLocation} SourceLocation */
|
||||
/** @typedef {$eslintcore.SourceLocationWithOffset} SourceLocationWithOffset */
|
||||
/** @typedef {$eslintcore.SourceRange} SourceRange */
|
||||
/** @typedef {$eslintcore.Directive} IDirective */
|
||||
/** @typedef {$eslintcore.DirectiveType} DirectiveType */
|
||||
/** @typedef {$eslintcore.SourceCodeBaseTypeOptions} SourceCodeBaseTypeOptions */
|
||||
/**
|
||||
* @typedef {import("@eslint/core").TextSourceCode<Options>} TextSourceCode<Options>
|
||||
* @template {SourceCodeBaseTypeOptions} [Options=SourceCodeBaseTypeOptions]
|
||||
@@ -307,6 +309,32 @@ function hasPosStyleRange(node) {
|
||||
return "position" in node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs binary search to find the line number containing a given target index.
|
||||
* Returns the lower bound - the index of the first element greater than the target.
|
||||
* **Please note that the `lineStartIndices` should be sorted in ascending order**.
|
||||
* - Time Complexity: O(log n) - Significantly faster than linear search for large files.
|
||||
* @param {number[]} lineStartIndices Sorted array of line start indices.
|
||||
* @param {number} targetIndex The target index to find the line number for.
|
||||
* @returns {number} The line number for the target index.
|
||||
*/
|
||||
function findLineNumberBinarySearch(lineStartIndices, targetIndex) {
|
||||
let low = 0;
|
||||
let high = lineStartIndices.length - 1;
|
||||
|
||||
while (low < high) {
|
||||
const mid = ((low + high) / 2) | 0; // Use bitwise OR to floor the division.
|
||||
|
||||
if (targetIndex < lineStartIndices[mid]) {
|
||||
high = mid;
|
||||
} else {
|
||||
low = mid + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return low;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Exports
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -460,7 +488,7 @@ class Directive {
|
||||
|
||||
/**
|
||||
* Source Code Base Object
|
||||
* @template {SourceCodeBaseTypeOptions & {SyntaxElementWithLoc: object}} [Options=SourceCodeBaseTypeOptions & {SyntaxElementWithLoc: object}]
|
||||
* @template {SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}} [Options=SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}]
|
||||
* @implements {TextSourceCode<Options>}
|
||||
*/
|
||||
class TextSourceCodeBase {
|
||||
@@ -468,7 +496,19 @@ class TextSourceCodeBase {
|
||||
* The lines of text in the source code.
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
#lines;
|
||||
#lines = [];
|
||||
|
||||
/**
|
||||
* The indices of the start of each line in the source code.
|
||||
* @type {Array<number>}
|
||||
*/
|
||||
#lineStartIndices = [0];
|
||||
|
||||
/**
|
||||
* The pattern to match lineEndings in the source code.
|
||||
* @type {RegExp}
|
||||
*/
|
||||
#lineEndingPattern;
|
||||
|
||||
/**
|
||||
* The AST of the source code.
|
||||
@@ -487,12 +527,105 @@ class TextSourceCodeBase {
|
||||
* @param {Object} options The options for the instance.
|
||||
* @param {string} options.text The source code text.
|
||||
* @param {Options['RootNode']} options.ast The root AST node.
|
||||
* @param {RegExp} [options.lineEndingPattern] The pattern to match lineEndings in the source code.
|
||||
* @param {RegExp} [options.lineEndingPattern] The pattern to match lineEndings in the source code. Defaults to `/\r?\n/u`.
|
||||
*/
|
||||
constructor({ text, ast, lineEndingPattern = /\r?\n/u }) {
|
||||
this.ast = ast;
|
||||
this.text = text;
|
||||
this.#lines = text.split(lineEndingPattern);
|
||||
// Remove the global(`g`) and sticky(`y`) flags from the `lineEndingPattern` to avoid issues with lastIndex.
|
||||
this.#lineEndingPattern = new RegExp(
|
||||
lineEndingPattern.source,
|
||||
lineEndingPattern.flags.replace(/[gy]/gu, ""),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the next line in the source text and updates `#lines` and `#lineStartIndices`.
|
||||
* @param {string} text The text to search for the next line.
|
||||
* @returns {boolean} `true` if a next line was found, `false` otherwise.
|
||||
*/
|
||||
#findNextLine(text) {
|
||||
const match = this.#lineEndingPattern.exec(text);
|
||||
|
||||
if (!match) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.#lines.push(text.slice(0, match.index));
|
||||
this.#lineStartIndices.push(
|
||||
(this.#lineStartIndices.at(-1) ?? 0) +
|
||||
match.index +
|
||||
match[0].length,
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures `#lines` is lazily calculated from the source text.
|
||||
* @returns {void}
|
||||
*/
|
||||
#ensureLines() {
|
||||
// If `#lines` has already been calculated, do nothing.
|
||||
if (this.#lines.length === this.#lineStartIndices.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
while (
|
||||
this.#findNextLine(this.text.slice(this.#lineStartIndices.at(-1)))
|
||||
) {
|
||||
// Continue parsing until no more matches are found.
|
||||
}
|
||||
|
||||
this.#lines.push(this.text.slice(this.#lineStartIndices.at(-1)));
|
||||
|
||||
Object.freeze(this.#lines);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures `#lineStartIndices` is lazily calculated up to the specified index.
|
||||
* @param {number} index The index of a character in a file.
|
||||
* @returns {void}
|
||||
*/
|
||||
#ensureLineStartIndicesFromIndex(index) {
|
||||
// If we've already parsed up to or beyond this index, do nothing.
|
||||
if (index <= (this.#lineStartIndices.at(-1) ?? 0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
while (
|
||||
index > (this.#lineStartIndices.at(-1) ?? 0) &&
|
||||
this.#findNextLine(this.text.slice(this.#lineStartIndices.at(-1)))
|
||||
) {
|
||||
// Continue parsing until no more matches are found.
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures `#lineStartIndices` is lazily calculated up to the specified loc.
|
||||
* @param {Object} loc A line/column location.
|
||||
* @param {number} loc.line The line number of the location. (0 or 1-indexed based on language.)
|
||||
* @param {number} lineStart The line number at which the parser starts counting.
|
||||
* @returns {void}
|
||||
*/
|
||||
#ensureLineStartIndicesFromLoc(loc, lineStart) {
|
||||
// Calculate line indices up to the potentially next line, as it is needed for the follow‑up calculation.
|
||||
const nextLocLineIndex = loc.line - lineStart + 1;
|
||||
const lastCalculatedLineIndex = this.#lineStartIndices.length - 1;
|
||||
let additionalLinesNeeded = nextLocLineIndex - lastCalculatedLineIndex;
|
||||
|
||||
// If we've already parsed up to or beyond this line, do nothing.
|
||||
if (additionalLinesNeeded <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
while (
|
||||
additionalLinesNeeded > 0 &&
|
||||
this.#findNextLine(this.text.slice(this.#lineStartIndices.at(-1)))
|
||||
) {
|
||||
// Continue parsing until no more matches are found or we have enough lines.
|
||||
additionalLinesNeeded -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -515,6 +648,135 @@ class TextSourceCodeBase {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a source text index into a `{ line: number, column: number }` pair.
|
||||
* @param {number} index The index of a character in a file.
|
||||
* @throws {TypeError|RangeError} If non-numeric index or index out of range.
|
||||
* @returns {{line: number, column: number}} A `{ line: number, column: number }` location object with 0 or 1-indexed line and 0 or 1-indexed column based on language.
|
||||
* @public
|
||||
*/
|
||||
getLocFromIndex(index) {
|
||||
if (typeof index !== "number") {
|
||||
throw new TypeError("Expected `index` to be a number.");
|
||||
}
|
||||
|
||||
if (index < 0 || index > this.text.length) {
|
||||
throw new RangeError(
|
||||
`Index out of range (requested index ${index}, but source text has length ${this.text.length}).`,
|
||||
);
|
||||
}
|
||||
|
||||
const {
|
||||
start: { line: lineStart, column: columnStart },
|
||||
end: { line: lineEnd, column: columnEnd },
|
||||
} = this.getLoc(this.ast);
|
||||
|
||||
// If the index is at the start, return the start location of the root node.
|
||||
if (index === 0) {
|
||||
return {
|
||||
line: lineStart,
|
||||
column: columnStart,
|
||||
};
|
||||
}
|
||||
|
||||
// If the index is `this.text.length`, return the location one "spot" past the last character of the file.
|
||||
if (index === this.text.length) {
|
||||
return {
|
||||
line: lineEnd,
|
||||
column: columnEnd,
|
||||
};
|
||||
}
|
||||
|
||||
// Ensure `#lineStartIndices` are lazily calculated.
|
||||
this.#ensureLineStartIndicesFromIndex(index);
|
||||
|
||||
/*
|
||||
* To figure out which line `index` is on, determine the last place at which index could
|
||||
* be inserted into `#lineStartIndices` to keep the list sorted.
|
||||
*/
|
||||
const lineNumber =
|
||||
(index >= (this.#lineStartIndices.at(-1) ?? 0)
|
||||
? this.#lineStartIndices.length
|
||||
: findLineNumberBinarySearch(this.#lineStartIndices, index)) -
|
||||
1 +
|
||||
lineStart;
|
||||
|
||||
return {
|
||||
line: lineNumber,
|
||||
column:
|
||||
index -
|
||||
this.#lineStartIndices[lineNumber - lineStart] +
|
||||
columnStart,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a `{ line: number, column: number }` pair into a source text index.
|
||||
* @param {Object} loc A line/column location.
|
||||
* @param {number} loc.line The line number of the location. (0 or 1-indexed based on language.)
|
||||
* @param {number} loc.column The column number of the location. (0 or 1-indexed based on language.)
|
||||
* @throws {TypeError|RangeError} If `loc` is not an object with a numeric
|
||||
* `line` and `column`, if the `line` is less than or equal to zero or
|
||||
* the `line` or `column` is out of the expected range.
|
||||
* @returns {number} The index of the line/column location in a file.
|
||||
* @public
|
||||
*/
|
||||
getIndexFromLoc(loc) {
|
||||
if (
|
||||
loc === null ||
|
||||
typeof loc !== "object" ||
|
||||
typeof loc.line !== "number" ||
|
||||
typeof loc.column !== "number"
|
||||
) {
|
||||
throw new TypeError(
|
||||
"Expected `loc` to be an object with numeric `line` and `column` properties.",
|
||||
);
|
||||
}
|
||||
|
||||
const {
|
||||
start: { line: lineStart, column: columnStart },
|
||||
end: { line: lineEnd, column: columnEnd },
|
||||
} = this.getLoc(this.ast);
|
||||
|
||||
if (loc.line < lineStart || lineEnd < loc.line) {
|
||||
throw new RangeError(
|
||||
`Line number out of range (line ${loc.line} requested). Valid range: ${lineStart}-${lineEnd}`,
|
||||
);
|
||||
}
|
||||
|
||||
// If the loc is at the start, return the start index of the root node.
|
||||
if (loc.line === lineStart && loc.column === columnStart) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// If the loc is at the end, return the index one "spot" past the last character of the file.
|
||||
if (loc.line === lineEnd && loc.column === columnEnd) {
|
||||
return this.text.length;
|
||||
}
|
||||
|
||||
// Ensure `#lineStartIndices` are lazily calculated.
|
||||
this.#ensureLineStartIndicesFromLoc(loc, lineStart);
|
||||
|
||||
const isLastLine = loc.line === lineEnd;
|
||||
const lineStartIndex = this.#lineStartIndices[loc.line - lineStart];
|
||||
const lineEndIndex = isLastLine
|
||||
? this.text.length
|
||||
: this.#lineStartIndices[loc.line - lineStart + 1];
|
||||
const positionIndex = lineStartIndex + loc.column - columnStart;
|
||||
|
||||
if (
|
||||
loc.column < columnStart ||
|
||||
(isLastLine && positionIndex > lineEndIndex) ||
|
||||
(!isLastLine && positionIndex >= lineEndIndex)
|
||||
) {
|
||||
throw new RangeError(
|
||||
`Column number out of range (column ${loc.column} requested). Valid range for line ${loc.line}: ${columnStart}-${lineEndIndex - lineStartIndex + columnStart + (isLastLine ? 0 : -1)}`,
|
||||
);
|
||||
}
|
||||
|
||||
return positionIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the range information for the given node or token.
|
||||
* @param {Options['SyntaxElementWithLoc']} nodeOrToken The node or token to get the range information for.
|
||||
@@ -600,6 +862,8 @@ class TextSourceCodeBase {
|
||||
* @public
|
||||
*/
|
||||
get lines() {
|
||||
this.#ensureLines(); // Ensure `#lines` is lazily calculated.
|
||||
|
||||
return this.#lines;
|
||||
}
|
||||
|
||||
|
||||
6
node_modules/@eslint/plugin-kit/package.json
generated
vendored
6
node_modules/@eslint/plugin-kit/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@eslint/plugin-kit",
|
||||
"version": "0.3.5",
|
||||
"version": "0.4.1",
|
||||
"description": "Utilities for building ESLint plugins.",
|
||||
"author": "Nicholas C. Zakas",
|
||||
"type": "module",
|
||||
@@ -36,7 +36,7 @@
|
||||
"build:cts": "node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts",
|
||||
"build": "rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:cts",
|
||||
"pretest": "npm run build",
|
||||
"test": "mocha tests/",
|
||||
"test": "mocha \"tests/**/*.test.js\"",
|
||||
"test:coverage": "c8 npm test",
|
||||
"test:jsr": "npx jsr@latest publish --dry-run",
|
||||
"test:types": "tsc -p tests/types/tsconfig.json"
|
||||
@@ -48,7 +48,7 @@
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@eslint/core": "^0.15.2",
|
||||
"@eslint/core": "^0.17.0",
|
||||
"levn": "^0.4.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
Reference in New Issue
Block a user