eslint-plugin-effector 0.16.0 → 0.18.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.
- package/README.md +24 -37
- package/dist/index.cjs +1488 -0
- package/dist/index.d.cts +164 -0
- package/dist/index.d.mts +165 -0
- package/dist/index.mjs +1465 -0
- package/package.json +73 -17
- package/.nvmrc +0 -1
- package/config/future.js +0 -7
- package/config/patronum.js +0 -5
- package/config/react.js +0 -7
- package/config/recommended.js +0 -15
- package/config/scope.js +0 -6
- package/index.js +0 -31
- package/rules/enforce-effect-naming-convention/enforce-effect-naming-convention.js +0 -143
- package/rules/enforce-gate-naming-convention/enforce-gate-naming-convention.js +0 -122
- package/rules/enforce-store-naming-convention/enforce-store-naming-convention.js +0 -205
- package/rules/keep-options-order/config.js +0 -3
- package/rules/keep-options-order/keep-options-order.js +0 -107
- package/rules/mandatory-scope-binding/mandatory-scope-binding.js +0 -81
- package/rules/no-ambiguity-target/no-ambiguity-target.js +0 -74
- package/rules/no-duplicate-clock-or-source-array-values/no-duplicate-clock-or-source-array-values.js +0 -124
- package/rules/no-duplicate-on/no-duplicate-on.js +0 -137
- package/rules/no-forward/no-forward.js +0 -73
- package/rules/no-getState/no-getState.js +0 -50
- package/rules/no-guard/no-guard.js +0 -78
- package/rules/no-patronum-debug/no-patronum-debug.js +0 -133
- package/rules/no-unnecessary-combination/no-unnecessary-combination.js +0 -88
- package/rules/no-unnecessary-duplication/no-unnecessary-duplication.js +0 -115
- package/rules/no-useless-methods/no-useless-methods.js +0 -93
- package/rules/no-watch/no-watch.js +0 -61
- package/rules/prefer-sample-over-forward-with-mapping/prefer-sample-over-forward-with-mapping.js +0 -111
- package/rules/prefer-useUnit/prefer-useUnit.js +0 -56
- package/rules/require-pickup-in-persist/require-pickup-in-persist.js +0 -47
- package/rules/strict-effect-handlers/strict-effect-handlers.js +0 -76
- package/utils/are-nodes-same-in-text.js +0 -22
- package/utils/builders.js +0 -19
- package/utils/create-link-to-rule.js +0 -5
- package/utils/extract-config.js +0 -26
- package/utils/extract-imported-from.js +0 -18
- package/utils/get-corrected-store-name.js +0 -45
- package/utils/get-nested-object-name.js +0 -18
- package/utils/get-store-name-convention.js +0 -6
- package/utils/is.js +0 -39
- package/utils/method.js +0 -23
- package/utils/naming.js +0 -47
- package/utils/node-is-type.js +0 -5
- package/utils/node-type-is.js +0 -106
- package/utils/react.js +0 -214
- package/utils/read-example.js +0 -63
- package/utils/replace-by-sample.js +0 -98
- package/utils/traverse-nested-object-node.js +0 -9
- package/utils/traverse-parent-by-type.js +0 -15
- package/utils/validate-store-name-convention.js +0 -13
package/README.md
CHANGED
|
@@ -1,55 +1,42 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">eslint-plugin-effector</h1>
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An ESLint plugin for enforcing best practices for [Effector](https://effector.dev).
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
9
|
+
First, install [ESLint](https://eslint.org) and the plugin:
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
```bash
|
|
12
|
+
# pnpm
|
|
13
|
+
pnpm add --save-dev eslint eslint-plugin-effector
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
22
|
-
$ yarn add --dev eslint-plugin-effector
|
|
18
|
+
# npm
|
|
19
|
+
npm install --save-dev eslint eslint-plugin-effector
|
|
23
20
|
```
|
|
24
21
|
|
|
25
|
-
|
|
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
|
-
|
|
26
|
+
```js
|
|
27
|
+
// eslint.config.js
|
|
28
|
+
import effector from "eslint-plugin-effector"
|
|
33
29
|
|
|
34
|
-
|
|
30
|
+
export default [
|
|
31
|
+
/* ... */
|
|
35
32
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"extends": ["plugin:effector/recommended", "plugin:effector/scope"]
|
|
40
|
-
}
|
|
33
|
+
// Include the recommended preset:
|
|
34
|
+
effector.flatConfigs.recommended,
|
|
35
|
+
]
|
|
41
36
|
```
|
|
42
37
|
|
|
43
|
-
|
|
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
|
-
###
|
|
40
|
+
### TypeScript Requirement
|
|
48
41
|
|
|
49
|
-
|
|
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/).
|