This commit is contained in:
Alex
2024-08-11 17:32:54 -04:00
parent afb93c4971
commit 191848fdca
15 changed files with 151 additions and 84 deletions

View File

@ -10,8 +10,9 @@ import { importTypeScript } from './presets/typescript';
import { unicorn } from './presets/unicorn';
import { eslintRules } from './presets/eslint';
import { custom } from './presets/custom';
import { error, warn, off } from './constants';
import { off } from './constants';
import { checkEnv } from './env';
import { stylistic } from './presets/stylistic';
export { graphql } from './presets/graphql';
export { jsdoc } from './presets/jsdoc';
@ -19,7 +20,7 @@ export { storybook } from './presets/misc';
export { react, reactRefresh } from './presets/react';
export { tailwind } from './presets/tailwind';
export { error, warn, off };
export { error, warn, off } from './constants';
declare global {
interface Array<T> {
@ -103,6 +104,9 @@ export type InputConfig = Omit<ESLintConfig, 'rules'> & {
*
* Non bundled:
* 1. [`graphql`](https://the-guild.dev/graphql/eslint/rules)
*
* @param of Configuration options.
* @returns ESLint configuration object.
*/
export function extendConfig(
of: InputConfig & {
@ -124,8 +128,8 @@ export function extendConfig(
...rest
} = of;
let plugins: Plugin[] = [..._plugins];
let extend: Extends[] = ensureArray(_extends);
const plugins: Plugin[] = [..._plugins];
const extend: Extends[] = ensureArray(_extends);
if (customRuleFiles != null) {
plugins.push('local');
@ -135,6 +139,7 @@ export function extendConfig(
importTypeScript,
unicorn,
custom,
stylistic,
...(auto ? checkEnv() : []),
..._middlewares,
]);