docs: 📚️ add missing documentations
This commit is contained in:
42
packages/config/index.d.ts
vendored
42
packages/config/index.d.ts
vendored
@@ -1,17 +1,53 @@
|
||||
import type { EnvOptions } from './src/types';
|
||||
import type { Config, EnvOptions } from './src/types';
|
||||
import type { Linter } from 'eslint';
|
||||
|
||||
export async function defineConfig(config: Linter.FlatConfig[], environment?: EnvOptions): Promise<Linter.FlatConfig[]>;
|
||||
/**
|
||||
* Helper functions for creating/configuring ESLint.
|
||||
*
|
||||
* @param config - Array or function returning an array of ESLint's configuration objects array to be used.
|
||||
* @param environment - An object with environment variables to be declared and used by the configuration.
|
||||
* @returns The array of ESLint's configuration objects.
|
||||
*/
|
||||
export async function defineConfig(config: Config, environment?: EnvOptions): Promise<Linter.FlatConfig[]>;
|
||||
|
||||
export const configs: Readonly<{
|
||||
/**
|
||||
* **This configuration is necessary to be used before any other one**.
|
||||
* Common configuration for using ESLit rules overrides.
|
||||
*/
|
||||
common: Linter.FlatConfig
|
||||
/**
|
||||
* Recommended configuration overrides of ESLit
|
||||
*/
|
||||
recommended: Linter.FlatConfig
|
||||
/**
|
||||
* Formatting rules/configuration overrides for Javascript and Typescript
|
||||
*/
|
||||
formatting: Linter.FlatConfig
|
||||
/**
|
||||
* Typescript specific configuration overrides
|
||||
*/
|
||||
typescript: Linter.FlatConfig
|
||||
/**
|
||||
* Configuration objects for different development environments.
|
||||
*/
|
||||
environments: {
|
||||
deno: Linter.FlatConfig
|
||||
/**
|
||||
* Configuration for Node development environment
|
||||
*/
|
||||
node: Linter.FlatConfig
|
||||
/**
|
||||
* Configuration for Deno development environment
|
||||
*/
|
||||
deno: Linter.FlatConfig
|
||||
/**
|
||||
* Configuration for browser development environment
|
||||
*/
|
||||
browser: Linter.FlatConfig
|
||||
}
|
||||
/**
|
||||
* JSDoc rules overrides
|
||||
*/
|
||||
jsdoc: Linter.FlatConfig
|
||||
}>;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import tsParser from '@typescript-eslint/parser';
|
||||
import jsdoc from 'eslint-plugin-jsdoc';
|
||||
|
||||
/**
|
||||
* **This configuration is necessary to be used before any other one**.
|
||||
* Common configuration for using ESLit rules overrides.
|
||||
*
|
||||
* @type {Readonly<import('eslint').Linter.FlatConfig>}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import globals from 'globals';
|
||||
|
||||
/** @type {import('eslint').Linter.FlatConfig} */
|
||||
/**
|
||||
* Configuration for Node development environment
|
||||
*
|
||||
* @type {import('eslint').Linter.FlatConfig}
|
||||
*/
|
||||
const node = {
|
||||
files: ['**/*.js', '**/*.cjs', '**/*.mjs', '**/*.ts', '**/*.cts', '**/*.mts'],
|
||||
languageOptions: {
|
||||
@@ -10,7 +14,11 @@ const node = {
|
||||
},
|
||||
};
|
||||
|
||||
/** @type {import('eslint').Linter.FlatConfig} */
|
||||
/**
|
||||
* Configuration for Deno development environment
|
||||
*
|
||||
* @type {import('eslint').Linter.FlatConfig}
|
||||
*/
|
||||
const deno = {
|
||||
files: ['**/*.js', '**/*.ts'],
|
||||
languageOptions: {
|
||||
@@ -21,6 +29,11 @@ const deno = {
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Configuration for browser development environment
|
||||
*
|
||||
* @type {import('eslint').Linter.FlatConfig}
|
||||
*/
|
||||
const browser = {
|
||||
files: ['**/*.js', '**/*.ts'],
|
||||
languageOptions: {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { eslintrc } from './eslintrc-compact.js';
|
||||
|
||||
/**
|
||||
* @param {import('./types').Config} config
|
||||
* Array or functions returning an array of ESLint's configuration objects array to be used.
|
||||
* Array or function returning an array of ESLint's configuration objects array to be used.
|
||||
*
|
||||
* @param {import('./types').EnvOptions | undefined} environment
|
||||
* An object with environment variables to be declared and used by the configuration.
|
||||
|
||||
Reference in New Issue
Block a user