eslint-plugin-ngxs-style-guide
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

eslint-plugin-ngxs-style-guide

ESLint rules for ngxs state manager.

Install

npm install --save-dev eslint-plugin-ngxs-style-guide

Usage

Configure it in your configuration file:

  1. Add to plugins section:
ngxs-style-guide
  1. Add to extends section (optional):
plugin:ngxs-style-guide/recommended
  1. Configure rules

Rules

NGXS style guide - https://www.ngxs.io/recipes/style-guide

  • ngxs-style-guide/state-suffix A state should always be suffixed with the word State. Right: ZooState Wrong: Zoo
  • ngxs-style-guide/state-filenames States should have a .state.ts suffix for the filename
  • ngxs-style-guide/state-interfaces State interfaces should be named the name of the state followed by the Model suffix
  • ngxs-style-guide/select-suffix Selects should have a $ suffix
  • ngxs-style-guide/action-suffixes Actions should NOT have a suffix
  • ngxs-style-guide/plugin-suffix Plugins should end with the Plugin suffix

Other rules

Todo

  • return observable from action
  • selector inject it must be after @State({ name: 'supplier', defaults: defaultState, }) @Injectable({ providedIn: 'root' })

Package Sidebar

Install

npm i eslint-plugin-ngxs-style-guide

Weekly Downloads

744

Version

3.0.0

License

MIT

Unpacked Size

39.5 kB

Total Files

6

Last publish

Collaborators

  • iamthes