epaew/eslint-plugin-filenames-simple

View on GitHub
src/utils/get-default-allowed-extensions.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { Rule } from 'eslint';

const defaultAllowedExtensions = ['.js', '.cjs', '.mjs', '.jsx', '.d.ts', '.ts', '.tsx', '.vue'];

export const getAllowedExtensions = (context: Pick<Rule.RuleContext, 'settings'>): string[] =>
  context.settings?.['filenames-simple']?.allowedExtensions ?? defaultAllowedExtensions;