eslint-plugin-rxjs-x 0.9.2 → 0.9.3
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/dist/index.js +27 -27
- package/dist/index.mjs +27 -27
- package/package.json +2 -2
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.9.
|
|
3
|
+
var version = "0.9.3";
|
|
4
4
|
|
|
5
5
|
// src/configs/recommended.ts
|
|
6
6
|
var createRecommendedConfig = (plugin2) => ({
|
|
@@ -117,7 +117,10 @@ function couldBeType(type, name2, qualified) {
|
|
|
117
117
|
if (tsutils.isTypeReference(type)) {
|
|
118
118
|
type = type.target;
|
|
119
119
|
}
|
|
120
|
-
if (isType(type, name2, qualified)) {
|
|
120
|
+
if (isType(type.symbol, name2, qualified)) {
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
if (type.aliasSymbol && isType(type.aliasSymbol, name2, qualified)) {
|
|
121
124
|
return true;
|
|
122
125
|
}
|
|
123
126
|
if (tsutils.isUnionOrIntersectionType(type)) {
|
|
@@ -132,16 +135,16 @@ function couldBeType(type, name2, qualified) {
|
|
|
132
135
|
}
|
|
133
136
|
return false;
|
|
134
137
|
}
|
|
135
|
-
function isType(
|
|
136
|
-
if (!
|
|
138
|
+
function isType(symbol, name2, qualified) {
|
|
139
|
+
if (!symbol) {
|
|
137
140
|
return false;
|
|
138
141
|
}
|
|
139
142
|
if (qualified && !qualified.name.test(
|
|
140
|
-
qualified.typeChecker.getFullyQualifiedName(
|
|
143
|
+
qualified.typeChecker.getFullyQualifiedName(symbol)
|
|
141
144
|
)) {
|
|
142
145
|
return false;
|
|
143
146
|
}
|
|
144
|
-
return typeof name2 === "string" ?
|
|
147
|
+
return typeof name2 === "string" ? symbol.name === name2 : Boolean(symbol.name.match(name2));
|
|
145
148
|
}
|
|
146
149
|
function couldImplement(type, name2, qualified) {
|
|
147
150
|
const { symbol } = type;
|
|
@@ -3389,7 +3392,7 @@ var noUnboundMethodsRule = ruleCreator({
|
|
|
3389
3392
|
const { couldBeObservable, couldBeSubscription } = getTypeServices(context);
|
|
3390
3393
|
const nodeMap = /* @__PURE__ */ new WeakMap();
|
|
3391
3394
|
const [config = {}] = context.options;
|
|
3392
|
-
const { allowTypes =
|
|
3395
|
+
const { allowTypes = DEFAULT_UNBOUND_ALLOWED_TYPES } = config;
|
|
3393
3396
|
function mapArguments(node) {
|
|
3394
3397
|
node.arguments.filter(isMemberExpression).forEach((arg) => {
|
|
3395
3398
|
const argType = getTypeAtLocation(arg);
|
|
@@ -3711,6 +3714,16 @@ var noUnsafeSubjectNext = ruleCreator({
|
|
|
3711
3714
|
// src/rules/no-unsafe-switchmap.ts
|
|
3712
3715
|
|
|
3713
3716
|
var _decamelize = require('decamelize'); var _decamelize2 = _interopRequireDefault(_decamelize);
|
|
3717
|
+
var DEFAULT_DISALLOW = [
|
|
3718
|
+
"add",
|
|
3719
|
+
"create",
|
|
3720
|
+
"delete",
|
|
3721
|
+
"post",
|
|
3722
|
+
"put",
|
|
3723
|
+
"remove",
|
|
3724
|
+
"set",
|
|
3725
|
+
"update"
|
|
3726
|
+
];
|
|
3714
3727
|
var defaultOptions15 = [];
|
|
3715
3728
|
var noUnsafeSwitchmapRule = ruleCreator({
|
|
3716
3729
|
defaultOptions: defaultOptions15,
|
|
@@ -3737,7 +3750,8 @@ var noUnsafeSwitchmapRule = ruleCreator({
|
|
|
3737
3750
|
oneOf: [
|
|
3738
3751
|
{ type: "string", description: "A regular expression string." },
|
|
3739
3752
|
{ type: "array", items: { type: "string" }, description: "An array of words." }
|
|
3740
|
-
]
|
|
3753
|
+
],
|
|
3754
|
+
default: DEFAULT_DISALLOW
|
|
3741
3755
|
},
|
|
3742
3756
|
observable: {
|
|
3743
3757
|
type: "string",
|
|
@@ -3760,29 +3774,15 @@ var noUnsafeSwitchmapRule = ruleCreator({
|
|
|
3760
3774
|
name: "no-unsafe-switchmap",
|
|
3761
3775
|
create: (context) => {
|
|
3762
3776
|
var _a, _b, _c;
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
"create",
|
|
3766
|
-
"delete",
|
|
3767
|
-
"post",
|
|
3768
|
-
"put",
|
|
3769
|
-
"remove",
|
|
3770
|
-
"set",
|
|
3771
|
-
"update"
|
|
3772
|
-
];
|
|
3773
|
-
let allowRegExp;
|
|
3774
|
-
let disallowRegExp;
|
|
3775
|
-
let observableRegExp;
|
|
3777
|
+
let allowRegExp = void 0;
|
|
3778
|
+
let disallowRegExp = void 0;
|
|
3776
3779
|
const [config = {}] = context.options;
|
|
3777
|
-
if (config.allow
|
|
3780
|
+
if (config.allow) {
|
|
3778
3781
|
allowRegExp = createRegExpForWords((_a = config.allow) != null ? _a : []);
|
|
3779
|
-
disallowRegExp = createRegExpForWords((_b = config.disallow) != null ? _b : []);
|
|
3780
|
-
observableRegExp = new RegExp((_c = config.observable) != null ? _c : defaultObservable);
|
|
3781
3782
|
} else {
|
|
3782
|
-
|
|
3783
|
-
disallowRegExp = createRegExpForWords(defaultDisallow);
|
|
3784
|
-
observableRegExp = new RegExp(defaultObservable);
|
|
3783
|
+
disallowRegExp = createRegExpForWords((_b = config.disallow) != null ? _b : DEFAULT_DISALLOW);
|
|
3785
3784
|
}
|
|
3785
|
+
const observableRegExp = new RegExp((_c = config.observable) != null ? _c : defaultObservable);
|
|
3786
3786
|
const { couldBeObservable } = getTypeServices(context);
|
|
3787
3787
|
function shouldDisallow(args) {
|
|
3788
3788
|
const names = args.map((arg) => {
|
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.9.
|
|
3
|
+
var version = "0.9.3";
|
|
4
4
|
|
|
5
5
|
// src/configs/recommended.ts
|
|
6
6
|
var createRecommendedConfig = (plugin2) => ({
|
|
@@ -117,7 +117,10 @@ function couldBeType(type, name2, qualified) {
|
|
|
117
117
|
if (tsutils.isTypeReference(type)) {
|
|
118
118
|
type = type.target;
|
|
119
119
|
}
|
|
120
|
-
if (isType(type, name2, qualified)) {
|
|
120
|
+
if (isType(type.symbol, name2, qualified)) {
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
if (type.aliasSymbol && isType(type.aliasSymbol, name2, qualified)) {
|
|
121
124
|
return true;
|
|
122
125
|
}
|
|
123
126
|
if (tsutils.isUnionOrIntersectionType(type)) {
|
|
@@ -132,16 +135,16 @@ function couldBeType(type, name2, qualified) {
|
|
|
132
135
|
}
|
|
133
136
|
return false;
|
|
134
137
|
}
|
|
135
|
-
function isType(
|
|
136
|
-
if (!
|
|
138
|
+
function isType(symbol, name2, qualified) {
|
|
139
|
+
if (!symbol) {
|
|
137
140
|
return false;
|
|
138
141
|
}
|
|
139
142
|
if (qualified && !qualified.name.test(
|
|
140
|
-
qualified.typeChecker.getFullyQualifiedName(
|
|
143
|
+
qualified.typeChecker.getFullyQualifiedName(symbol)
|
|
141
144
|
)) {
|
|
142
145
|
return false;
|
|
143
146
|
}
|
|
144
|
-
return typeof name2 === "string" ?
|
|
147
|
+
return typeof name2 === "string" ? symbol.name === name2 : Boolean(symbol.name.match(name2));
|
|
145
148
|
}
|
|
146
149
|
function couldImplement(type, name2, qualified) {
|
|
147
150
|
const { symbol } = type;
|
|
@@ -3389,7 +3392,7 @@ var noUnboundMethodsRule = ruleCreator({
|
|
|
3389
3392
|
const { couldBeObservable, couldBeSubscription } = getTypeServices(context);
|
|
3390
3393
|
const nodeMap = /* @__PURE__ */ new WeakMap();
|
|
3391
3394
|
const [config = {}] = context.options;
|
|
3392
|
-
const { allowTypes =
|
|
3395
|
+
const { allowTypes = DEFAULT_UNBOUND_ALLOWED_TYPES } = config;
|
|
3393
3396
|
function mapArguments(node) {
|
|
3394
3397
|
node.arguments.filter(isMemberExpression).forEach((arg) => {
|
|
3395
3398
|
const argType = getTypeAtLocation(arg);
|
|
@@ -3711,6 +3714,16 @@ var noUnsafeSubjectNext = ruleCreator({
|
|
|
3711
3714
|
// src/rules/no-unsafe-switchmap.ts
|
|
3712
3715
|
import { stripIndent as stripIndent7 } from "common-tags";
|
|
3713
3716
|
import decamelize from "decamelize";
|
|
3717
|
+
var DEFAULT_DISALLOW = [
|
|
3718
|
+
"add",
|
|
3719
|
+
"create",
|
|
3720
|
+
"delete",
|
|
3721
|
+
"post",
|
|
3722
|
+
"put",
|
|
3723
|
+
"remove",
|
|
3724
|
+
"set",
|
|
3725
|
+
"update"
|
|
3726
|
+
];
|
|
3714
3727
|
var defaultOptions15 = [];
|
|
3715
3728
|
var noUnsafeSwitchmapRule = ruleCreator({
|
|
3716
3729
|
defaultOptions: defaultOptions15,
|
|
@@ -3737,7 +3750,8 @@ var noUnsafeSwitchmapRule = ruleCreator({
|
|
|
3737
3750
|
oneOf: [
|
|
3738
3751
|
{ type: "string", description: "A regular expression string." },
|
|
3739
3752
|
{ type: "array", items: { type: "string" }, description: "An array of words." }
|
|
3740
|
-
]
|
|
3753
|
+
],
|
|
3754
|
+
default: DEFAULT_DISALLOW
|
|
3741
3755
|
},
|
|
3742
3756
|
observable: {
|
|
3743
3757
|
type: "string",
|
|
@@ -3760,29 +3774,15 @@ var noUnsafeSwitchmapRule = ruleCreator({
|
|
|
3760
3774
|
name: "no-unsafe-switchmap",
|
|
3761
3775
|
create: (context) => {
|
|
3762
3776
|
var _a, _b, _c;
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
"create",
|
|
3766
|
-
"delete",
|
|
3767
|
-
"post",
|
|
3768
|
-
"put",
|
|
3769
|
-
"remove",
|
|
3770
|
-
"set",
|
|
3771
|
-
"update"
|
|
3772
|
-
];
|
|
3773
|
-
let allowRegExp;
|
|
3774
|
-
let disallowRegExp;
|
|
3775
|
-
let observableRegExp;
|
|
3777
|
+
let allowRegExp = void 0;
|
|
3778
|
+
let disallowRegExp = void 0;
|
|
3776
3779
|
const [config = {}] = context.options;
|
|
3777
|
-
if (config.allow
|
|
3780
|
+
if (config.allow) {
|
|
3778
3781
|
allowRegExp = createRegExpForWords((_a = config.allow) != null ? _a : []);
|
|
3779
|
-
disallowRegExp = createRegExpForWords((_b = config.disallow) != null ? _b : []);
|
|
3780
|
-
observableRegExp = new RegExp((_c = config.observable) != null ? _c : defaultObservable);
|
|
3781
3782
|
} else {
|
|
3782
|
-
|
|
3783
|
-
disallowRegExp = createRegExpForWords(defaultDisallow);
|
|
3784
|
-
observableRegExp = new RegExp(defaultObservable);
|
|
3783
|
+
disallowRegExp = createRegExpForWords((_b = config.disallow) != null ? _b : DEFAULT_DISALLOW);
|
|
3785
3784
|
}
|
|
3785
|
+
const observableRegExp = new RegExp((_c = config.observable) != null ? _c : defaultObservable);
|
|
3786
3786
|
const { couldBeObservable } = getTypeServices(context);
|
|
3787
3787
|
function shouldDisallow(args) {
|
|
3788
3788
|
const names = args.map((arg) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-rxjs-x",
|
|
3
3
|
"type": "commonjs",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.3",
|
|
5
5
|
"packageManager": "yarn@4.12.0+sha512.f45ab632439a67f8bc759bf32ead036a1f413287b9042726b7cc4818b7b49e14e9423ba49b18f9e06ea4941c1ad062385b1d8760a8d5091a1a31e5f6219afca8",
|
|
6
6
|
"description": "Modern ESLint plugin for RxJS",
|
|
7
7
|
"author": "Jason Weinzierl <weinzierljason@gmail.com>",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
90
90
|
"eslint-doc-generator": "^2.4.0",
|
|
91
91
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
92
|
-
"eslint-plugin-eslint-plugin": "
|
|
92
|
+
"eslint-plugin-eslint-plugin": "patch:eslint-plugin-eslint-plugin@npm%3A7.3.0#~/.yarn/patches/eslint-plugin-eslint-plugin-npm-7.3.0-d800475165.patch",
|
|
93
93
|
"eslint-plugin-import-x": "^4.16.1",
|
|
94
94
|
"eslint-plugin-n": "^17.23.2",
|
|
95
95
|
"markdownlint-cli2": "~0.19.0",
|