2.0.0 • Published 9 months ago

@hokla/eslint-plugin-custom-rules v2.0.0

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

Hokla's Eslint plugin

Recommended custom eslint rules at Hokla

How to use

Install

yarn add --dev @hokla/eslint-plugin-custom-rules

Optional: In case you also need to setup eslint :

yarn add --dev eslint typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin

Use rules in your projects

In your .eslintrc.json file :

{
  "root": true,
  "extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/eslint-recommended",
    "plugin:@typescript-eslint/recommended",
    "plugin:@hokla/custom-rules/recommended"
  ],
  "plugins": ["@typescript-eslint"],
  "parser": "@typescript-eslint/parser",
  // In case you want to customize the level of warning (default to 'warn')
  "rules": {
    "@hokla/custom-rules/react-query-specify-typing": "warn" // "error" | "warn
  }
}
               |

Contribute

Configs

Configs section would normally go here.

Rules

💼 Configurations enabled in.\ ⚠️ Configurations set to warn in.\ 🌐 Set in the react configuration.\ ☑️ Set in the recommended configuration.

Name                                            Description💼⚠️
forbid-lowercase-jsx-tagsTo be used in a React Native project: this rule forbids JSX tags that don't begin with a capital letter
luxon-force-zone-in-datetimeTODO
mutation-decorator-return-type-mismatchParameter of Mutation Decorator should match the method's return type
no-async-in-foreachArray.prototype.forEach is not designed for asynchronous code☑️
no-key-or-ref-propThis rule forbids using props named key or ref in React function components, as they are reserved words and will not act as intended🌐
no-value-export-in-declaration-fileThis rule forbids exporting values from TypeScript declaration files (ending in ".d.ts"), which can lead to bugs since these files are dropped during transpilation.☑️
property-decorator-type-mismatchParameter of Type Decorator should match the property type☑️
react-query-specify-typingType parameters should always be specified when calling useQuery and useMutation from react-query🌐
react-routes-must-be-wrapped-in-routerenforce encapsulation of <...Routes> in <...Router> provider and explicit naming of components returning <...Routes> element🌐
redux-saga-no-sequential-actionsdescription here
typeorm-enforce-repository-generic-method-typingenforce calls to repository generic methods (save, softRemove and recover) without type specification
typeorm-query-runner-releaseAny statement calling a queryRunner should be followed by a try/catch/finally block that ensures that the connection pool is released in any case by calling queryRunner.release().
1.9.0

9 months ago

1.8.4

10 months ago

1.10.0

9 months ago

2.0.0

9 months ago

1.8.2

12 months ago

1.8.3

12 months ago

1.6.1

1 year ago

1.6.0

1 year ago

1.5.2

1 year ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.0

1 year ago

1.1.1

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.1.0

1 year ago