0.0.2 • Published 9 months ago

@viapip/eslint-config v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

ESLint Configuration

This project uses a custom ESLint configuration based on @antfu/eslint-config. Below is a comprehensive table of all the rules used:

General Rules

RuleValueDescription
no-empty-functionoffAllows empty functions
no-unused-varsoffDisabled in favor of unused-imports/no-unused-vars
arrow-body-style['error', 'as-needed']Enforces concise arrow function bodies when possible
unused-imports/no-unused-varswarnWarns about unused variables
eol-last['error', 'always']Requires newline at the end of files
no-else-returnwarnSuggests omitting else when an if block always executes a return statement
logical-assignment-operatorswarnEncourages use of logical assignment operators
no-implicit-coercionwarnWarns against implicit type coercion
operator-assignmentwarnSuggests using shorthand operators where possible
prefer-destructuringwarnEncourages use of object and array destructuring
prefer-object-has-ownwarnSuggests using Object.hasOwn() instead of Object.prototype.hasOwnProperty.call()
no-console['warn', { allow: ['debug'] }]Warns about console usage, except for console.debug
no-use-before-define['error', { functions: false }]Disallows use of variables before they are defined, except for functions
no-param-reassign['error', { props: false }]Disallows reassigning function parameters, but allows modifying properties
no-underscore-dangleoffAllows use of underscores in identifiers
no-shadowoffAllows variable shadowing
no-unused-expressions['error', { allowShortCircuit: true }]Disallows unused expressions, but allows short circuit evaluations
no-shadow-restricted-nameserrorDisallows shadowing of restricted names
curly['error', 'multi-line', 'consistent']Enforces consistent use of curly braces
newline-before-returnerrorRequires an empty line before return statements
newline-per-chained-call['error', { ignoreChainWithDepth: 1 }]Requires a newline after each call in a method chain
multiline-ternary['error', 'always-multiline']Enforces newlines between operands of ternary expressions if the expression spans multiple lines
brace-style['error', 'stroustrup']Enforces Stroustrup style for braces
eqeqeq['error', 'smart']Requires the use of === and !==, except when comparing with null
antfu/if-newlineerrorEnforces newline after if statements
style/no-confusing-arrowerrorDisallows arrow functions where they could be confused with comparisons
style/newline-per-chained-callerrorRequires a newline after each call in a method chain
style/wrap-regexerrorRequires regex literals to be wrapped in parentheses
style/type-named-tuple-spacingerrorEnforces consistent spacing in named tuple types
style/max-statements-per-line['error', { max: 80 }]Limits the number of statements per line
style/array-bracket-newline['error', { multiline: true }]Enforces line breaks after opening and before closing array brackets for multiline arrays
import/order(complex configuration)Enforces a specific import order

TypeScript-Specific Rules

RuleValueDescription
ts/no-namespaceoffAllows the use of TypeScript namespaces
ts/explicit-function-return-typeoffDoesn't require explicit return types on functions
ts/adjacent-overload-signatureserrorRequires adjacent function overload signatures
ts/array-typeerrorEnforces consistent usage of array types
ts/ban-tslint-commenterrorDisallows // tslint: comments
ts/class-literal-property-styleerrorEnforces consistent style for class literal properties
ts/consistent-generic-constructorserrorEnforces consistent usage of generic type parameters in class constructors
ts/consistent-indexed-object-styleerrorEnforces consistent usage of indexed object style
ts/consistent-type-assertionserrorEnforces consistent usage of type assertions
ts/consistent-type-definitionsoffDoesn't enforce consistent usage of type vs interface
ts/no-confusing-non-null-assertionerrorDisallows confusing non-null assertions
ts/no-empty-functionerrorDisallows empty functions in TypeScript
ts/no-empty-interfaceerrorDisallows empty interfaces
ts/no-inferrable-typeserrorDisallows explicit type declarations for variables or parameters initialized to a number, string, or boolean
ts/prefer-for-oferrorPrefers for...of loop over a standard for loop if the index is only used to access the array being iterated
ts/prefer-function-typeerrorPrefers function types instead of interfaces with call signatures
ts/prefer-namespace-keyworderrorRequires the use of the namespace keyword instead of the module keyword to declare custom TypeScript modules

Unicorn Plugin Rules

RuleValueDescription
unicorn/better-regexerrorImproves regexes by making them shorter, consistent, and safer
unicorn/no-array-for-eacherrorPrefers for...of statements instead of Array#forEach
unicorn/no-array-method-this-argumenterrorDisallows using this as an argument in array methods
unicorn/no-array-push-pusherrorEnforces combining multiple Array#push() into one call
unicorn/no-for-looperrorDisallows for loops in favor of other loop types
unicorn/no-invalid-remove-event-listenererrorPrevents passing wrong function to removeEventListener
unicorn/no-lonely-iferrorDisallows if statements as the only statement in else blocks
unicorn/no-negation-in-equality-checkerrorDisallows negation in equality checks
unicorn/no-nested-ternaryerrorDisallows nested ternary expressions
unicorn/no-static-only-classerrorDisallows classes with only static members
unicorn/no-unreadable-array-destructuringerrorDisallows unreadable array destructuring
unicorn/prefer-number-propertieserrorPrefers Number static properties over global ones
unicorn/prefer-optional-catch-bindingerrorPrefers omitting the catch binding parameter
unicorn/text-encoding-identifier-caseerrorEnforces consistent case for text encoding identifiers
unicorn/catch-error-nameerrorEnforces a specific parameter name in catch clauses
unicorn/consistent-destructuringerrorEnforces consistent usage of destructuring
unicorn/empty-brace-spaceserrorEnforces no spaces between braces
unicorn/expiring-todo-commentserrorAdds expiration conditions to TODO comments
unicorn/no-unnecessary-awaiterrorDisallows awaiting non-promise values
unicorn/no-useless-undefinederrorDisallows useless undefined
unicorn/consistent-function-scopingwarnMoves functions within blocks to the outer scope
unicorn/template-indent['warn', { indent: 2 }]Enforces proper indentation for template literals

This configuration provides a comprehensive set of rules to ensure code quality and consistency across your project.