eslint-plugin-rxjs-x 0.2.0 → 0.2.1
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 +6 -1
- package/dist/index.js +6 -6
- package/dist/index.mjs +6 -6
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ Almost all of these rules require the TypeScript parser for ESLint and are indic
|
|
|
17
17
|
|
|
18
18
|
See [typescript-eslint's Getting Started](https://typescript-eslint.io/getting-started) for a full ESLint setup guide.
|
|
19
19
|
|
|
20
|
-
Then use the `recommended` configuration in your `eslint.config.mjs
|
|
20
|
+
Then use the `recommended` configuration in your `eslint.config.mjs` and enable typed linting:
|
|
21
21
|
|
|
22
22
|
```js
|
|
23
23
|
// @ts-check
|
|
@@ -26,6 +26,7 @@ import rxjsX from 'eslint-plugin-rxjs-x';
|
|
|
26
26
|
|
|
27
27
|
export default tseslint.config({
|
|
28
28
|
extends: [
|
|
29
|
+
...tseslint.configs.recommended,
|
|
29
30
|
rxjsX.configs.recommended,
|
|
30
31
|
],
|
|
31
32
|
languageOptions: {
|
|
@@ -36,6 +37,10 @@ export default tseslint.config({
|
|
|
36
37
|
});
|
|
37
38
|
```
|
|
38
39
|
|
|
40
|
+
The above example uses `typescript-eslint`'s built-in config to set up the TypeScript parser for us.
|
|
41
|
+
Enabling `projectService` then turns on typed linting.
|
|
42
|
+
See [Linting with Type Information](https://typescript-eslint.io/getting-started/typed-linting/) for details.
|
|
43
|
+
|
|
39
44
|
## Configs
|
|
40
45
|
|
|
41
46
|
<!-- begin auto-generated configs list -->
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// package.json
|
|
2
2
|
var name = "eslint-plugin-rxjs-x";
|
|
3
|
-
var version = "0.2.
|
|
3
|
+
var version = "0.2.1";
|
|
4
4
|
|
|
5
5
|
// src/configs/recommended.ts
|
|
6
6
|
var createRecommendedConfig = (plugin2) => ({
|
|
@@ -518,7 +518,7 @@ var finnishRule = ruleCreator({
|
|
|
518
518
|
});
|
|
519
519
|
} : () => {
|
|
520
520
|
};
|
|
521
|
-
if (couldBeObservable(typeNode
|
|
521
|
+
if (couldBeObservable(typeNode != null ? typeNode : nameNode) || couldReturnObservable(typeNode != null ? typeNode : nameNode)) {
|
|
522
522
|
for (const name2 of names) {
|
|
523
523
|
const { regExp, validate: validate2 } = name2;
|
|
524
524
|
if (regExp.test(text) && !validate2) {
|
|
@@ -528,7 +528,7 @@ var finnishRule = ruleCreator({
|
|
|
528
528
|
}
|
|
529
529
|
for (const type of types) {
|
|
530
530
|
const { regExp, validate: validate2 } = type;
|
|
531
|
-
if ((couldBeType2(typeNode
|
|
531
|
+
if ((couldBeType2(typeNode != null ? typeNode : nameNode, regExp) || couldReturnType(typeNode != null ? typeNode : nameNode, regExp)) && !validate2) {
|
|
532
532
|
shouldNotBeFinnish();
|
|
533
533
|
return;
|
|
534
534
|
}
|
|
@@ -1201,7 +1201,7 @@ var noFinnishRule = ruleCreator({
|
|
|
1201
1201
|
const { esTreeNodeToTSNodeMap } = _utils.ESLintUtils.getParserServices(context);
|
|
1202
1202
|
const { couldBeObservable, couldReturnObservable } = getTypeServices(context);
|
|
1203
1203
|
function checkNode(nameNode, typeNode) {
|
|
1204
|
-
if (couldBeObservable(typeNode
|
|
1204
|
+
if (couldBeObservable(typeNode != null ? typeNode : nameNode) || couldReturnObservable(typeNode != null ? typeNode : nameNode)) {
|
|
1205
1205
|
const tsNode = esTreeNodeToTSNodeMap.get(nameNode);
|
|
1206
1206
|
if (/[$]+$/.test(tsNode.getText())) {
|
|
1207
1207
|
context.report({
|
|
@@ -2838,10 +2838,10 @@ var suffixSubjectsRule = ruleCreator({
|
|
|
2838
2838
|
function checkNode(nameNode, typeNode) {
|
|
2839
2839
|
const tsNode = esTreeNodeToTSNodeMap.get(nameNode);
|
|
2840
2840
|
const text = tsNode.getText();
|
|
2841
|
-
if (!suffixRegex.test(text) && couldBeType2(typeNode
|
|
2841
|
+
if (!suffixRegex.test(text) && couldBeType2(typeNode != null ? typeNode : nameNode, "Subject")) {
|
|
2842
2842
|
for (const type of types) {
|
|
2843
2843
|
const { regExp, validate: validate2 } = type;
|
|
2844
|
-
if (couldBeType2(typeNode
|
|
2844
|
+
if (couldBeType2(typeNode != null ? typeNode : nameNode, regExp) && !validate2) {
|
|
2845
2845
|
return;
|
|
2846
2846
|
}
|
|
2847
2847
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var name = "eslint-plugin-rxjs-x";
|
|
3
|
-
var version = "0.2.
|
|
3
|
+
var version = "0.2.1";
|
|
4
4
|
|
|
5
5
|
// src/configs/recommended.ts
|
|
6
6
|
var createRecommendedConfig = (plugin2) => ({
|
|
@@ -518,7 +518,7 @@ var finnishRule = ruleCreator({
|
|
|
518
518
|
});
|
|
519
519
|
} : () => {
|
|
520
520
|
};
|
|
521
|
-
if (couldBeObservable(typeNode
|
|
521
|
+
if (couldBeObservable(typeNode != null ? typeNode : nameNode) || couldReturnObservable(typeNode != null ? typeNode : nameNode)) {
|
|
522
522
|
for (const name2 of names) {
|
|
523
523
|
const { regExp, validate: validate2 } = name2;
|
|
524
524
|
if (regExp.test(text) && !validate2) {
|
|
@@ -528,7 +528,7 @@ var finnishRule = ruleCreator({
|
|
|
528
528
|
}
|
|
529
529
|
for (const type of types) {
|
|
530
530
|
const { regExp, validate: validate2 } = type;
|
|
531
|
-
if ((couldBeType2(typeNode
|
|
531
|
+
if ((couldBeType2(typeNode != null ? typeNode : nameNode, regExp) || couldReturnType(typeNode != null ? typeNode : nameNode, regExp)) && !validate2) {
|
|
532
532
|
shouldNotBeFinnish();
|
|
533
533
|
return;
|
|
534
534
|
}
|
|
@@ -1201,7 +1201,7 @@ var noFinnishRule = ruleCreator({
|
|
|
1201
1201
|
const { esTreeNodeToTSNodeMap } = ESLintUtils4.getParserServices(context);
|
|
1202
1202
|
const { couldBeObservable, couldReturnObservable } = getTypeServices(context);
|
|
1203
1203
|
function checkNode(nameNode, typeNode) {
|
|
1204
|
-
if (couldBeObservable(typeNode
|
|
1204
|
+
if (couldBeObservable(typeNode != null ? typeNode : nameNode) || couldReturnObservable(typeNode != null ? typeNode : nameNode)) {
|
|
1205
1205
|
const tsNode = esTreeNodeToTSNodeMap.get(nameNode);
|
|
1206
1206
|
if (/[$]+$/.test(tsNode.getText())) {
|
|
1207
1207
|
context.report({
|
|
@@ -2838,10 +2838,10 @@ var suffixSubjectsRule = ruleCreator({
|
|
|
2838
2838
|
function checkNode(nameNode, typeNode) {
|
|
2839
2839
|
const tsNode = esTreeNodeToTSNodeMap.get(nameNode);
|
|
2840
2840
|
const text = tsNode.getText();
|
|
2841
|
-
if (!suffixRegex.test(text) && couldBeType2(typeNode
|
|
2841
|
+
if (!suffixRegex.test(text) && couldBeType2(typeNode != null ? typeNode : nameNode, "Subject")) {
|
|
2842
2842
|
for (const type of types) {
|
|
2843
2843
|
const { regExp, validate: validate2 } = type;
|
|
2844
|
-
if (couldBeType2(typeNode
|
|
2844
|
+
if (couldBeType2(typeNode != null ? typeNode : nameNode, regExp) && !validate2) {
|
|
2845
2845
|
return;
|
|
2846
2846
|
}
|
|
2847
2847
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-rxjs-x",
|
|
3
3
|
"type": "commonjs",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"packageManager": "yarn@4.5.1+sha512.341db9396b6e289fecc30cd7ab3af65060e05ebff4b3b47547b278b9e67b08f485ecd8c79006b405446262142c7a38154445ef7f17c1d5d1de7d90bf9ce7054d",
|
|
6
6
|
"description": "ESLint v9+ plugin for RxJS",
|
|
7
7
|
"author": "Jason Weinzierl <weinzierljason@gmail.com>",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"typecheck": "tsc --noEmit"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@typescript-eslint/scope-manager": "^8.
|
|
57
|
-
"@typescript-eslint/utils": "^8.
|
|
56
|
+
"@typescript-eslint/scope-manager": "^8.1.0",
|
|
57
|
+
"@typescript-eslint/utils": "^8.1.0",
|
|
58
58
|
"common-tags": "^1.8.0",
|
|
59
59
|
"decamelize": "^5.0.1",
|
|
60
60
|
"ts-api-utils": "^1.3.0",
|
|
@@ -66,28 +66,28 @@
|
|
|
66
66
|
"typescript": ">=4.2.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@eslint/js": "^9.
|
|
69
|
+
"@eslint/js": "^9.14.0",
|
|
70
70
|
"@stylistic/eslint-plugin": "^2.10.1",
|
|
71
71
|
"@types/common-tags": "^1.8.4",
|
|
72
72
|
"@types/node": "^18.18.0",
|
|
73
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
73
|
+
"@typescript-eslint/rule-tester": "^8.13.0",
|
|
74
74
|
"@typescript/vfs": "^1.6.0",
|
|
75
75
|
"@vitest/coverage-v8": "^2.1.4",
|
|
76
76
|
"@vitest/eslint-plugin": "^1.1.7",
|
|
77
77
|
"bumpp": "^9.8.0",
|
|
78
|
-
"eslint": "^9.
|
|
78
|
+
"eslint": "^9.14.0",
|
|
79
79
|
"eslint-config-flat-gitignore": "^0.3.0",
|
|
80
80
|
"eslint-doc-generator": "^1.7.1",
|
|
81
81
|
"eslint-import-resolver-typescript": "^3.6.3",
|
|
82
82
|
"eslint-plugin-eslint-plugin": "^6.3.1",
|
|
83
83
|
"eslint-plugin-import-x": "^4.4.0",
|
|
84
|
-
"eslint-plugin-n": "^17.
|
|
84
|
+
"eslint-plugin-n": "^17.13.1",
|
|
85
85
|
"markdownlint-cli2": "^0.14.0",
|
|
86
86
|
"rxjs": "^7.0.0",
|
|
87
87
|
"tsup": "^8.3.5",
|
|
88
88
|
"tsx": "^4.19.2",
|
|
89
89
|
"typescript": "~5.6.3",
|
|
90
|
-
"typescript-eslint": "^8.
|
|
90
|
+
"typescript-eslint": "^8.13.0",
|
|
91
91
|
"vitest": "^2.1.4"
|
|
92
92
|
},
|
|
93
93
|
"engines": {
|