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

@ -1,7 +1,7 @@
/* eslint-disable unicorn/string-content */
import type { UnicornRulesObject } from '@aet/eslint-define-config/src/rules/unicorn';
import { error, warn } from '../constants';
import { error, off, warn } from '../constants';
import { defineMiddleware } from '../middleware';
const suggest = (suggest: string) => ({ suggest, fix: false });
@ -86,10 +86,13 @@ const unicornRules: Partial<UnicornRulesObject> = {
'<=>': suggest('⇔'),
'\\.\\.\\.': suggest('…'),
"'s ": suggest('s '),
"'d ": suggest('d '),
"'t ": suggest('t '),
"l'": suggest('l'),
"d'": suggest('d'),
'?!': suggest(''),
'!?': suggest(''),
"qu'": suggest('qu'),
'\\?!': suggest(''),
'!\\?': suggest('⁉'),
},
},
],
@ -99,4 +102,10 @@ const unicornRules: Partial<UnicornRulesObject> = {
export const unicorn = defineMiddleware((config, { addRules }) => {
config.plugins.push('unicorn');
addRules(unicornRules);
config.overrides.push({
files: ['*.test.ts', '*.test.tsx'],
rules: {
'unicorn/no-useless-undefined': off,
},
});
});