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:
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[];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user