update
This commit is contained in:
3
src/constants.ts
Normal file
3
src/constants.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export const error = 'error';
|
||||
export const warn = 'warn';
|
||||
export const off = 'off';
|
@ -4,17 +4,16 @@ import { typescriptRules } from './presets/typescript';
|
||||
import { unicornRules } from './presets/unicorn';
|
||||
import { eslintRules } from './presets/eslint';
|
||||
import { reactRules } from './presets/react';
|
||||
import { error, warn, off } from './constants';
|
||||
// @ts-expect-error
|
||||
const { name } = (0, require)('./package.json');
|
||||
|
||||
export { error, warn, off };
|
||||
|
||||
const unique = <T>(arr: T[]): T[] => [...new Set(arr)];
|
||||
const ensureArray = <T>(value?: T | T[]): T[] =>
|
||||
value == null ? [] : Array.isArray(value) ? value : [value];
|
||||
|
||||
export const error = 'error';
|
||||
export const warn = 'warn';
|
||||
export const off = 'off';
|
||||
|
||||
declare module 'eslint-define-config/src/rules/react/no-unknown-property.d.ts' {
|
||||
export interface NoUnknownPropertyOption {
|
||||
extends: ('next' | 'emotion')[];
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { error, warn, off } from '../index';
|
||||
import { error, warn, off } from '../constants';
|
||||
import { EslintRules } from 'eslint-define-config/src/rules/eslint';
|
||||
|
||||
export const eslintRules: Partial<EslintRules> = {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { error, off } from '../index';
|
||||
import { error, off } from '../constants';
|
||||
import { ReactRules } from 'eslint-define-config/src/rules/react';
|
||||
|
||||
export const reactRules: Partial<ReactRules> = {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { error, off } from '../index';
|
||||
import { error, off } from '../constants';
|
||||
import type { TypeScriptRules } from 'eslint-define-config/src/rules/typescript-eslint';
|
||||
|
||||
export const typescriptRules: Partial<TypeScriptRules> = {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { error, warn } from '../index';
|
||||
import { error, warn } from '../constants';
|
||||
import { UnicornRules } from 'eslint-define-config/src/rules/unicorn';
|
||||
|
||||
const suggest = (suggest: string) => ({ suggest, fix: false });
|
||||
@ -22,7 +22,9 @@ export const unicornRules: Partial<UnicornRules> = {
|
||||
'unicorn/no-useless-promise-resolve-reject': error,
|
||||
'unicorn/no-useless-spread': error,
|
||||
'unicorn/no-useless-switch-case': error,
|
||||
'unicorn/number-literal-case': error,
|
||||
|
||||
// https://github.com/prettier/eslint-config-prettier/issues/51
|
||||
// 'unicorn/number-literal-case': error,
|
||||
'unicorn/prefer-array-find': error,
|
||||
'unicorn/prefer-array-flat-map': error,
|
||||
'unicorn/prefer-array-some': error,
|
||||
@ -60,7 +62,8 @@ export const unicornRules: Partial<UnicornRules> = {
|
||||
'>=': suggest('≥'),
|
||||
'!=': suggest('≠'),
|
||||
'<=>': suggest('⇔'),
|
||||
'...': suggest('…'),
|
||||
'\\.\\.\\.': suggest('…'),
|
||||
"'s ": suggest('’s '),
|
||||
},
|
||||
},
|
||||
],
|
||||
|
Reference in New Issue
Block a user