0.1.3 • Published 3 years ago

eslint-plugin-vikvikvr v0.1.3

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

eslint-plugin-vikvikvr

Usage | Rules | Contributing

Custom plugin for ESLint providing several rules for React + Redux projects.

Usage

Install the plugin with npm

npm i eslint-plugin-vikvikvr -D

or Yarn

yarn add eslint-plugin-vikvikvr --dev

then edit your configuration:

// .eslintrc.js
module.exports = {
  extends: ["plugin:eslint-plugin-vikvikvr/recommended"],
  parser: "@typescript-eslint/parser",
  plugins: ["vikvikvr", "@typescript-eslint"],
};

Rules

āœ” if the rule is part of the recommended config

šŸ›  if the rule provides a quick-fix

NameDescription
āœ”if-statement-conditionEnforces condition expressions to be constants
āœ”šŸ› no-app-display-nameEnsures displayName is not set inside the apps/ folder
āœ”no-build-importPrevents imports from dist or build folders
āœ”no-set-timeoutEnsures setTimeout is not used
āœ”šŸ› no-useless-template-literalsEnsures template literals are only used when truly needed
āœ”šŸ› react-component-typeEnsures consistency while typing React components.
āœ”šŸ› react-hooks-orderEnsures hooks are called in a consistent order
āœ”react-no-boolean-use-memoEnsures useMemo is not used with simple boolean expressions
āœ”redux-action-type-enumEnsures redux action types come from enums or object properties
āœ”redux-no-select-whole-stateEnsures useSelector does not select the whole state
āœ”test-name-shouldEnsures test names start with the word should
āœ”šŸ› use-translations-scopeEnsures useTranslations contains the longest common scope

Contributing

Want to join as a developer? Read the contributing guidelines.