Update rules

This commit is contained in:
Alex
2024-08-25 16:28:34 -04:00
parent b0cc4a1525
commit 0138cabb27
18 changed files with 325 additions and 236 deletions

View File

@ -50,6 +50,8 @@ export interface LocalRuleOptions {
'custom/restrict-template-expressions': RuleEntry<{ allow: string[] }>;
/** Ban assignment of empty object literals `{}` and replace them with `Object.create(null)` */
'custom/no-empty-object-literal': RuleEntry<unknown>;
/** Ban useless import alias */
'custom/no-useless-import-alias': RuleEntry<unknown>;
}
export type RuleOptions = Rules & Partial<LocalRuleOptions>;
@ -76,6 +78,8 @@ export type InputConfig = Omit<ESLintConfig, 'rules'> & {
* Glob pattern to find paths to custom rule files in JavaScript or TypeScript.
* Note this must be a string literal or an array of string literals since
* this is statically analyzed.
*
* Rules are prefixed with `custom/` and the file name is used as the rule name.
*/
customRuleFiles?: string | string[];
@ -161,7 +165,7 @@ export function extendConfig(
{ files: ['repl.ts', 'scripts/**/*.ts'], rules: { 'no-console': off } },
...(overrides ?? []),
],
rules: { ...eslintRules, ...rules },
rules: { ...eslintRules },
...rest,
};
@ -181,5 +185,7 @@ export function extendConfig(
result.plugins = unique(result.plugins);
result.extends = unique(result.extends);
Object.assign(result.rules, rules);
return result;
}