eslint-plugin-effector 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +24 -37
  2. package/dist/index.cjs +1259 -0
  3. package/dist/index.d.cts +177 -0
  4. package/dist/index.d.mts +178 -0
  5. package/dist/index.mjs +1233 -0
  6. package/package.json +71 -17
  7. package/.nvmrc +0 -1
  8. package/config/future.js +0 -7
  9. package/config/patronum.js +0 -5
  10. package/config/react.js +0 -7
  11. package/config/recommended.js +0 -15
  12. package/config/scope.js +0 -6
  13. package/index.js +0 -31
  14. package/rules/enforce-effect-naming-convention/enforce-effect-naming-convention.js +0 -143
  15. package/rules/enforce-gate-naming-convention/enforce-gate-naming-convention.js +0 -122
  16. package/rules/enforce-store-naming-convention/enforce-store-naming-convention.js +0 -205
  17. package/rules/keep-options-order/config.js +0 -3
  18. package/rules/keep-options-order/keep-options-order.js +0 -107
  19. package/rules/mandatory-scope-binding/mandatory-scope-binding.js +0 -81
  20. package/rules/no-ambiguity-target/no-ambiguity-target.js +0 -74
  21. package/rules/no-duplicate-clock-or-source-array-values/no-duplicate-clock-or-source-array-values.js +0 -120
  22. package/rules/no-duplicate-on/no-duplicate-on.js +0 -137
  23. package/rules/no-forward/no-forward.js +0 -73
  24. package/rules/no-getState/no-getState.js +0 -50
  25. package/rules/no-guard/no-guard.js +0 -78
  26. package/rules/no-patronum-debug/no-patronum-debug.js +0 -133
  27. package/rules/no-unnecessary-combination/no-unnecessary-combination.js +0 -88
  28. package/rules/no-unnecessary-duplication/no-unnecessary-duplication.js +0 -115
  29. package/rules/no-useless-methods/no-useless-methods.js +0 -93
  30. package/rules/no-watch/no-watch.js +0 -61
  31. package/rules/prefer-sample-over-forward-with-mapping/prefer-sample-over-forward-with-mapping.js +0 -111
  32. package/rules/prefer-useUnit/prefer-useUnit.js +0 -56
  33. package/rules/require-pickup-in-persist/require-pickup-in-persist.js +0 -47
  34. package/rules/strict-effect-handlers/strict-effect-handlers.js +0 -76
  35. package/utils/are-nodes-same-in-text.js +0 -22
  36. package/utils/builders.js +0 -19
  37. package/utils/create-link-to-rule.js +0 -5
  38. package/utils/extract-config.js +0 -26
  39. package/utils/extract-imported-from.js +0 -18
  40. package/utils/get-corrected-store-name.js +0 -45
  41. package/utils/get-nested-object-name.js +0 -18
  42. package/utils/get-store-name-convention.js +0 -6
  43. package/utils/is.js +0 -39
  44. package/utils/method.js +0 -23
  45. package/utils/naming.js +0 -47
  46. package/utils/node-is-type.js +0 -5
  47. package/utils/node-type-is.js +0 -106
  48. package/utils/react.js +0 -214
  49. package/utils/read-example.js +0 -63
  50. package/utils/replace-by-sample.js +0 -98
  51. package/utils/traverse-nested-object-node.js +0 -9
  52. package/utils/traverse-parent-by-type.js +0 -15
  53. package/utils/validate-store-name-convention.js +0 -13
package/README.md CHANGED
@@ -1,55 +1,42 @@
1
- # eslint-plugin-effector
1
+ <h1 align="center">eslint-plugin-effector</h1>
2
2
 
3
- Enforcing best practices for [Effector](http://effector.dev/). Documentation available at [eslint.effector.dev](https://eslint.effector.dev/).
3
+ An ESLint plugin for enforcing best practices for [Effector](https://effector.dev).
4
4
 
5
- > This plugin uses TypeScript for more precise results, but JavaScript is supported too.
5
+ For comprehensive documentation, including rules and configuration guides, visit official documentation at [eslint.effector.dev](https://eslint.effector.dev).
6
6
 
7
7
  ## Installation
8
8
 
9
- Install [ESLint](http://eslint.org) and `eslint-plugin-effector`:
9
+ First, install [ESLint](https://eslint.org) and the plugin:
10
10
 
11
- ### pnpm
11
+ ```bash
12
+ # pnpm
13
+ pnpm add --save-dev eslint eslint-plugin-effector
12
14
 
13
- ```
14
- $ pnpm install --dev eslint
15
- $ pnpm install --dev eslint-plugin-effector
16
- ```
17
-
18
- ### yarn
15
+ # yarn
16
+ yarn add --dev eslint eslint-plugin-effector
19
17
 
20
- ```
21
- $ yarn add --dev eslint
22
- $ yarn add --dev eslint-plugin-effector
18
+ # npm
19
+ npm install --save-dev eslint eslint-plugin-effector
23
20
  ```
24
21
 
25
- ### npm
22
+ ## Usage
26
23
 
27
- ```
28
- $ npm install --dev eslint
29
- $ npm install --dev eslint-plugin-effector
30
- ```
24
+ This plugin supports the new [flat config format](https://eslint.org/docs/latest/use/configure/configuration-files) for ESLint. Start by adding the `recommended` preset to your `eslint.config.js`:
31
25
 
32
- ## Usage
26
+ ```js
27
+ // eslint.config.js
28
+ import effector from "eslint-plugin-effector"
33
29
 
34
- Add `effector` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
30
+ export default [
31
+ /* ... */
35
32
 
36
- ```json
37
- {
38
- "plugins": ["effector"],
39
- "extends": ["plugin:effector/recommended", "plugin:effector/scope"]
40
- }
33
+ // Include the recommended preset:
34
+ effector.flatConfigs.recommended,
35
+ ]
41
36
  ```
42
37
 
43
- Read more detailed docs on [eslint.effector.dev](https://eslint.effector.dev/)
44
-
45
- ## Maintenance
38
+ To explore all available presets, refer to the [Rules](https://eslint.effector.dev/rules/) section of the documentation. For more details or legacy config usage, see the [Installation](https://eslint.effector.dev/installation/) section.
46
39
 
47
- ### Release flow
40
+ ### TypeScript Requirement
48
41
 
49
- 1. Bump `version` in [package.json](package.json)
50
- 2. Fill [CHANGELOG.md](CHANGELOG.md)
51
- 3. Commit changes by `git commit -m "Release X.X.X"`
52
- 4. Create git tag for release by `git tag -a vX.X.X -m "vX.X.X"`
53
- 5. Push changes to remote by `git push --follow-tags`
54
- 6. Release package to registry by `pnpm clean-publish`
55
- 7. Fill release page with changelog on GitHub
42
+ This plugin leverages TypeScript for accurate linting. You must have TypeScript and type-aware linting configured. For setup instructions, please see the [official `typescript-eslint` documentation](https://typescript-eslint.io/getting-started/typed-linting/).