This commit is contained in:
Alex
2023-10-03 19:00:25 -04:00
parent 01f291af94
commit 8a07010f29
15 changed files with 741 additions and 716 deletions

49
src/presets/eslint.ts Normal file
View File

@ -0,0 +1,49 @@
import { error, warn, off } from '../index';
import { EslintRules } from 'eslint-define-config/src/rules/eslint';
export const eslintRules: Partial<EslintRules> = {
'arrow-body-style': [error, 'as-needed'],
'class-methods-use-this': off,
'no-async-promise-executor': off,
'no-case-declarations': off,
'no-console': warn,
'no-constant-condition': [error, { checkLoops: false }],
'no-debugger': warn,
'no-duplicate-imports': error,
'no-empty': [error, { allowEmptyCatch: true }],
'no-inner-declarations': off,
'no-lonely-if': error,
'no-restricted-globals': [error, 'event', 'name', 'length'],
'no-restricted-imports': [
error,
{
paths: [
{
name: 'crypto',
importNames: ['webcrypto'],
message: 'Use global `crypto` instead',
},
],
},
],
'no-template-curly-in-string': error,
'no-var': error,
'object-shorthand': [error, 'always', { ignoreConstructors: true }],
'one-var': [error, { var: 'never', let: 'never' }],
'prefer-arrow-callback': error,
'prefer-const': [error, { destructuring: 'all' }],
'prefer-destructuring': [
warn,
{ AssignmentExpression: { array: false, object: false } },
],
'prefer-object-spread': error,
'prefer-rest-params': warn,
'prefer-spread': warn,
'quote-props': [error, 'as-needed'],
'sort-imports': [warn, { ignoreDeclarationSort: true }],
'spaced-comment': [error, 'always', { markers: ['/', '#', '@'] }],
complexity: [warn, { max: 100 }],
curly: [error, 'multi-line', 'consistent'],
eqeqeq: [error, 'smart'],
yoda: [error, 'never', { exceptRange: true }],
};