@bfra.me/eslint-config
Version:
Shared ESLint configuration for bfra.me
30 lines (26 loc) • 794 B
text/typescript
import type {Config} from '../config'
import type {OptionsOverrides} from '../options'
import {interopDefault} from '../utils'
/**
* Represents the options for configuring RegExp linting rules.
*/
export type RegexpOptions = OptionsOverrides
/**
* Configures the ESLint rules for RegExp linting.
* @param options - The configuration options for RegExp linting.
* @see https://ota-meshi.github.io/eslint-plugin-regexp/
*/
export async function regexp(options: RegexpOptions = {}): Promise<Config[]> {
const {configs} = await interopDefault(import('eslint-plugin-regexp'))
const config = configs['flat/recommended'] as Config
return [
{
...config,
name: '@bfra.me/regexp',
rules: {
...config.rules,
...options.overrides,
},
},
]
}