Refactor
This commit is contained in:
38
src/presets/typescript.ts
Normal file
38
src/presets/typescript.ts
Normal file
@ -0,0 +1,38 @@
|
||||
import { error, off } from '../index';
|
||||
import type { TypeScriptRules } from 'eslint-define-config/src/rules/typescript-eslint';
|
||||
|
||||
export const typescriptRules: Partial<TypeScriptRules> = {
|
||||
'@typescript-eslint/ban-ts-comment': [
|
||||
error,
|
||||
{
|
||||
'ts-expect-error': 'allow-with-description',
|
||||
'ts-check': false,
|
||||
'ts-ignore': 'allow-with-description',
|
||||
'ts-nocheck': 'allow-with-description',
|
||||
},
|
||||
],
|
||||
'@typescript-eslint/ban-types': [error, { extendDefaults: true }],
|
||||
'@typescript-eslint/consistent-type-imports': [
|
||||
error,
|
||||
{ disallowTypeAnnotations: false, fixStyle: 'inline-type-imports' },
|
||||
],
|
||||
'@typescript-eslint/no-empty-interface': [error, { allowSingleExtends: true }],
|
||||
'@typescript-eslint/no-explicit-any': off,
|
||||
'@typescript-eslint/no-extraneous-class': error,
|
||||
'@typescript-eslint/no-misused-promises': [error, { checksVoidReturn: false }],
|
||||
'@typescript-eslint/no-namespace': off,
|
||||
'@typescript-eslint/no-unnecessary-type-assertion': error,
|
||||
'@typescript-eslint/no-unsafe-argument': off,
|
||||
'@typescript-eslint/no-unsafe-assignment': off,
|
||||
'@typescript-eslint/no-unsafe-call': off,
|
||||
'@typescript-eslint/no-unsafe-member-access': off,
|
||||
'@typescript-eslint/no-unsafe-return': off,
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
error,
|
||||
{ ignoreRestSiblings: true, varsIgnorePattern: '^_' },
|
||||
],
|
||||
'@typescript-eslint/no-use-before-define': off,
|
||||
'@typescript-eslint/no-var-requires': off,
|
||||
'@typescript-eslint/triple-slash-reference': off,
|
||||
'@typescript-eslint/unbound-method': off,
|
||||
};
|
Reference in New Issue
Block a user