chore
This commit is contained in:
@ -1,10 +1,11 @@
|
||||
import type { Middleware } from '../index';
|
||||
import { error, warn } from '../constants';
|
||||
import { UnicornRulesObject } from '@aet/eslint-define-config/src/rules/unicorn';
|
||||
|
||||
const suggest = (suggest: string) => ({ suggest, fix: false });
|
||||
|
||||
// https://github.com/sindresorhus/eslint-plugin-unicorn/tree/28e7498ad06679bb92343db53bb40a7b5ba2990a
|
||||
export const unicornRules: Partial<UnicornRulesObject> = {
|
||||
const unicornRules: Partial<UnicornRulesObject> = {
|
||||
'unicorn/better-regex': error,
|
||||
'unicorn/consistent-function-scoping': warn,
|
||||
'unicorn/escape-case': error,
|
||||
@ -69,3 +70,8 @@ export const unicornRules: Partial<UnicornRulesObject> = {
|
||||
],
|
||||
'unicorn/template-indent': warn,
|
||||
};
|
||||
|
||||
export const unicorn: Middleware = (config, { addRules }) => {
|
||||
config.plugins.push('unicorn');
|
||||
addRules(unicornRules);
|
||||
};
|
||||
|
Reference in New Issue
Block a user