New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eslint-flat-config-utils

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-flat-config-utils - npm Package Compare versions

Comparing version 0.1.2 to 0.2.0

50

dist/index.d.ts

@@ -90,7 +90,7 @@ import { Linter } from 'eslint';

/**
* Awaitable array of ESLint flat configs or a pipeline object.
* Awaitable array of ESLint flat configs or a composer object.
*/
type ResolvableFlatConfig<T extends FlatConfigItem = FlatConfigItem> = Awaitable<Arrayable<T>> | Awaitable<FlatConfigItem[]>;
/**
* Create a chainable pipeline object that makes manipulating ESLint flat config easier.
* Create a chainable composer object that makes manipulating ESLint flat config easier.
*

@@ -101,5 +101,5 @@ * It extends Promise, so that you can directly await or export it to `eslint.config.mjs`

* // eslint.config.mjs
* import { pipe } from 'eslint-flat-config-utils'
* import { composer } from 'eslint-flat-config-utils'
*
* export default pipe(
* export default composer(
* {

@@ -138,12 +138,10 @@ * plugins: {},

*
* // And you an directly return the pipeline object to `eslint.config.mjs`
* // And you an directly return the composer object to `eslint.config.mjs`
* ```
*/
declare function pipe<T extends FlatConfigItem = FlatConfigItem>(...configs: ResolvableFlatConfig<FlatConfigItem extends T ? T : FlatConfigItem>[]): FlatConfigPipeline<FlatConfigItem extends T ? T : FlatConfigItem>;
declare function composer<T extends FlatConfigItem = FlatConfigItem>(...configs: ResolvableFlatConfig<FlatConfigItem extends T ? T : FlatConfigItem>[]): FlatConfigComposer<FlatConfigItem extends T ? T : FlatConfigItem>;
/**
* The underlying impolementation of `pipe()`.
*
* You don't need to use this class directly.
* The underlying impolementation of `composer()`.
*/
declare class FlatConfigPipeline<T extends object = FlatConfigItem, ConfigNames extends string = string> extends Promise<T[]> {
declare class FlatConfigComposer<T extends object = FlatConfigItem, ConfigNames extends string = string> extends Promise<T[]> {
private _operations;

@@ -153,3 +151,3 @@ private _operationsOverrides;

private _renames;
constructor();
constructor(...configs: ResolvableFlatConfig<T>[]);
/**

@@ -215,3 +213,31 @@ * Set plugin renames, like `n` -> `node`, `import-x` -> `import`, etc.

}
/**
* @deprecated Renamed to `composer`.
*/
declare const pipe: typeof composer;
/**
* @deprecated Renamed to `FlatConfigComposer`.
*/
declare class FlatConfigPipeline extends FlatConfigComposer {
}
export { type Arrayable, type Awaitable, type FlatConfigItem, FlatConfigPipeline, type ResolvableFlatConfig, concat, defineFlatConfig, mergeConfigs, pipe, renamePluginsInConfigs, renamePluginsInRules };
/**
* Extend another flat configs and rename globs paths.
*
* @example
* ```ts
* import { extend } from 'eslint-flat-config-utils'
*
* export default [
* ...await extend(
* // configs to extend
* import('./other-configs/eslint.config.js').then(m => m.default),
* // relative directory path
* 'other-configs/',
* ),
* ]
* ```
*/
declare function extend(configs: Awaitable<FlatConfigItem[]>, relativePath: string): Promise<FlatConfigItem[]>;
export { type Arrayable, type Awaitable, FlatConfigComposer, type FlatConfigItem, FlatConfigPipeline, type ResolvableFlatConfig, composer, concat, defineFlatConfig, extend, mergeConfigs, pipe, renamePluginsInConfigs, renamePluginsInRules };
{
"name": "eslint-flat-config-utils",
"type": "module",
"version": "0.1.2",
"version": "0.2.0",
"packageManager": "pnpm@8.15.5",

@@ -54,3 +54,4 @@ "description": "Utils for managing and manipulating ESLint flat config arrays",

"dependencies": {
"@types/eslint": "^8.56.6"
"@types/eslint": "^8.56.6",
"pathe": "^1.1.2"
},

@@ -57,0 +58,0 @@ "devDependencies": {

@@ -55,5 +55,5 @@ # eslint-flat-config-utils

### `pipe`
### `composer`
Create a chainable pipeline object that makes manipulating ESLint flat config easier.
Create a chainable composer that makes manipulating ESLint flat config easier.

@@ -64,5 +64,5 @@ It extends Promise, so that you can directly await or export it to `eslint.config.mjs`

// eslint.config.mjs
import { pipe } from 'eslint-flat-config-utils'
import { composer } from 'eslint-flat-config-utils'
export default pipe(
export default composer(
{

@@ -101,5 +101,20 @@ plugins: {},

// And you can directly return the pipeline object to `eslint.config.mjs`
// And you can directly return the composer object to `eslint.config.mjs`
```
### `extend`
Extend another flat config from a different root, and rewrite the glob paths accordingly:
```ts
import { extend } from 'eslint-flat-config-utils'
export default [
...await extend(
import('./sub-package/eslint.config.mjs'),
'./sub-package/'
)
]
```
## Sponsors

@@ -106,0 +121,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc