This commit is contained in:
Alex
2023-09-29 00:12:53 -04:00
parent 729172af89
commit 01f291af94
5 changed files with 633 additions and 32 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/env tsx
#!/usr/bin/env bun
import glob from 'fast-glob';
import fs from 'fs';
import { builtinModules } from 'module';

View File

@ -26,7 +26,6 @@ export function extendConfig({
...rest
}: ESLintConfig = {}): ESLintConfig {
const hasReact = plugins?.includes('react');
const hasUnicorn = plugins?.includes('unicorn');
const hasReactRefresh = plugins?.includes('react-refresh');
const hasNext = ensureArray(_extends).some(name => name.includes(':@next/next'));
@ -52,7 +51,6 @@ export function extendConfig({
'plugin:jsx-a11y/recommended',
]
: []),
...(hasUnicorn ? ['plugin:unicorn/recommended'] : []),
...(_extends ?? []),
]),
settings: {
@ -168,26 +166,6 @@ export function extendConfig({
],
}
: {}),
...(hasUnicorn
? {
'unicorn/no-abusive-eslint-disable': off,
'unicorn/no-array-callback-reference': off,
'unicorn/no-array-for-each': warn,
'unicorn/no-array-reduce': off,
'unicorn/no-await-expression-member': off,
'unicorn/no-empty-file': off,
'unicorn/no-negated-condition': warn,
'unicorn/no-new-array': off,
'unicorn/no-null': off,
'unicorn/no-process-exit': off,
'unicorn/no-this-assignment': off,
'unicorn/prefer-module': off,
'unicorn/prefer-string-replace-all': off,
'unicorn/prefer-top-level-await': off,
'unicorn/throw-new-error': off,
'unicorn/no-unnecessary-await': off,
}
: {}),
...(hasReactRefresh
? {
'react-refresh/only-export-components': [warn, { allowConstantExport: true }],