@ngrx/eslint-plugin 14.3.1 → 15.0.0-beta.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/package.json +225 -3
- package/src/configs/all-requiring-type-checking.js +0 -2
- package/src/configs/all-requiring-type-checking.js.map +1 -1
- package/src/configs/all.js +0 -2
- package/src/configs/all.js.map +1 -1
- package/src/configs/effects-requiring-type-checking.js +0 -2
- package/src/configs/effects-requiring-type-checking.js.map +1 -1
- package/src/configs/effects-strict-requiring-type-checking.js +0 -2
- package/src/configs/effects-strict-requiring-type-checking.js.map +1 -1
- package/src/configs/effects-strict.js +0 -2
- package/src/configs/effects-strict.js.map +1 -1
- package/src/configs/effects.js +0 -2
- package/src/configs/effects.js.map +1 -1
- package/src/configs/recommended-requiring-type-checking.js +0 -2
- package/src/configs/recommended-requiring-type-checking.js.map +1 -1
- package/src/configs/recommended.js +0 -2
- package/src/configs/recommended.js.map +1 -1
- package/src/configs/strict-requiring-type-checking.js +0 -2
- package/src/configs/strict-requiring-type-checking.js.map +1 -1
- package/src/configs/strict.js +0 -2
- package/src/configs/strict.js.map +1 -1
- package/src/rules/store/avoid-combining-selectors.js +34 -5
- package/src/rules/store/avoid-combining-selectors.js.map +1 -1
- package/src/rules/store/prefix-selectors-with-select.js.map +1 -1
- package/src/rules/store/select-style.js +8 -8
- package/src/rules/store/select-style.js.map +1 -1
- package/src/rules/effects/no-effect-decorator-and-creator.js +0 -107
- package/src/rules/effects/no-effect-decorator-and-creator.js.map +0 -1
- package/src/rules/effects/no-effect-decorator.js +0 -124
- package/src/rules/effects/no-effect-decorator.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngrx/eslint-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0-beta.0",
|
|
4
4
|
"description": "NgRx ESLint Plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -44,8 +44,230 @@
|
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"eslint": ">=8.0.0",
|
|
47
|
-
"typescript": ">=4.4.0"
|
|
47
|
+
"typescript": ">=4.4.0",
|
|
48
|
+
"@angular-devkit/core": "15.0.0-rc.0",
|
|
49
|
+
"ajv": "8.11.0",
|
|
50
|
+
"fast-deep-equal": "3.1.3",
|
|
51
|
+
"json-schema-traverse": "1.0.0",
|
|
52
|
+
"require-from-string": "2.0.2",
|
|
53
|
+
"uri-js": "4.4.1",
|
|
54
|
+
"punycode": "2.1.1",
|
|
55
|
+
"ajv-formats": "2.1.1",
|
|
56
|
+
"jsonc-parser": "3.2.0",
|
|
57
|
+
"rxjs": "6.6.7",
|
|
58
|
+
"tslib": "1.14.1",
|
|
59
|
+
"source-map": "0.7.4",
|
|
60
|
+
"magic-string": "0.26.7",
|
|
61
|
+
"sourcemap-codec": "1.4.8",
|
|
62
|
+
"bl": "4.1.0",
|
|
63
|
+
"buffer": "5.7.1",
|
|
64
|
+
"base64-js": "1.5.1",
|
|
65
|
+
"ieee754": "1.2.1",
|
|
66
|
+
"inherits": "2.0.4",
|
|
67
|
+
"readable-stream": "3.6.0",
|
|
68
|
+
"string_decoder": "1.3.0",
|
|
69
|
+
"safe-buffer": "5.2.1",
|
|
70
|
+
"util-deprecate": "1.0.2",
|
|
71
|
+
"chalk": "4.1.0",
|
|
72
|
+
"ansi-styles": "4.3.0",
|
|
73
|
+
"color-convert": "2.0.1",
|
|
74
|
+
"color-name": "1.1.4",
|
|
75
|
+
"supports-color": "7.2.0",
|
|
76
|
+
"has-flag": "4.0.0",
|
|
77
|
+
"cli-cursor": "3.1.0",
|
|
78
|
+
"restore-cursor": "3.1.0",
|
|
79
|
+
"onetime": "5.1.2",
|
|
80
|
+
"mimic-fn": "2.1.0",
|
|
81
|
+
"signal-exit": "3.0.3",
|
|
82
|
+
"cli-spinners": "2.6.1",
|
|
83
|
+
"is-interactive": "1.0.0",
|
|
84
|
+
"is-unicode-supported": "0.1.0",
|
|
85
|
+
"log-symbols": "4.1.0",
|
|
86
|
+
"strip-ansi": "6.0.0",
|
|
87
|
+
"ansi-regex": "5.0.0",
|
|
88
|
+
"wcwidth": "1.0.1",
|
|
89
|
+
"defaults": "1.0.3",
|
|
90
|
+
"clone": "1.0.4",
|
|
91
|
+
"@types/json-schema": "7.0.9",
|
|
92
|
+
"@typescript-eslint/scope-manager": "5.18.0",
|
|
93
|
+
"@typescript-eslint/types": "5.18.0",
|
|
94
|
+
"@typescript-eslint/visitor-keys": "5.18.0",
|
|
95
|
+
"eslint-visitor-keys": "3.3.0",
|
|
96
|
+
"@typescript-eslint/typescript-estree": "5.18.0",
|
|
97
|
+
"debug": "4.3.4",
|
|
98
|
+
"ms": "2.1.2",
|
|
99
|
+
"globby": "11.1.0",
|
|
100
|
+
"array-union": "2.1.0",
|
|
101
|
+
"dir-glob": "3.0.1",
|
|
102
|
+
"path-type": "4.0.0",
|
|
103
|
+
"fast-glob": "3.2.11",
|
|
104
|
+
"@nodelib/fs.stat": "2.0.4",
|
|
105
|
+
"@nodelib/fs.walk": "1.2.6",
|
|
106
|
+
"@nodelib/fs.scandir": "2.1.4",
|
|
107
|
+
"run-parallel": "1.2.0",
|
|
108
|
+
"queue-microtask": "1.2.3",
|
|
109
|
+
"fastq": "1.11.0",
|
|
110
|
+
"reusify": "1.0.4",
|
|
111
|
+
"glob-parent": "5.1.2",
|
|
112
|
+
"is-glob": "4.0.1",
|
|
113
|
+
"is-extglob": "2.1.1",
|
|
114
|
+
"merge2": "1.4.1",
|
|
115
|
+
"micromatch": "4.0.4",
|
|
116
|
+
"braces": "3.0.2",
|
|
117
|
+
"fill-range": "7.0.1",
|
|
118
|
+
"to-regex-range": "5.0.1",
|
|
119
|
+
"is-number": "7.0.0",
|
|
120
|
+
"picomatch": "2.2.3",
|
|
121
|
+
"ignore": "5.2.0",
|
|
122
|
+
"slash": "3.0.0",
|
|
123
|
+
"lru-cache": "6.0.0",
|
|
124
|
+
"yallist": "4.0.0",
|
|
125
|
+
"eslint-scope": "5.1.1",
|
|
126
|
+
"esrecurse": "4.3.0",
|
|
127
|
+
"estraverse": "5.2.0",
|
|
128
|
+
"eslint-utils": "3.0.0",
|
|
129
|
+
"tsutils-etc": "1.4.1",
|
|
130
|
+
"@types/yargs": "17.0.10",
|
|
131
|
+
"@types/yargs-parser": "20.2.0",
|
|
132
|
+
"yargs": "17.6.0",
|
|
133
|
+
"cliui": "8.0.1",
|
|
134
|
+
"string-width": "4.2.3",
|
|
135
|
+
"emoji-regex": "8.0.0",
|
|
136
|
+
"is-fullwidth-code-point": "3.0.0",
|
|
137
|
+
"wrap-ansi": "7.0.0",
|
|
138
|
+
"escalade": "3.1.1",
|
|
139
|
+
"get-caller-file": "2.0.5",
|
|
140
|
+
"require-directory": "2.1.1",
|
|
141
|
+
"y18n": "5.0.8",
|
|
142
|
+
"yargs-parser": "21.0.1",
|
|
143
|
+
"@eslint/eslintrc": "1.3.1",
|
|
144
|
+
"fast-json-stable-stringify": "2.1.0",
|
|
145
|
+
"espree": "9.4.0",
|
|
146
|
+
"acorn": "8.8.0",
|
|
147
|
+
"acorn-jsx": "5.3.2",
|
|
148
|
+
"globals": "13.17.0",
|
|
149
|
+
"type-fest": "0.20.2",
|
|
150
|
+
"import-fresh": "3.3.0",
|
|
151
|
+
"parent-module": "1.0.1",
|
|
152
|
+
"callsites": "3.1.0",
|
|
153
|
+
"resolve-from": "4.0.0",
|
|
154
|
+
"js-yaml": "4.1.0",
|
|
155
|
+
"argparse": "2.0.1",
|
|
156
|
+
"minimatch": "3.1.2",
|
|
157
|
+
"brace-expansion": "1.1.11",
|
|
158
|
+
"balanced-match": "1.0.2",
|
|
159
|
+
"concat-map": "0.0.1",
|
|
160
|
+
"@humanwhocodes/config-array": "0.9.5",
|
|
161
|
+
"@humanwhocodes/object-schema": "1.2.1",
|
|
162
|
+
"cross-spawn": "7.0.3",
|
|
163
|
+
"path-key": "3.1.1",
|
|
164
|
+
"shebang-command": "2.0.0",
|
|
165
|
+
"shebang-regex": "3.0.0",
|
|
166
|
+
"which": "2.0.2",
|
|
167
|
+
"isexe": "2.0.0",
|
|
168
|
+
"doctrine": "3.0.0",
|
|
169
|
+
"esutils": "2.0.3",
|
|
170
|
+
"escape-string-regexp": "4.0.0",
|
|
171
|
+
"esquery": "1.4.0",
|
|
172
|
+
"file-entry-cache": "6.0.1",
|
|
173
|
+
"flat-cache": "3.0.4",
|
|
174
|
+
"flatted": "3.1.1",
|
|
175
|
+
"fs.realpath": "1.0.0",
|
|
176
|
+
"inflight": "1.0.6",
|
|
177
|
+
"once": "1.4.0",
|
|
178
|
+
"wrappy": "1.0.2",
|
|
179
|
+
"path-is-absolute": "1.0.1",
|
|
180
|
+
"functional-red-black-tree": "1.0.1",
|
|
181
|
+
"imurmurhash": "0.1.4",
|
|
182
|
+
"json-stable-stringify-without-jsonify": "1.0.1",
|
|
183
|
+
"levn": "0.4.1",
|
|
184
|
+
"prelude-ls": "1.2.1",
|
|
185
|
+
"type-check": "0.4.0",
|
|
186
|
+
"lodash.merge": "4.6.2",
|
|
187
|
+
"natural-compare": "1.4.0",
|
|
188
|
+
"optionator": "0.9.1",
|
|
189
|
+
"deep-is": "0.1.3",
|
|
190
|
+
"fast-levenshtein": "2.0.6",
|
|
191
|
+
"word-wrap": "1.2.3",
|
|
192
|
+
"regexpp": "3.2.0",
|
|
193
|
+
"text-table": "0.2.0",
|
|
194
|
+
"v8-compile-cache": "2.3.0",
|
|
195
|
+
"bs-logger": "0.2.6",
|
|
196
|
+
"esbuild-wasm": "0.15.11",
|
|
197
|
+
"@jest/environment": "28.1.3",
|
|
198
|
+
"@jest/fake-timers": "28.1.3",
|
|
199
|
+
"@jest/types": "28.1.3",
|
|
200
|
+
"@jest/schemas": "28.1.3",
|
|
201
|
+
"@sinclair/typebox": "0.24.28",
|
|
202
|
+
"@types/istanbul-lib-coverage": "2.0.3",
|
|
203
|
+
"@types/istanbul-reports": "3.0.0",
|
|
204
|
+
"@types/istanbul-lib-report": "3.0.0",
|
|
205
|
+
"@sinonjs/fake-timers": "9.1.2",
|
|
206
|
+
"@sinonjs/commons": "1.8.3",
|
|
207
|
+
"type-detect": "4.0.8",
|
|
208
|
+
"jest-message-util": "28.1.3",
|
|
209
|
+
"@babel/code-frame": "7.12.13",
|
|
210
|
+
"@babel/highlight": "7.13.10",
|
|
211
|
+
"@babel/helper-validator-identifier": "7.12.11",
|
|
212
|
+
"js-tokens": "4.0.0",
|
|
213
|
+
"@types/stack-utils": "2.0.0",
|
|
214
|
+
"graceful-fs": "4.2.10",
|
|
215
|
+
"pretty-format": "28.1.3",
|
|
216
|
+
"react-is": "18.2.0",
|
|
217
|
+
"stack-utils": "2.0.3",
|
|
218
|
+
"jest-mock": "28.1.3",
|
|
219
|
+
"jest-util": "28.1.3",
|
|
220
|
+
"ci-info": "3.2.0",
|
|
221
|
+
"@types/jsdom": "16.2.15",
|
|
222
|
+
"@types/parse5": "6.0.3",
|
|
223
|
+
"@types/tough-cookie": "4.0.2",
|
|
224
|
+
"jsdom": "19.0.0",
|
|
225
|
+
"abab": "2.0.5",
|
|
226
|
+
"acorn-globals": "6.0.0",
|
|
227
|
+
"acorn-walk": "7.2.0",
|
|
228
|
+
"cssom": "0.5.0",
|
|
229
|
+
"cssstyle": "2.3.0",
|
|
230
|
+
"data-urls": "3.0.2",
|
|
231
|
+
"whatwg-mimetype": "3.0.0",
|
|
232
|
+
"whatwg-url": "11.0.0",
|
|
233
|
+
"tr46": "3.0.0",
|
|
234
|
+
"webidl-conversions": "7.0.0",
|
|
235
|
+
"decimal.js": "10.4.0",
|
|
236
|
+
"domexception": "4.0.0",
|
|
237
|
+
"escodegen": "2.0.0",
|
|
238
|
+
"esprima": "4.0.1",
|
|
239
|
+
"form-data": "4.0.0",
|
|
240
|
+
"asynckit": "0.4.0",
|
|
241
|
+
"combined-stream": "1.0.8",
|
|
242
|
+
"delayed-stream": "1.0.0",
|
|
243
|
+
"mime-types": "2.1.30",
|
|
244
|
+
"mime-db": "1.47.0",
|
|
245
|
+
"html-encoding-sniffer": "3.0.0",
|
|
246
|
+
"whatwg-encoding": "2.0.0",
|
|
247
|
+
"iconv-lite": "0.6.3",
|
|
248
|
+
"safer-buffer": "2.1.2",
|
|
249
|
+
"http-proxy-agent": "5.0.0",
|
|
250
|
+
"@tootallnate/once": "2.0.0",
|
|
251
|
+
"agent-base": "6.0.2",
|
|
252
|
+
"https-proxy-agent": "5.0.1",
|
|
253
|
+
"is-potential-custom-element-name": "1.0.1",
|
|
254
|
+
"nwsapi": "2.2.0",
|
|
255
|
+
"parse5": "6.0.1",
|
|
256
|
+
"saxes": "5.0.1",
|
|
257
|
+
"xmlchars": "2.2.0",
|
|
258
|
+
"symbol-tree": "3.2.4",
|
|
259
|
+
"tough-cookie": "4.0.0",
|
|
260
|
+
"psl": "1.8.0",
|
|
261
|
+
"universalify": "0.1.2",
|
|
262
|
+
"w3c-hr-time": "1.0.2",
|
|
263
|
+
"browser-process-hrtime": "1.0.0",
|
|
264
|
+
"w3c-xmlserializer": "3.0.0",
|
|
265
|
+
"xml-name-validator": "4.0.0",
|
|
266
|
+
"ws": "8.8.1",
|
|
267
|
+
"json5": "2.2.1",
|
|
268
|
+
"lodash.memoize": "4.1.2",
|
|
269
|
+
"make-error": "1.3.6"
|
|
48
270
|
},
|
|
49
271
|
"main": "./src/index.js",
|
|
50
|
-
"
|
|
272
|
+
"types": "./src/index.d.ts"
|
|
51
273
|
}
|
|
@@ -15,8 +15,6 @@ module.exports = {
|
|
|
15
15
|
'@ngrx/updater-explicit-return-type': 'warn',
|
|
16
16
|
'@ngrx/avoid-cyclic-effects': 'warn',
|
|
17
17
|
'@ngrx/no-dispatch-in-effects': 'warn',
|
|
18
|
-
'@ngrx/no-effect-decorator-and-creator': 'error',
|
|
19
|
-
'@ngrx/no-effect-decorator': 'warn',
|
|
20
18
|
'@ngrx/no-effects-in-providers': 'error',
|
|
21
19
|
'@ngrx/no-multiple-actions-in-effects': 'warn',
|
|
22
20
|
'@ngrx/prefer-action-creator-in-of-type': 'warn',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all-requiring-type-checking.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/src/configs/all-requiring-type-checking.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,iBAAS;IACP,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE;QACb,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,iBAAiB;KAC3B;IACD,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,oCAAoC,EAAE,MAAM;QAC5C,4BAA4B,EAAE,MAAM;QACpC,8BAA8B,EAAE,MAAM;QACtC
|
|
1
|
+
{"version":3,"file":"all-requiring-type-checking.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/src/configs/all-requiring-type-checking.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,iBAAS;IACP,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE;QACb,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,iBAAiB;KAC3B;IACD,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,oCAAoC,EAAE,MAAM;QAC5C,4BAA4B,EAAE,MAAM;QACpC,8BAA8B,EAAE,MAAM;QACtC,+BAA+B,EAAE,OAAO;QACxC,sCAAsC,EAAE,MAAM;QAC9C,wCAAwC,EAAE,MAAM;QAChD,iCAAiC,EAAE,MAAM;QACzC,iDAAiD,EAAE,MAAM;QACzD,uCAAuC,EAAE,MAAM;QAC/C,iCAAiC,EAAE,MAAM;QACzC,uDAAuD,EAAE,MAAM;QAC/D,0CAA0C,EAAE,MAAM;QAClD,+BAA+B,EAAE,MAAM;QACvC,2BAA2B,EAAE,MAAM;QACnC,iCAAiC,EAAE,MAAM;QACzC,+BAA+B,EAAE,MAAM;QACvC,6BAA6B,EAAE,MAAM;QACrC,6BAA6B,EAAE,MAAM;QACrC,wCAAwC,EAAE,MAAM;QAChD,yCAAyC,EAAE,MAAM;QACjD,6BAA6B,EAAE,MAAM;QACrC,kCAAkC,EAAE,MAAM;QAC1C,yDAAyD,EAAE,MAAM;QACjE,iCAAiC,EAAE,MAAM;QACzC,oCAAoC,EAAE,MAAM;QAC5C,oBAAoB,EAAE,MAAM;QAC5B,wCAAwC,EAAE,MAAM;KACjD;CACF,CAAC","sourcesContent":["/**\n * DO NOT EDIT\n * This file is generated\n */\n\nexport = {\n parser: '@typescript-eslint/parser',\n parserOptions: {\n ecmaVersion: 2020,\n sourceType: 'module',\n project: './tsconfig.json',\n },\n plugins: ['@ngrx'],\n rules: {\n '@ngrx/updater-explicit-return-type': 'warn',\n '@ngrx/avoid-cyclic-effects': 'warn',\n '@ngrx/no-dispatch-in-effects': 'warn',\n '@ngrx/no-effects-in-providers': 'error',\n '@ngrx/no-multiple-actions-in-effects': 'warn',\n '@ngrx/prefer-action-creator-in-of-type': 'warn',\n '@ngrx/prefer-concat-latest-from': 'warn',\n '@ngrx/prefer-effect-callback-in-block-statement': 'warn',\n '@ngrx/use-effects-lifecycle-interface': 'warn',\n '@ngrx/avoid-combining-selectors': 'warn',\n '@ngrx/avoid-dispatching-multiple-actions-sequentially': 'warn',\n '@ngrx/avoid-duplicate-actions-in-reducer': 'warn',\n '@ngrx/avoid-mapping-selectors': 'warn',\n '@ngrx/good-action-hygiene': 'warn',\n '@ngrx/no-multiple-global-stores': 'warn',\n '@ngrx/no-reducer-in-key-names': 'warn',\n '@ngrx/no-store-subscription': 'warn',\n '@ngrx/no-typed-global-store': 'warn',\n '@ngrx/on-function-explicit-return-type': 'warn',\n '@ngrx/prefer-action-creator-in-dispatch': 'warn',\n '@ngrx/prefer-action-creator': 'warn',\n '@ngrx/prefer-inline-action-props': 'warn',\n '@ngrx/prefer-one-generic-in-create-for-feature-selector': 'warn',\n '@ngrx/prefer-selector-in-select': 'warn',\n '@ngrx/prefix-selectors-with-select': 'warn',\n '@ngrx/select-style': 'warn',\n '@ngrx/use-consistent-global-store-name': 'warn',\n },\n};\n"]}
|
package/src/configs/all.js
CHANGED
|
@@ -9,8 +9,6 @@ module.exports = {
|
|
|
9
9
|
rules: {
|
|
10
10
|
'@ngrx/updater-explicit-return-type': 'warn',
|
|
11
11
|
'@ngrx/no-dispatch-in-effects': 'warn',
|
|
12
|
-
'@ngrx/no-effect-decorator-and-creator': 'error',
|
|
13
|
-
'@ngrx/no-effect-decorator': 'warn',
|
|
14
12
|
'@ngrx/no-effects-in-providers': 'error',
|
|
15
13
|
'@ngrx/prefer-action-creator-in-of-type': 'warn',
|
|
16
14
|
'@ngrx/prefer-concat-latest-from': 'warn',
|
package/src/configs/all.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/src/configs/all.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,iBAAS;IACP,MAAM,EAAE,2BAA2B;IAEnC,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,oCAAoC,EAAE,MAAM;QAC5C,8BAA8B,EAAE,MAAM;QACtC
|
|
1
|
+
{"version":3,"file":"all.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/src/configs/all.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,iBAAS;IACP,MAAM,EAAE,2BAA2B;IAEnC,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,oCAAoC,EAAE,MAAM;QAC5C,8BAA8B,EAAE,MAAM;QACtC,+BAA+B,EAAE,OAAO;QACxC,wCAAwC,EAAE,MAAM;QAChD,iCAAiC,EAAE,MAAM;QACzC,iDAAiD,EAAE,MAAM;QACzD,uCAAuC,EAAE,MAAM;QAC/C,iCAAiC,EAAE,MAAM;QACzC,uDAAuD,EAAE,MAAM;QAC/D,0CAA0C,EAAE,MAAM;QAClD,+BAA+B,EAAE,MAAM;QACvC,2BAA2B,EAAE,MAAM;QACnC,iCAAiC,EAAE,MAAM;QACzC,+BAA+B,EAAE,MAAM;QACvC,6BAA6B,EAAE,MAAM;QACrC,6BAA6B,EAAE,MAAM;QACrC,wCAAwC,EAAE,MAAM;QAChD,yCAAyC,EAAE,MAAM;QACjD,6BAA6B,EAAE,MAAM;QACrC,kCAAkC,EAAE,MAAM;QAC1C,yDAAyD,EAAE,MAAM;QACjE,iCAAiC,EAAE,MAAM;QACzC,oCAAoC,EAAE,MAAM;QAC5C,oBAAoB,EAAE,MAAM;QAC5B,wCAAwC,EAAE,MAAM;KACjD;CACF,CAAC","sourcesContent":["/**\n * DO NOT EDIT\n * This file is generated\n */\n\nexport = {\n parser: '@typescript-eslint/parser',\n\n plugins: ['@ngrx'],\n rules: {\n '@ngrx/updater-explicit-return-type': 'warn',\n '@ngrx/no-dispatch-in-effects': 'warn',\n '@ngrx/no-effects-in-providers': 'error',\n '@ngrx/prefer-action-creator-in-of-type': 'warn',\n '@ngrx/prefer-concat-latest-from': 'warn',\n '@ngrx/prefer-effect-callback-in-block-statement': 'warn',\n '@ngrx/use-effects-lifecycle-interface': 'warn',\n '@ngrx/avoid-combining-selectors': 'warn',\n '@ngrx/avoid-dispatching-multiple-actions-sequentially': 'warn',\n '@ngrx/avoid-duplicate-actions-in-reducer': 'warn',\n '@ngrx/avoid-mapping-selectors': 'warn',\n '@ngrx/good-action-hygiene': 'warn',\n '@ngrx/no-multiple-global-stores': 'warn',\n '@ngrx/no-reducer-in-key-names': 'warn',\n '@ngrx/no-store-subscription': 'warn',\n '@ngrx/no-typed-global-store': 'warn',\n '@ngrx/on-function-explicit-return-type': 'warn',\n '@ngrx/prefer-action-creator-in-dispatch': 'warn',\n '@ngrx/prefer-action-creator': 'warn',\n '@ngrx/prefer-inline-action-props': 'warn',\n '@ngrx/prefer-one-generic-in-create-for-feature-selector': 'warn',\n '@ngrx/prefer-selector-in-select': 'warn',\n '@ngrx/prefix-selectors-with-select': 'warn',\n '@ngrx/select-style': 'warn',\n '@ngrx/use-consistent-global-store-name': 'warn',\n },\n};\n"]}
|
|
@@ -14,8 +14,6 @@ module.exports = {
|
|
|
14
14
|
rules: {
|
|
15
15
|
'@ngrx/avoid-cyclic-effects': 'warn',
|
|
16
16
|
'@ngrx/no-dispatch-in-effects': 'warn',
|
|
17
|
-
'@ngrx/no-effect-decorator-and-creator': 'error',
|
|
18
|
-
'@ngrx/no-effect-decorator': 'warn',
|
|
19
17
|
'@ngrx/no-effects-in-providers': 'error',
|
|
20
18
|
'@ngrx/no-multiple-actions-in-effects': 'warn',
|
|
21
19
|
'@ngrx/prefer-action-creator-in-of-type': 'warn',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effects-requiring-type-checking.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/src/configs/effects-requiring-type-checking.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,iBAAS;IACP,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE;QACb,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,iBAAiB;KAC3B;IACD,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,4BAA4B,EAAE,MAAM;QACpC,8BAA8B,EAAE,MAAM;QACtC
|
|
1
|
+
{"version":3,"file":"effects-requiring-type-checking.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/src/configs/effects-requiring-type-checking.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,iBAAS;IACP,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE;QACb,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,iBAAiB;KAC3B;IACD,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,4BAA4B,EAAE,MAAM;QACpC,8BAA8B,EAAE,MAAM;QACtC,+BAA+B,EAAE,OAAO;QACxC,sCAAsC,EAAE,MAAM;QAC9C,wCAAwC,EAAE,MAAM;QAChD,iCAAiC,EAAE,MAAM;QACzC,iDAAiD,EAAE,MAAM;QACzD,uCAAuC,EAAE,MAAM;KAChD;CACF,CAAC","sourcesContent":["/**\n * DO NOT EDIT\n * This file is generated\n */\n\nexport = {\n parser: '@typescript-eslint/parser',\n parserOptions: {\n ecmaVersion: 2020,\n sourceType: 'module',\n project: './tsconfig.json',\n },\n plugins: ['@ngrx'],\n rules: {\n '@ngrx/avoid-cyclic-effects': 'warn',\n '@ngrx/no-dispatch-in-effects': 'warn',\n '@ngrx/no-effects-in-providers': 'error',\n '@ngrx/no-multiple-actions-in-effects': 'warn',\n '@ngrx/prefer-action-creator-in-of-type': 'warn',\n '@ngrx/prefer-concat-latest-from': 'warn',\n '@ngrx/prefer-effect-callback-in-block-statement': 'warn',\n '@ngrx/use-effects-lifecycle-interface': 'warn',\n },\n};\n"]}
|
|
@@ -14,8 +14,6 @@ module.exports = {
|
|
|
14
14
|
rules: {
|
|
15
15
|
'@ngrx/avoid-cyclic-effects': 'error',
|
|
16
16
|
'@ngrx/no-dispatch-in-effects': 'error',
|
|
17
|
-
'@ngrx/no-effect-decorator-and-creator': 'error',
|
|
18
|
-
'@ngrx/no-effect-decorator': 'error',
|
|
19
17
|
'@ngrx/no-effects-in-providers': 'error',
|
|
20
18
|
'@ngrx/no-multiple-actions-in-effects': 'error',
|
|
21
19
|
'@ngrx/prefer-action-creator-in-of-type': 'error',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effects-strict-requiring-type-checking.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/src/configs/effects-strict-requiring-type-checking.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,iBAAS;IACP,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE;QACb,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,iBAAiB;KAC3B;IACD,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,4BAA4B,EAAE,OAAO;QACrC,8BAA8B,EAAE,OAAO;QACvC
|
|
1
|
+
{"version":3,"file":"effects-strict-requiring-type-checking.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/src/configs/effects-strict-requiring-type-checking.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,iBAAS;IACP,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE;QACb,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,iBAAiB;KAC3B;IACD,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,4BAA4B,EAAE,OAAO;QACrC,8BAA8B,EAAE,OAAO;QACvC,+BAA+B,EAAE,OAAO;QACxC,sCAAsC,EAAE,OAAO;QAC/C,wCAAwC,EAAE,OAAO;QACjD,iCAAiC,EAAE,OAAO;QAC1C,iDAAiD,EAAE,OAAO;QAC1D,uCAAuC,EAAE,OAAO;KACjD;CACF,CAAC","sourcesContent":["/**\n * DO NOT EDIT\n * This file is generated\n */\n\nexport = {\n parser: '@typescript-eslint/parser',\n parserOptions: {\n ecmaVersion: 2020,\n sourceType: 'module',\n project: './tsconfig.json',\n },\n plugins: ['@ngrx'],\n rules: {\n '@ngrx/avoid-cyclic-effects': 'error',\n '@ngrx/no-dispatch-in-effects': 'error',\n '@ngrx/no-effects-in-providers': 'error',\n '@ngrx/no-multiple-actions-in-effects': 'error',\n '@ngrx/prefer-action-creator-in-of-type': 'error',\n '@ngrx/prefer-concat-latest-from': 'error',\n '@ngrx/prefer-effect-callback-in-block-statement': 'error',\n '@ngrx/use-effects-lifecycle-interface': 'error',\n },\n};\n"]}
|
|
@@ -8,8 +8,6 @@ module.exports = {
|
|
|
8
8
|
plugins: ['@ngrx'],
|
|
9
9
|
rules: {
|
|
10
10
|
'@ngrx/no-dispatch-in-effects': 'error',
|
|
11
|
-
'@ngrx/no-effect-decorator-and-creator': 'error',
|
|
12
|
-
'@ngrx/no-effect-decorator': 'error',
|
|
13
11
|
'@ngrx/no-effects-in-providers': 'error',
|
|
14
12
|
'@ngrx/prefer-action-creator-in-of-type': 'error',
|
|
15
13
|
'@ngrx/prefer-concat-latest-from': 'error',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effects-strict.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/src/configs/effects-strict.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,iBAAS;IACP,MAAM,EAAE,2BAA2B;IAEnC,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,8BAA8B,EAAE,OAAO;QACvC
|
|
1
|
+
{"version":3,"file":"effects-strict.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/src/configs/effects-strict.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,iBAAS;IACP,MAAM,EAAE,2BAA2B;IAEnC,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,8BAA8B,EAAE,OAAO;QACvC,+BAA+B,EAAE,OAAO;QACxC,wCAAwC,EAAE,OAAO;QACjD,iCAAiC,EAAE,OAAO;QAC1C,iDAAiD,EAAE,OAAO;QAC1D,uCAAuC,EAAE,OAAO;KACjD;CACF,CAAC","sourcesContent":["/**\n * DO NOT EDIT\n * This file is generated\n */\n\nexport = {\n parser: '@typescript-eslint/parser',\n\n plugins: ['@ngrx'],\n rules: {\n '@ngrx/no-dispatch-in-effects': 'error',\n '@ngrx/no-effects-in-providers': 'error',\n '@ngrx/prefer-action-creator-in-of-type': 'error',\n '@ngrx/prefer-concat-latest-from': 'error',\n '@ngrx/prefer-effect-callback-in-block-statement': 'error',\n '@ngrx/use-effects-lifecycle-interface': 'error',\n },\n};\n"]}
|
package/src/configs/effects.js
CHANGED
|
@@ -8,8 +8,6 @@ module.exports = {
|
|
|
8
8
|
plugins: ['@ngrx'],
|
|
9
9
|
rules: {
|
|
10
10
|
'@ngrx/no-dispatch-in-effects': 'warn',
|
|
11
|
-
'@ngrx/no-effect-decorator-and-creator': 'error',
|
|
12
|
-
'@ngrx/no-effect-decorator': 'warn',
|
|
13
11
|
'@ngrx/no-effects-in-providers': 'error',
|
|
14
12
|
'@ngrx/prefer-action-creator-in-of-type': 'warn',
|
|
15
13
|
'@ngrx/prefer-concat-latest-from': 'warn',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effects.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/src/configs/effects.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,iBAAS;IACP,MAAM,EAAE,2BAA2B;IAEnC,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,8BAA8B,EAAE,MAAM;QACtC
|
|
1
|
+
{"version":3,"file":"effects.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/src/configs/effects.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,iBAAS;IACP,MAAM,EAAE,2BAA2B;IAEnC,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,8BAA8B,EAAE,MAAM;QACtC,+BAA+B,EAAE,OAAO;QACxC,wCAAwC,EAAE,MAAM;QAChD,iCAAiC,EAAE,MAAM;QACzC,iDAAiD,EAAE,MAAM;QACzD,uCAAuC,EAAE,MAAM;KAChD;CACF,CAAC","sourcesContent":["/**\n * DO NOT EDIT\n * This file is generated\n */\n\nexport = {\n parser: '@typescript-eslint/parser',\n\n plugins: ['@ngrx'],\n rules: {\n '@ngrx/no-dispatch-in-effects': 'warn',\n '@ngrx/no-effects-in-providers': 'error',\n '@ngrx/prefer-action-creator-in-of-type': 'warn',\n '@ngrx/prefer-concat-latest-from': 'warn',\n '@ngrx/prefer-effect-callback-in-block-statement': 'warn',\n '@ngrx/use-effects-lifecycle-interface': 'warn',\n },\n};\n"]}
|
|
@@ -15,8 +15,6 @@ module.exports = {
|
|
|
15
15
|
'@ngrx/updater-explicit-return-type': 'warn',
|
|
16
16
|
'@ngrx/avoid-cyclic-effects': 'warn',
|
|
17
17
|
'@ngrx/no-dispatch-in-effects': 'warn',
|
|
18
|
-
'@ngrx/no-effect-decorator-and-creator': 'error',
|
|
19
|
-
'@ngrx/no-effect-decorator': 'warn',
|
|
20
18
|
'@ngrx/no-effects-in-providers': 'error',
|
|
21
19
|
'@ngrx/no-multiple-actions-in-effects': 'warn',
|
|
22
20
|
'@ngrx/prefer-action-creator-in-of-type': 'warn',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recommended-requiring-type-checking.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/src/configs/recommended-requiring-type-checking.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,iBAAS;IACP,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE;QACb,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,iBAAiB;KAC3B;IACD,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,oCAAoC,EAAE,MAAM;QAC5C,4BAA4B,EAAE,MAAM;QACpC,8BAA8B,EAAE,MAAM;QACtC
|
|
1
|
+
{"version":3,"file":"recommended-requiring-type-checking.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/src/configs/recommended-requiring-type-checking.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,iBAAS;IACP,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE;QACb,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,iBAAiB;KAC3B;IACD,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,oCAAoC,EAAE,MAAM;QAC5C,4BAA4B,EAAE,MAAM;QACpC,8BAA8B,EAAE,MAAM;QACtC,+BAA+B,EAAE,OAAO;QACxC,sCAAsC,EAAE,MAAM;QAC9C,wCAAwC,EAAE,MAAM;QAChD,iCAAiC,EAAE,MAAM;QACzC,iDAAiD,EAAE,MAAM;QACzD,uCAAuC,EAAE,MAAM;QAC/C,iCAAiC,EAAE,MAAM;QACzC,uDAAuD,EAAE,MAAM;QAC/D,0CAA0C,EAAE,MAAM;QAClD,+BAA+B,EAAE,MAAM;QACvC,2BAA2B,EAAE,MAAM;QACnC,iCAAiC,EAAE,MAAM;QACzC,+BAA+B,EAAE,MAAM;QACvC,6BAA6B,EAAE,MAAM;QACrC,6BAA6B,EAAE,MAAM;QACrC,wCAAwC,EAAE,MAAM;QAChD,yCAAyC,EAAE,MAAM;QACjD,6BAA6B,EAAE,MAAM;QACrC,kCAAkC,EAAE,MAAM;QAC1C,yDAAyD,EAAE,MAAM;QACjE,iCAAiC,EAAE,MAAM;QACzC,oCAAoC,EAAE,MAAM;QAC5C,oBAAoB,EAAE,MAAM;QAC5B,wCAAwC,EAAE,MAAM;KACjD;CACF,CAAC","sourcesContent":["/**\n * DO NOT EDIT\n * This file is generated\n */\n\nexport = {\n parser: '@typescript-eslint/parser',\n parserOptions: {\n ecmaVersion: 2020,\n sourceType: 'module',\n project: './tsconfig.json',\n },\n plugins: ['@ngrx'],\n rules: {\n '@ngrx/updater-explicit-return-type': 'warn',\n '@ngrx/avoid-cyclic-effects': 'warn',\n '@ngrx/no-dispatch-in-effects': 'warn',\n '@ngrx/no-effects-in-providers': 'error',\n '@ngrx/no-multiple-actions-in-effects': 'warn',\n '@ngrx/prefer-action-creator-in-of-type': 'warn',\n '@ngrx/prefer-concat-latest-from': 'warn',\n '@ngrx/prefer-effect-callback-in-block-statement': 'warn',\n '@ngrx/use-effects-lifecycle-interface': 'warn',\n '@ngrx/avoid-combining-selectors': 'warn',\n '@ngrx/avoid-dispatching-multiple-actions-sequentially': 'warn',\n '@ngrx/avoid-duplicate-actions-in-reducer': 'warn',\n '@ngrx/avoid-mapping-selectors': 'warn',\n '@ngrx/good-action-hygiene': 'warn',\n '@ngrx/no-multiple-global-stores': 'warn',\n '@ngrx/no-reducer-in-key-names': 'warn',\n '@ngrx/no-store-subscription': 'warn',\n '@ngrx/no-typed-global-store': 'warn',\n '@ngrx/on-function-explicit-return-type': 'warn',\n '@ngrx/prefer-action-creator-in-dispatch': 'warn',\n '@ngrx/prefer-action-creator': 'warn',\n '@ngrx/prefer-inline-action-props': 'warn',\n '@ngrx/prefer-one-generic-in-create-for-feature-selector': 'warn',\n '@ngrx/prefer-selector-in-select': 'warn',\n '@ngrx/prefix-selectors-with-select': 'warn',\n '@ngrx/select-style': 'warn',\n '@ngrx/use-consistent-global-store-name': 'warn',\n },\n};\n"]}
|
|
@@ -9,8 +9,6 @@ module.exports = {
|
|
|
9
9
|
rules: {
|
|
10
10
|
'@ngrx/updater-explicit-return-type': 'warn',
|
|
11
11
|
'@ngrx/no-dispatch-in-effects': 'warn',
|
|
12
|
-
'@ngrx/no-effect-decorator-and-creator': 'error',
|
|
13
|
-
'@ngrx/no-effect-decorator': 'warn',
|
|
14
12
|
'@ngrx/no-effects-in-providers': 'error',
|
|
15
13
|
'@ngrx/prefer-action-creator-in-of-type': 'warn',
|
|
16
14
|
'@ngrx/prefer-concat-latest-from': 'warn',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recommended.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/src/configs/recommended.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,iBAAS;IACP,MAAM,EAAE,2BAA2B;IAEnC,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,oCAAoC,EAAE,MAAM;QAC5C,8BAA8B,EAAE,MAAM;QACtC
|
|
1
|
+
{"version":3,"file":"recommended.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/src/configs/recommended.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,iBAAS;IACP,MAAM,EAAE,2BAA2B;IAEnC,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,oCAAoC,EAAE,MAAM;QAC5C,8BAA8B,EAAE,MAAM;QACtC,+BAA+B,EAAE,OAAO;QACxC,wCAAwC,EAAE,MAAM;QAChD,iCAAiC,EAAE,MAAM;QACzC,iDAAiD,EAAE,MAAM;QACzD,uCAAuC,EAAE,MAAM;QAC/C,iCAAiC,EAAE,MAAM;QACzC,uDAAuD,EAAE,MAAM;QAC/D,0CAA0C,EAAE,MAAM;QAClD,+BAA+B,EAAE,MAAM;QACvC,2BAA2B,EAAE,MAAM;QACnC,iCAAiC,EAAE,MAAM;QACzC,+BAA+B,EAAE,MAAM;QACvC,6BAA6B,EAAE,MAAM;QACrC,6BAA6B,EAAE,MAAM;QACrC,wCAAwC,EAAE,MAAM;QAChD,yCAAyC,EAAE,MAAM;QACjD,6BAA6B,EAAE,MAAM;QACrC,kCAAkC,EAAE,MAAM;QAC1C,yDAAyD,EAAE,MAAM;QACjE,iCAAiC,EAAE,MAAM;QACzC,oCAAoC,EAAE,MAAM;QAC5C,oBAAoB,EAAE,MAAM;QAC5B,wCAAwC,EAAE,MAAM;KACjD;CACF,CAAC","sourcesContent":["/**\n * DO NOT EDIT\n * This file is generated\n */\n\nexport = {\n parser: '@typescript-eslint/parser',\n\n plugins: ['@ngrx'],\n rules: {\n '@ngrx/updater-explicit-return-type': 'warn',\n '@ngrx/no-dispatch-in-effects': 'warn',\n '@ngrx/no-effects-in-providers': 'error',\n '@ngrx/prefer-action-creator-in-of-type': 'warn',\n '@ngrx/prefer-concat-latest-from': 'warn',\n '@ngrx/prefer-effect-callback-in-block-statement': 'warn',\n '@ngrx/use-effects-lifecycle-interface': 'warn',\n '@ngrx/avoid-combining-selectors': 'warn',\n '@ngrx/avoid-dispatching-multiple-actions-sequentially': 'warn',\n '@ngrx/avoid-duplicate-actions-in-reducer': 'warn',\n '@ngrx/avoid-mapping-selectors': 'warn',\n '@ngrx/good-action-hygiene': 'warn',\n '@ngrx/no-multiple-global-stores': 'warn',\n '@ngrx/no-reducer-in-key-names': 'warn',\n '@ngrx/no-store-subscription': 'warn',\n '@ngrx/no-typed-global-store': 'warn',\n '@ngrx/on-function-explicit-return-type': 'warn',\n '@ngrx/prefer-action-creator-in-dispatch': 'warn',\n '@ngrx/prefer-action-creator': 'warn',\n '@ngrx/prefer-inline-action-props': 'warn',\n '@ngrx/prefer-one-generic-in-create-for-feature-selector': 'warn',\n '@ngrx/prefer-selector-in-select': 'warn',\n '@ngrx/prefix-selectors-with-select': 'warn',\n '@ngrx/select-style': 'warn',\n '@ngrx/use-consistent-global-store-name': 'warn',\n },\n};\n"]}
|
|
@@ -15,8 +15,6 @@ module.exports = {
|
|
|
15
15
|
'@ngrx/updater-explicit-return-type': 'error',
|
|
16
16
|
'@ngrx/avoid-cyclic-effects': 'error',
|
|
17
17
|
'@ngrx/no-dispatch-in-effects': 'error',
|
|
18
|
-
'@ngrx/no-effect-decorator-and-creator': 'error',
|
|
19
|
-
'@ngrx/no-effect-decorator': 'error',
|
|
20
18
|
'@ngrx/no-effects-in-providers': 'error',
|
|
21
19
|
'@ngrx/no-multiple-actions-in-effects': 'error',
|
|
22
20
|
'@ngrx/prefer-action-creator-in-of-type': 'error',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strict-requiring-type-checking.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/src/configs/strict-requiring-type-checking.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,iBAAS;IACP,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE;QACb,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,iBAAiB;KAC3B;IACD,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,oCAAoC,EAAE,OAAO;QAC7C,4BAA4B,EAAE,OAAO;QACrC,8BAA8B,EAAE,OAAO;QACvC
|
|
1
|
+
{"version":3,"file":"strict-requiring-type-checking.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/src/configs/strict-requiring-type-checking.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,iBAAS;IACP,MAAM,EAAE,2BAA2B;IACnC,aAAa,EAAE;QACb,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,iBAAiB;KAC3B;IACD,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,oCAAoC,EAAE,OAAO;QAC7C,4BAA4B,EAAE,OAAO;QACrC,8BAA8B,EAAE,OAAO;QACvC,+BAA+B,EAAE,OAAO;QACxC,sCAAsC,EAAE,OAAO;QAC/C,wCAAwC,EAAE,OAAO;QACjD,iCAAiC,EAAE,OAAO;QAC1C,iDAAiD,EAAE,OAAO;QAC1D,uCAAuC,EAAE,OAAO;QAChD,iCAAiC,EAAE,OAAO;QAC1C,uDAAuD,EAAE,OAAO;QAChE,0CAA0C,EAAE,OAAO;QACnD,+BAA+B,EAAE,OAAO;QACxC,2BAA2B,EAAE,OAAO;QACpC,iCAAiC,EAAE,OAAO;QAC1C,+BAA+B,EAAE,OAAO;QACxC,6BAA6B,EAAE,OAAO;QACtC,6BAA6B,EAAE,OAAO;QACtC,wCAAwC,EAAE,OAAO;QACjD,yCAAyC,EAAE,OAAO;QAClD,6BAA6B,EAAE,OAAO;QACtC,kCAAkC,EAAE,OAAO;QAC3C,yDAAyD,EAAE,OAAO;QAClE,iCAAiC,EAAE,OAAO;QAC1C,oCAAoC,EAAE,OAAO;QAC7C,oBAAoB,EAAE,OAAO;QAC7B,wCAAwC,EAAE,OAAO;KAClD;CACF,CAAC","sourcesContent":["/**\n * DO NOT EDIT\n * This file is generated\n */\n\nexport = {\n parser: '@typescript-eslint/parser',\n parserOptions: {\n ecmaVersion: 2020,\n sourceType: 'module',\n project: './tsconfig.json',\n },\n plugins: ['@ngrx'],\n rules: {\n '@ngrx/updater-explicit-return-type': 'error',\n '@ngrx/avoid-cyclic-effects': 'error',\n '@ngrx/no-dispatch-in-effects': 'error',\n '@ngrx/no-effects-in-providers': 'error',\n '@ngrx/no-multiple-actions-in-effects': 'error',\n '@ngrx/prefer-action-creator-in-of-type': 'error',\n '@ngrx/prefer-concat-latest-from': 'error',\n '@ngrx/prefer-effect-callback-in-block-statement': 'error',\n '@ngrx/use-effects-lifecycle-interface': 'error',\n '@ngrx/avoid-combining-selectors': 'error',\n '@ngrx/avoid-dispatching-multiple-actions-sequentially': 'error',\n '@ngrx/avoid-duplicate-actions-in-reducer': 'error',\n '@ngrx/avoid-mapping-selectors': 'error',\n '@ngrx/good-action-hygiene': 'error',\n '@ngrx/no-multiple-global-stores': 'error',\n '@ngrx/no-reducer-in-key-names': 'error',\n '@ngrx/no-store-subscription': 'error',\n '@ngrx/no-typed-global-store': 'error',\n '@ngrx/on-function-explicit-return-type': 'error',\n '@ngrx/prefer-action-creator-in-dispatch': 'error',\n '@ngrx/prefer-action-creator': 'error',\n '@ngrx/prefer-inline-action-props': 'error',\n '@ngrx/prefer-one-generic-in-create-for-feature-selector': 'error',\n '@ngrx/prefer-selector-in-select': 'error',\n '@ngrx/prefix-selectors-with-select': 'error',\n '@ngrx/select-style': 'error',\n '@ngrx/use-consistent-global-store-name': 'error',\n },\n};\n"]}
|
package/src/configs/strict.js
CHANGED
|
@@ -9,8 +9,6 @@ module.exports = {
|
|
|
9
9
|
rules: {
|
|
10
10
|
'@ngrx/updater-explicit-return-type': 'error',
|
|
11
11
|
'@ngrx/no-dispatch-in-effects': 'error',
|
|
12
|
-
'@ngrx/no-effect-decorator-and-creator': 'error',
|
|
13
|
-
'@ngrx/no-effect-decorator': 'error',
|
|
14
12
|
'@ngrx/no-effects-in-providers': 'error',
|
|
15
13
|
'@ngrx/prefer-action-creator-in-of-type': 'error',
|
|
16
14
|
'@ngrx/prefer-concat-latest-from': 'error',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strict.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/src/configs/strict.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,iBAAS;IACP,MAAM,EAAE,2BAA2B;IAEnC,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,oCAAoC,EAAE,OAAO;QAC7C,8BAA8B,EAAE,OAAO;QACvC
|
|
1
|
+
{"version":3,"file":"strict.js","sourceRoot":"","sources":["../../../../../modules/eslint-plugin/src/configs/strict.ts"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,iBAAS;IACP,MAAM,EAAE,2BAA2B;IAEnC,OAAO,EAAE,CAAC,OAAO,CAAC;IAClB,KAAK,EAAE;QACL,oCAAoC,EAAE,OAAO;QAC7C,8BAA8B,EAAE,OAAO;QACvC,+BAA+B,EAAE,OAAO;QACxC,wCAAwC,EAAE,OAAO;QACjD,iCAAiC,EAAE,OAAO;QAC1C,iDAAiD,EAAE,OAAO;QAC1D,uCAAuC,EAAE,OAAO;QAChD,iCAAiC,EAAE,OAAO;QAC1C,uDAAuD,EAAE,OAAO;QAChE,0CAA0C,EAAE,OAAO;QACnD,+BAA+B,EAAE,OAAO;QACxC,2BAA2B,EAAE,OAAO;QACpC,iCAAiC,EAAE,OAAO;QAC1C,+BAA+B,EAAE,OAAO;QACxC,6BAA6B,EAAE,OAAO;QACtC,6BAA6B,EAAE,OAAO;QACtC,wCAAwC,EAAE,OAAO;QACjD,yCAAyC,EAAE,OAAO;QAClD,6BAA6B,EAAE,OAAO;QACtC,kCAAkC,EAAE,OAAO;QAC3C,yDAAyD,EAAE,OAAO;QAClE,iCAAiC,EAAE,OAAO;QAC1C,oCAAoC,EAAE,OAAO;QAC7C,oBAAoB,EAAE,OAAO;QAC7B,wCAAwC,EAAE,OAAO;KAClD;CACF,CAAC","sourcesContent":["/**\n * DO NOT EDIT\n * This file is generated\n */\n\nexport = {\n parser: '@typescript-eslint/parser',\n\n plugins: ['@ngrx'],\n rules: {\n '@ngrx/updater-explicit-return-type': 'error',\n '@ngrx/no-dispatch-in-effects': 'error',\n '@ngrx/no-effects-in-providers': 'error',\n '@ngrx/prefer-action-creator-in-of-type': 'error',\n '@ngrx/prefer-concat-latest-from': 'error',\n '@ngrx/prefer-effect-callback-in-block-statement': 'error',\n '@ngrx/use-effects-lifecycle-interface': 'error',\n '@ngrx/avoid-combining-selectors': 'error',\n '@ngrx/avoid-dispatching-multiple-actions-sequentially': 'error',\n '@ngrx/avoid-duplicate-actions-in-reducer': 'error',\n '@ngrx/avoid-mapping-selectors': 'error',\n '@ngrx/good-action-hygiene': 'error',\n '@ngrx/no-multiple-global-stores': 'error',\n '@ngrx/no-reducer-in-key-names': 'error',\n '@ngrx/no-store-subscription': 'error',\n '@ngrx/no-typed-global-store': 'error',\n '@ngrx/on-function-explicit-return-type': 'error',\n '@ngrx/prefer-action-creator-in-dispatch': 'error',\n '@ngrx/prefer-action-creator': 'error',\n '@ngrx/prefer-inline-action-props': 'error',\n '@ngrx/prefer-one-generic-in-create-for-feature-selector': 'error',\n '@ngrx/prefer-selector-in-select': 'error',\n '@ngrx/prefix-selectors-with-select': 'error',\n '@ngrx/select-style': 'error',\n '@ngrx/use-consistent-global-store-name': 'error',\n },\n};\n"]}
|
|
@@ -22,6 +22,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __values = (this && this.__values) || function(o) {
|
|
26
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
27
|
+
if (m) return m.call(o);
|
|
28
|
+
if (o && typeof o.length === "number") return {
|
|
29
|
+
next: function () {
|
|
30
|
+
if (o && i >= o.length) o = void 0;
|
|
31
|
+
return { value: o && o[i++], done: !o };
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
35
|
+
};
|
|
25
36
|
var _a;
|
|
26
37
|
exports.__esModule = true;
|
|
27
38
|
exports.messageId = void 0;
|
|
@@ -52,12 +63,30 @@ exports["default"] = (0, rule_creator_1.createRule)({
|
|
|
52
63
|
return {};
|
|
53
64
|
}
|
|
54
65
|
var pipeableOrStoreSelect = ":matches(".concat((0, utils_1.namedExpression)(storeNames), "[callee.property.name='pipe']:has(CallExpression[callee.name='select']), ").concat((0, utils_1.selectExpression)(storeNames), ")");
|
|
66
|
+
var selectsInArray = [];
|
|
55
67
|
return _a = {},
|
|
56
|
-
_a["CallExpression[callee.name='combineLatest']
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
68
|
+
_a["CallExpression[callee.name='combineLatest'] ".concat(pipeableOrStoreSelect, " ~ ").concat(pipeableOrStoreSelect)] = function (node) {
|
|
69
|
+
selectsInArray.push(node);
|
|
70
|
+
},
|
|
71
|
+
_a["CallExpression[callee.name='combineLatest']:exit"] = function () {
|
|
72
|
+
var e_1, _a;
|
|
73
|
+
try {
|
|
74
|
+
for (var selectsInArray_1 = __values(selectsInArray), selectsInArray_1_1 = selectsInArray_1.next(); !selectsInArray_1_1.done; selectsInArray_1_1 = selectsInArray_1.next()) {
|
|
75
|
+
var node = selectsInArray_1_1.value;
|
|
76
|
+
context.report({
|
|
77
|
+
node: node,
|
|
78
|
+
messageId: exports.messageId
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
83
|
+
finally {
|
|
84
|
+
try {
|
|
85
|
+
if (selectsInArray_1_1 && !selectsInArray_1_1.done && (_a = selectsInArray_1["return"])) _a.call(selectsInArray_1);
|
|
86
|
+
}
|
|
87
|
+
finally { if (e_1) throw e_1.error; }
|
|
88
|
+
}
|
|
89
|
+
selectsInArray.length = 0;
|
|
61
90
|
},
|
|
62
91
|
_a;
|
|
63
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avoid-combining-selectors.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/store/avoid-combining-selectors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"avoid-combining-selectors.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/store/avoid-combining-selectors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAA6B;AAC7B,mDAAgD;AAChD,qCAKqB;AAER,QAAA,SAAS,GAAG,yBAAyB,CAAC;AAKnD,qBAAe,IAAA,yBAAU,EAAsB;IAC7C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI;IACjC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE,OAAO;QACnB,IAAI,EAAE;YACJ,WAAW,EAAE,mDAAmD;YAChE,WAAW,EAAE,MAAM;SACpB;QACD,MAAM,EAAE,EAAE;QACV,QAAQ;YACN,GAAC,iBAAS,IAAG,0CAA0C;eACxD;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,UAAC,OAAO;;QACN,IAAA,KAAqB,IAAA,qBAAa,EAAC,OAAO,CAAC,YAA3B,EAAhB,WAAW,mBAAG,EAAE,KAAA,CAA4B;QACpD,IAAM,UAAU,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAA,iBAAS,EAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAE1E,IAAI,CAAC,UAAU,EAAE;YACf,OAAO,EAAE,CAAC;SACX;QAED,IAAM,qBAAqB,GAAG,mBAAY,IAAA,uBAAe,EACvD,UAAU,CACX,sFAA4E,IAAA,wBAAgB,EAC3F,UAAU,CACX,MAAY,CAAC;QAEd,IAAM,cAAc,GAA8B,EAAE,CAAC;QACrD;YACE,GAAC,sDAA+C,qBAAqB,gBAAM,qBAAqB,CAAE,IAAlG,UACE,IAA6B;gBAE7B,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC5B,CAAC;YACD,GAAC,kDAAkD,IAAnD;;;oBACE,KAAmB,IAAA,mBAAA,SAAA,cAAc,CAAA,8CAAA,0EAAE;wBAA9B,IAAM,IAAI,2BAAA;wBACb,OAAO,CAAC,MAAM,CAAC;4BACb,IAAI,MAAA;4BACJ,SAAS,mBAAA;yBACV,CAAC,CAAC;qBACJ;;;;;;;;;gBACD,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC;YAC5B,CAAC;eACD;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import type { TSESTree } from '@typescript-eslint/experimental-utils';\nimport * as path from 'path';\nimport { createRule } from '../../rule-creator';\nimport {\n asPattern,\n getNgRxStores,\n namedExpression,\n selectExpression,\n} from '../../utils';\n\nexport const messageId = 'avoidCombiningSelectors';\n\ntype MessageIds = typeof messageId;\ntype Options = readonly [];\n\nexport default createRule<Options, MessageIds>({\n name: path.parse(__filename).name,\n meta: {\n type: 'suggestion',\n ngrxModule: 'store',\n docs: {\n description: 'Prefer combining selectors at the selector level.',\n recommended: 'warn',\n },\n schema: [],\n messages: {\n [messageId]: 'Combine selectors at the selector level.',\n },\n },\n defaultOptions: [],\n create: (context) => {\n const { identifiers = [] } = getNgRxStores(context);\n const storeNames = identifiers.length > 0 ? asPattern(identifiers) : null;\n\n if (!storeNames) {\n return {};\n }\n\n const pipeableOrStoreSelect = `:matches(${namedExpression(\n storeNames\n )}[callee.property.name='pipe']:has(CallExpression[callee.name='select']), ${selectExpression(\n storeNames\n )})` as const;\n\n const selectsInArray: TSESTree.CallExpression[] = [];\n return {\n [`CallExpression[callee.name='combineLatest'] ${pipeableOrStoreSelect} ~ ${pipeableOrStoreSelect}`](\n node: TSESTree.CallExpression\n ) {\n selectsInArray.push(node);\n },\n [`CallExpression[callee.name='combineLatest']:exit`]() {\n for (const node of selectsInArray) {\n context.report({\n node,\n messageId,\n });\n }\n selectsInArray.length = 0;\n },\n };\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefix-selectors-with-select.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/store/prefix-selectors-with-select.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAA6B;AAC7B,mDAAgD;AAChD,qCAAyC;AAE5B,QAAA,yBAAyB,GAAG,2BAA2B,CAAC;AACxD,QAAA,gCAAgC,GAC3C,kCAAkC,CAAC;AAOrC,qBAAe,IAAA,yBAAU,EAAsB;IAC7C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI;IACjC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,cAAc,EAAE,IAAI;QACpB,UAAU,EAAE,OAAO;QACnB,IAAI,EAAE;YACJ,WAAW,EACT,qEAAqE;YACvE,WAAW,EAAE,MAAM;YACnB,UAAU,EAAE,IAAI;SACjB;QACD,MAAM,EAAE,EAAE;QACV,QAAQ;YACN,GAAC,iCAAyB,IAAG,0CAA0C;YACvE,GAAC,wCAAgC,IAC/B,kDAAkD;eACrD;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,UAAC,OAAO;QACd,OAAO;YACL,oOAAoO,
|
|
1
|
+
{"version":3,"file":"prefix-selectors-with-select.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/store/prefix-selectors-with-select.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAA6B;AAC7B,mDAAgD;AAChD,qCAAyC;AAE5B,QAAA,yBAAyB,GAAG,2BAA2B,CAAC;AACxD,QAAA,gCAAgC,GAC3C,kCAAkC,CAAC;AAOrC,qBAAe,IAAA,yBAAU,EAAsB;IAC7C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI;IACjC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,cAAc,EAAE,IAAI;QACpB,UAAU,EAAE,OAAO;QACnB,IAAI,EAAE;YACJ,WA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AAO,CACrC,IAAI,MAAM,CAAC,WAAI,UAAU,SAAM,CAAC,EAChC,UAAC,CAAC,EAAE,IAAY;QACd,OAAO,UAAG,UAAU,SAAG,IAAA,kBAAU,EAAC,IAAI,CAAC,CAAE,CAAC;IAC5C,CAAC,CACF,CAAC;IAEF,IAAI,IAAI,KAAK,oBAAoB,EAAE;QACjC,OAAO,oBAAoB,CAAC;KAC7B;IAED,kCAAkC;IAClC,oBAAoB,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,UAAC,CAAC,EAAE,IAAY;QACpE,OAAO,UAAG,UAAU,SAAG,IAAA,kBAAU,EAAC,IAAI,CAAC,CAAE,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,IAAI,IAAI,KAAK,oBAAoB,EAAE;QACjC,OAAO,oBAAoB,CAAC;KAC7B;IAED,6BAA6B;IAC7B,OAAO,UAAG,UAAU,SAAG,IAAA,kBAAU,EAAC,IAAI,CAAC,CAAE,CAAC;AAC5C,CAAC","sourcesContent":["import type { TSESTree } from '@typescript-eslint/experimental-utils';\nimport * as path from 'path';\nimport { createRule } from '../../rule-creator';\nimport { capitalize } from '../../utils';\n\nexport const prefixSelectorsWithSelect = 'prefixSelectorsWithSelect';\nexport const prefixSelectorsWithSelectSuggest =\n 'prefixSelectorsWithSelectSuggest';\n\ntype MessageIds =\n | typeof prefixSelectorsWithSelect\n | typeof prefixSelectorsWithSelectSuggest;\ntype Options = readonly [];\n\nexport default createRule<Options, MessageIds>({\n name: path.parse(__filename).name,\n meta: {\n type: 'suggestion',\n hasSuggestions: true,\n ngrxModule: 'store',\n docs: {\n description:\n 'The selector should start with \"select\", for example \"selectThing\".',\n recommended: 'warn',\n suggestion: true,\n },\n schema: [],\n messages: {\n [prefixSelectorsWithSelect]: 'The selector should start with \"select\".',\n [prefixSelectorsWithSelectSuggest]:\n 'Prefix the selector with \"select\": `{{ name }}`.',\n },\n },\n defaultOptions: [],\n create: (context) => {\n return {\n 'VariableDeclarator[id.name!=/^select[^a-z].+$/]:matches([id.typeAnnotation.typeAnnotation.typeName.name=/^MemoizedSelector(WithProps)?$/], :has(CallExpression[callee.name=/^(create(Feature)?Selector|createSelectorFactory)$/]))'({\n id,\n }: TSESTree.VariableDeclarator & { id: TSESTree.Identifier }) {\n const suggestedName = getSuggestedName(id.name);\n context.report({\n loc: {\n ...id.loc,\n end: {\n ...id.loc.end,\n column: (id.typeAnnotation?.range[0] ?? id.range[1]) - 1,\n },\n },\n messageId: prefixSelectorsWithSelect,\n suggest: [\n {\n messageId: prefixSelectorsWithSelectSuggest,\n data: {\n name: suggestedName,\n },\n fix: (fixer) =>\n fixer.replaceTextRange(\n [id.range[0], id.typeAnnotation?.range[0] ?? id.range[1]],\n suggestedName\n ),\n },\n ],\n });\n },\n };\n },\n});\n\nfunction getSuggestedName(name: string) {\n const selectWord = 'select';\n // Ex: 'selectfeature' => 'selectFeature'\n let possibleReplacedName = name.replace(\n new RegExp(`^${selectWord}(.+)`),\n (_, word: string) => {\n return `${selectWord}${capitalize(word)}`;\n }\n );\n\n if (name !== possibleReplacedName) {\n return possibleReplacedName;\n }\n\n // Ex: 'getCount' => 'selectCount'\n possibleReplacedName = name.replace(/^get([^a-z].+)/, (_, word: string) => {\n return `${selectWord}${capitalize(word)}`;\n });\n\n if (name !== possibleReplacedName) {\n return possibleReplacedName;\n }\n\n // Ex: 'item' => 'selectItem'\n return `${selectWord}${capitalize(name)}`;\n}\n"]}
|
|
@@ -79,16 +79,16 @@ exports["default"] = (0, rule_creator_1.createRule)({
|
|
|
79
79
|
schema: [
|
|
80
80
|
{
|
|
81
81
|
type: 'string',
|
|
82
|
-
"enum": ["method" /* Method */, "operator" /* Operator */],
|
|
82
|
+
"enum": ["method" /* SelectStyle.Method */, "operator" /* SelectStyle.Operator */],
|
|
83
83
|
additionalProperties: false
|
|
84
84
|
},
|
|
85
85
|
],
|
|
86
86
|
messages: (_a = {},
|
|
87
|
-
_a["method" /* Method */] = 'Selector should be used with select method: `this.store.select(selector)`.',
|
|
88
|
-
_a["operator" /* Operator */] = 'Selector should be used with the pipeable operator: `this.store.pipe(select(selector))`.',
|
|
87
|
+
_a["method" /* SelectStyle.Method */] = 'Selector should be used with select method: `this.store.select(selector)`.',
|
|
88
|
+
_a["operator" /* SelectStyle.Operator */] = 'Selector should be used with the pipeable operator: `this.store.pipe(select(selector))`.',
|
|
89
89
|
_a)
|
|
90
90
|
},
|
|
91
|
-
defaultOptions: ["method" /* Method */],
|
|
91
|
+
defaultOptions: ["method" /* SelectStyle.Method */],
|
|
92
92
|
create: function (context, _a) {
|
|
93
93
|
var _b, _c;
|
|
94
94
|
var _d = __read(_a, 1), mode = _d[0];
|
|
@@ -97,12 +97,12 @@ exports["default"] = (0, rule_creator_1.createRule)({
|
|
|
97
97
|
if (!storeNames) {
|
|
98
98
|
return {};
|
|
99
99
|
}
|
|
100
|
-
if (mode === "operator" /* Operator */) {
|
|
100
|
+
if (mode === "operator" /* SelectStyle.Operator */) {
|
|
101
101
|
return _b = {},
|
|
102
102
|
_b[(0, utils_1.selectExpression)(storeNames)] = function (node) {
|
|
103
103
|
context.report({
|
|
104
104
|
node: node.callee.property,
|
|
105
|
-
messageId: "operator" /* Operator */,
|
|
105
|
+
messageId: "operator" /* SelectStyle.Operator */,
|
|
106
106
|
fix: function (fixer) { return getMethodToOperatorFixes(node, fixer); }
|
|
107
107
|
});
|
|
108
108
|
},
|
|
@@ -113,7 +113,7 @@ exports["default"] = (0, rule_creator_1.createRule)({
|
|
|
113
113
|
var e_1, _a;
|
|
114
114
|
context.report({
|
|
115
115
|
node: node,
|
|
116
|
-
messageId: "method" /* Method */,
|
|
116
|
+
messageId: "method" /* SelectStyle.Method */,
|
|
117
117
|
fix: function (fixer) {
|
|
118
118
|
return (0, utils_1.getImportRemoveFix)(sourceCode, [node.parent], 'select', fixer);
|
|
119
119
|
}
|
|
@@ -122,7 +122,7 @@ exports["default"] = (0, rule_creator_1.createRule)({
|
|
|
122
122
|
var _loop_1 = function (identifier) {
|
|
123
123
|
context.report({
|
|
124
124
|
node: identifier,
|
|
125
|
-
messageId: "method" /* Method */,
|
|
125
|
+
messageId: "method" /* SelectStyle.Method */,
|
|
126
126
|
fix: function (fixer) {
|
|
127
127
|
return getOperatorToMethodFixes(identifier, sourceCode, fixer);
|
|
128
128
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-style.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/store/select-style.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAA6B;AAC7B,mDAAgD;AAChD,qCAYqB;AAER,QAAA,YAAY,GAAG,cAAc,CAAC;AAC9B,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAwB/C,qBAAe,IAAA,yBAAU,EAAsB;IAC7C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI;IACjC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE,OAAO;QACnB,IAAI,EAAE;YACJ,WAAW,EACT,kFAAkF;YACpF,WAAW,EAAE,MAAM;SACpB;QACD,OAAO,EAAE,MAAM;QACf,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,QAAQ;gBACd,MAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"select-style.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/store/select-style.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAA6B;AAC7B,mDAAgD;AAChD,qCAYqB;AAER,QAAA,YAAY,GAAG,cAAc,CAAC;AAC9B,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAwB/C,qBAAe,IAAA,yBAAU,EAAsB;IAC7C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAA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C,mCAAI,YAAY;KAC7C,CAAC;IACI,IAAA,KAAA,OAAqB,UAAU,CAAC,KAAK,IAAA,EAAlC,cAAc,QAAoB,CAAC;IAC5C,OAAO;QACL,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC;QAC5B,KAAK,CAAC,oBAAoB,CAAC,CAAC,cAAc,EAAE,cAAc,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC;KACtE,CAAC;AACJ,CAAC","sourcesContent":["import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';\nimport * as path from 'path';\nimport { createRule } from '../../rule-creator';\nimport {\n asPattern,\n getImportAddFix,\n getImportRemoveFix,\n getNearestUpperNodeFrom,\n getNgRxStores,\n isCallExpression,\n isClassDeclaration,\n isMemberExpression,\n NGRX_MODULE_PATHS,\n pipeableSelect,\n selectExpression,\n} from '../../utils';\n\nexport const selectMethod = 'selectMethod';\nexport const selectOperator = 'selectOperator';\n\nexport const enum SelectStyle {\n Method = 'method',\n Operator = 'operator',\n}\n\ntype MessageIds = `${SelectStyle}`;\ntype Options = readonly [MessageIds];\ntype MemberExpressionWithProperty = Omit<\n TSESTree.MemberExpression,\n 'property'\n> & {\n property: TSESTree.Identifier;\n};\ntype CallExpression = Omit<TSESTree.CallExpression, 'parent'> & {\n callee: MemberExpressionWithProperty;\n parent: TSESTree.CallExpression & {\n callee: Omit<TSESTree.MemberExpression, 'object'> & {\n object: MemberExpressionWithProperty;\n };\n };\n};\n\nexport default createRule<Options, MessageIds>({\n name: path.parse(__filename).name,\n meta: {\n type: 'suggestion',\n ngrxModule: 'store',\n docs: {\n description:\n 'Selector can be used either with `select` as a pipeable operator or as a method.',\n recommended: 'warn',\n },\n fixable: 'code',\n schema: [\n {\n type: 'string',\n enum: [SelectStyle.Method, SelectStyle.Operator],\n additionalProperties: false,\n },\n ],\n messages: {\n [SelectStyle.Method]:\n 'Selector should be used with select method: `this.store.select(selector)`.',\n [SelectStyle.Operator]:\n 'Selector should be used with the pipeable operator: `this.store.pipe(select(selector))`.',\n },\n },\n defaultOptions: [SelectStyle.Method],\n create: (context, [mode]) => {\n const { identifiers = [], sourceCode } = getNgRxStores(context);\n const storeNames = identifiers.length > 0 ? asPattern(identifiers) : null;\n\n if (!storeNames) {\n return {};\n }\n\n if (mode === SelectStyle.Operator) {\n return {\n [selectExpression(storeNames)](node: CallExpression) {\n context.report({\n node: node.callee.property,\n messageId: SelectStyle.Operator,\n fix: (fixer) => getMethodToOperatorFixes(node, fixer),\n });\n },\n };\n }\n\n return {\n [`Program:has(${pipeableSelect(\n storeNames\n )}) ImportDeclaration[source.value='${\n NGRX_MODULE_PATHS.store\n }'] > ImportSpecifier[imported.name='select']`](\n node: TSESTree.ImportSpecifier & {\n parent: TSESTree.ImportDeclaration;\n }\n ) {\n context.report({\n node,\n messageId: SelectStyle.Method,\n fix: (fixer) =>\n getImportRemoveFix(sourceCode, [node.parent], 'select', fixer),\n });\n\n const [{ references }] = context.getDeclaredVariables(node);\n\n for (const { identifier } of references) {\n context.report({\n node: identifier,\n messageId: SelectStyle.Method,\n fix: (fixer) =>\n getOperatorToMethodFixes(identifier, sourceCode, fixer),\n });\n }\n },\n };\n },\n});\n\nfunction getMethodToOperatorFixes(\n node: CallExpression,\n fixer: TSESLint.RuleFixer\n): readonly TSESLint.RuleFix[] {\n const classDeclaration = getNearestUpperNodeFrom(node, isClassDeclaration);\n\n if (!classDeclaration) {\n return [];\n }\n\n return [\n fixer.insertTextBefore(node.callee.property, 'pipe('),\n fixer.insertTextAfter(node, ')'),\n ].concat(\n getImportAddFix({\n fixer,\n importName: 'select',\n moduleName: NGRX_MODULE_PATHS.store,\n node: classDeclaration,\n })\n );\n}\n\nfunction getOperatorToMethodFixes(\n identifier: TSESTree.Node,\n sourceCode: Readonly<TSESLint.SourceCode>,\n fixer: TSESLint.RuleFixer\n): readonly TSESLint.RuleFix[] {\n const select = identifier.parent;\n const storePipe = select?.parent;\n\n if (\n !storePipe ||\n !isCallExpression(storePipe) ||\n !isMemberExpression(storePipe.callee)\n ) {\n return [];\n }\n\n const pipeContainsOnlySelect = storePipe.arguments.length === 1;\n\n if (!pipeContainsOnlySelect) {\n const selectContent = sourceCode.getText(select);\n const nextTokenAfterSelect = sourceCode.getTokenAfter(select);\n const store = storePipe.callee.object;\n return [\n fixer.remove(select),\n ...(nextTokenAfterSelect ? [fixer.remove(nextTokenAfterSelect)] : []),\n fixer.insertTextAfter(store, `.${selectContent}`),\n ];\n }\n\n const { property } = storePipe.callee;\n const nextTokenAfterPipe = sourceCode.getTokenAfter(property);\n const [pipeInitialRange, pipeEndRange] = property.range;\n const pipeRange: TSESTree.Range = [\n pipeInitialRange,\n nextTokenAfterPipe?.range[1] ?? pipeEndRange,\n ];\n const [, selectEndRange] = identifier.range;\n return [\n fixer.removeRange(pipeRange),\n fixer.insertTextAfterRange([selectEndRange, selectEndRange + 1], '('),\n ];\n}\n"]}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var _a;
|
|
26
|
-
exports.__esModule = true;
|
|
27
|
-
exports.noEffectDecoratorAndCreatorSuggest = exports.noEffectDecoratorAndCreator = void 0;
|
|
28
|
-
var path = __importStar(require("path"));
|
|
29
|
-
var rule_creator_1 = require("../../rule-creator");
|
|
30
|
-
var utils_1 = require("../../utils");
|
|
31
|
-
exports.noEffectDecoratorAndCreator = 'noEffectDecoratorAndCreator';
|
|
32
|
-
exports.noEffectDecoratorAndCreatorSuggest = 'noEffectDecoratorAndCreatorSuggest';
|
|
33
|
-
exports["default"] = (0, rule_creator_1.createRule)({
|
|
34
|
-
name: path.parse(__filename).name,
|
|
35
|
-
meta: {
|
|
36
|
-
type: 'suggestion',
|
|
37
|
-
hasSuggestions: true,
|
|
38
|
-
ngrxModule: 'effects',
|
|
39
|
-
docs: {
|
|
40
|
-
description: '`Effect` should use either the `createEffect` or the `@Effect` decorator, but not both.',
|
|
41
|
-
recommended: 'error',
|
|
42
|
-
suggestion: true
|
|
43
|
-
},
|
|
44
|
-
fixable: 'code',
|
|
45
|
-
schema: [],
|
|
46
|
-
messages: (_a = {},
|
|
47
|
-
_a[exports.noEffectDecoratorAndCreator] = 'Using the `createEffect` and the `@Effect` decorator simultaneously is forbidden.',
|
|
48
|
-
_a[exports.noEffectDecoratorAndCreatorSuggest] = 'Remove the `@Effect` decorator.',
|
|
49
|
-
_a)
|
|
50
|
-
},
|
|
51
|
-
defaultOptions: [],
|
|
52
|
-
create: function (context) {
|
|
53
|
-
var _a;
|
|
54
|
-
var sourceCode = context.getSourceCode();
|
|
55
|
-
return _a = {},
|
|
56
|
-
_a["".concat(utils_1.effectCreator, ":has(").concat(utils_1.effectDecorator, ")")] = function (node) {
|
|
57
|
-
var decorator = (0, utils_1.getDecorator)(node, 'Effect');
|
|
58
|
-
if (!decorator) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
var hasDecoratorArgument = Boolean((0, utils_1.getDecoratorArguments)(decorator)[0]);
|
|
62
|
-
var fix = function (fixer) {
|
|
63
|
-
return getFixes(node, sourceCode, fixer, decorator);
|
|
64
|
-
};
|
|
65
|
-
if (hasDecoratorArgument) {
|
|
66
|
-
context.report({
|
|
67
|
-
node: node.key,
|
|
68
|
-
messageId: exports.noEffectDecoratorAndCreator,
|
|
69
|
-
// In this case where the argument to the `@Effect({...})`
|
|
70
|
-
// decorator exists, it is more appropriate to **suggest**
|
|
71
|
-
// instead of **fix**, since either simply removing or merging
|
|
72
|
-
// the arguments would likely generate unexpected behaviors and
|
|
73
|
-
// would be quite costly.
|
|
74
|
-
suggest: [
|
|
75
|
-
{
|
|
76
|
-
messageId: exports.noEffectDecoratorAndCreatorSuggest,
|
|
77
|
-
fix: fix
|
|
78
|
-
},
|
|
79
|
-
]
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
context.report({
|
|
84
|
-
node: node.key,
|
|
85
|
-
messageId: exports.noEffectDecoratorAndCreator,
|
|
86
|
-
fix: fix
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
_a;
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
function getFixes(node, sourceCode, fixer, decorator) {
|
|
94
|
-
var _a;
|
|
95
|
-
var importDeclarations = (_a = (0, utils_1.getImportDeclarations)(node, utils_1.NGRX_MODULE_PATHS.effects)) !== null && _a !== void 0 ? _a : [];
|
|
96
|
-
var text = sourceCode.getText();
|
|
97
|
-
var totalEffectDecoratorOccurrences = getEffectDecoratorOccurrences(text);
|
|
98
|
-
var importRemoveFix = totalEffectDecoratorOccurrences === 1
|
|
99
|
-
? (0, utils_1.getImportRemoveFix)(sourceCode, importDeclarations, 'Effect', fixer)
|
|
100
|
-
: [];
|
|
101
|
-
return [fixer.remove(decorator)].concat(importRemoveFix);
|
|
102
|
-
}
|
|
103
|
-
function getEffectDecoratorOccurrences(text) {
|
|
104
|
-
var _a, _b;
|
|
105
|
-
return (_b = (_a = text.replace(/\s/g, '').match(/@Effect/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
|
|
106
|
-
}
|
|
107
|
-
//# sourceMappingURL=no-effect-decorator-and-creator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"no-effect-decorator-and-creator.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/effects/no-effect-decorator-and-creator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAA6B;AAC7B,mDAAgD;AAChD,qCAQqB;AAER,QAAA,2BAA2B,GAAG,6BAA6B,CAAC;AAC5D,QAAA,kCAAkC,GAC7C,oCAAoC,CAAC;AAOvC,qBAAe,IAAA,yBAAU,EAAsB;IAC7C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI;IACjC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,cAAc,EAAE,IAAI;QACpB,UAAU,EAAE,SAAS;QACrB,IAAI,EAAE;YACJ,WAAW,EACT,yFAAyF;YAC3F,WAAW,EAAE,OAAO;YACpB,UAAU,EAAE,IAAI;SACjB;QACD,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,EAAE;QACV,QAAQ;YACN,GAAC,mCAA2B,IAC1B,mFAAmF;YACrF,GAAC,0CAAkC,IAAG,iCAAiC;eACxE;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,UAAC,OAAO;;QACd,IAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;QAE3C;YACE,GAAC,UAAG,qBAAa,kBAAQ,uBAAe,MAAG,IAA3C,UACE,IAAiC;gBAEjC,IAAM,SAAS,GAAG,IA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AE,kBAAkB,EAAE,QAAQ,EAAE,KAAK,CAAC;QACrE,CAAC,CAAC,EAAE,CAAC;IAET,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,6BAA6B,CAAC,IAAY;;IACjD,OAAO,MAAA,MAAA,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,0CAAE,MAAM,mCAAI,CAAC,CAAC;AAChE,CAAC","sourcesContent":["import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';\nimport * as path from 'path';\nimport { createRule } from '../../rule-creator';\nimport {\n effectCreator,\n effectDecorator,\n getDecorator,\n getDecoratorArguments,\n getImportDeclarations,\n getImportRemoveFix,\n NGRX_MODULE_PATHS,\n} from '../../utils';\n\nexport const noEffectDecoratorAndCreator = 'noEffectDecoratorAndCreator';\nexport const noEffectDecoratorAndCreatorSuggest =\n 'noEffectDecoratorAndCreatorSuggest';\n\ntype MessageIds =\n | typeof noEffectDecoratorAndCreator\n | typeof noEffectDecoratorAndCreatorSuggest;\ntype Options = readonly [];\n\nexport default createRule<Options, MessageIds>({\n name: path.parse(__filename).name,\n meta: {\n type: 'suggestion',\n hasSuggestions: true,\n ngrxModule: 'effects',\n docs: {\n description:\n '`Effect` should use either the `createEffect` or the `@Effect` decorator, but not both.',\n recommended: 'error',\n suggestion: true,\n },\n fixable: 'code',\n schema: [],\n messages: {\n [noEffectDecoratorAndCreator]:\n 'Using the `createEffect` and the `@Effect` decorator simultaneously is forbidden.',\n [noEffectDecoratorAndCreatorSuggest]: 'Remove the `@Effect` decorator.',\n },\n },\n defaultOptions: [],\n create: (context) => {\n const sourceCode = context.getSourceCode();\n\n return {\n [`${effectCreator}:has(${effectDecorator})`](\n node: TSESTree.PropertyDefinition\n ) {\n const decorator = getDecorator(node, 'Effect');\n\n if (!decorator) {\n return;\n }\n\n const hasDecoratorArgument = Boolean(\n getDecoratorArguments(decorator)[0]\n );\n const fix: TSESLint.ReportFixFunction = (fixer) =>\n getFixes(node, sourceCode, fixer, decorator);\n\n if (hasDecoratorArgument) {\n context.report({\n node: node.key,\n messageId: noEffectDecoratorAndCreator,\n // In this case where the argument to the `@Effect({...})`\n // decorator exists, it is more appropriate to **suggest**\n // instead of **fix**, since either simply removing or merging\n // the arguments would likely generate unexpected behaviors and\n // would be quite costly.\n suggest: [\n {\n messageId: noEffectDecoratorAndCreatorSuggest,\n fix,\n },\n ],\n });\n } else {\n context.report({\n node: node.key,\n messageId: noEffectDecoratorAndCreator,\n fix,\n });\n }\n },\n };\n },\n});\n\nfunction getFixes(\n node: TSESTree.PropertyDefinition,\n sourceCode: Readonly<TSESLint.SourceCode>,\n fixer: TSESLint.RuleFixer,\n decorator: TSESTree.Decorator\n): readonly TSESLint.RuleFix[] {\n const importDeclarations =\n getImportDeclarations(node, NGRX_MODULE_PATHS.effects) ?? [];\n const text = sourceCode.getText();\n const totalEffectDecoratorOccurrences = getEffectDecoratorOccurrences(text);\n const importRemoveFix =\n totalEffectDecoratorOccurrences === 1\n ? getImportRemoveFix(sourceCode, importDeclarations, 'Effect', fixer)\n : [];\n\n return [fixer.remove(decorator)].concat(importRemoveFix);\n}\n\nfunction getEffectDecoratorOccurrences(text: string) {\n return text.replace(/\\s/g, '').match(/@Effect/g)?.length ?? 0;\n}\n"]}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
26
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
27
|
-
if (!m) return o;
|
|
28
|
-
var i = m.call(o), r, ar = [], e;
|
|
29
|
-
try {
|
|
30
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
31
|
-
}
|
|
32
|
-
catch (error) { e = { error: error }; }
|
|
33
|
-
finally {
|
|
34
|
-
try {
|
|
35
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
36
|
-
}
|
|
37
|
-
finally { if (e) throw e.error; }
|
|
38
|
-
}
|
|
39
|
-
return ar;
|
|
40
|
-
};
|
|
41
|
-
var _a;
|
|
42
|
-
exports.__esModule = true;
|
|
43
|
-
exports.noEffectDecoratorSuggest = exports.noEffectDecorator = void 0;
|
|
44
|
-
var path = __importStar(require("path"));
|
|
45
|
-
var rule_creator_1 = require("../../rule-creator");
|
|
46
|
-
var utils_1 = require("../../utils");
|
|
47
|
-
exports.noEffectDecorator = 'noEffectDecorator';
|
|
48
|
-
exports.noEffectDecoratorSuggest = 'noEffectDecoratorSuggest';
|
|
49
|
-
var createEffectKeyword = 'createEffect';
|
|
50
|
-
exports["default"] = (0, rule_creator_1.createRule)({
|
|
51
|
-
name: path.parse(__filename).name,
|
|
52
|
-
meta: {
|
|
53
|
-
type: 'suggestion',
|
|
54
|
-
hasSuggestions: true,
|
|
55
|
-
ngrxModule: 'effects',
|
|
56
|
-
docs: {
|
|
57
|
-
description: "The `".concat(createEffectKeyword, "` is preferred as the `@Effect` decorator is deprecated."),
|
|
58
|
-
recommended: 'warn',
|
|
59
|
-
suggestion: true
|
|
60
|
-
},
|
|
61
|
-
fixable: 'code',
|
|
62
|
-
schema: [],
|
|
63
|
-
messages: (_a = {},
|
|
64
|
-
_a[exports.noEffectDecorator] = "The `@Effect` decorator is deprecated. Use `".concat(createEffectKeyword, "` instead."),
|
|
65
|
-
_a[exports.noEffectDecoratorSuggest] = "Remove the `@Effect` decorator.",
|
|
66
|
-
_a)
|
|
67
|
-
},
|
|
68
|
-
defaultOptions: [],
|
|
69
|
-
create: function (context) {
|
|
70
|
-
var _a;
|
|
71
|
-
var sourceCode = context.getSourceCode();
|
|
72
|
-
return _a = {},
|
|
73
|
-
_a[utils_1.propertyDefinitionWithEffectDecorator] = function (node) {
|
|
74
|
-
var isUsingEffectCreator = (0, utils_1.isIdentifier)(node.parent.value.callee) &&
|
|
75
|
-
node.parent.value.callee.name === createEffectKeyword;
|
|
76
|
-
if (isUsingEffectCreator) {
|
|
77
|
-
context.report({
|
|
78
|
-
node: node,
|
|
79
|
-
messageId: exports.noEffectDecorator,
|
|
80
|
-
suggest: [
|
|
81
|
-
{
|
|
82
|
-
messageId: exports.noEffectDecoratorSuggest,
|
|
83
|
-
fix: function (fixer) { return fixer.remove(node); }
|
|
84
|
-
},
|
|
85
|
-
]
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
context.report({
|
|
90
|
-
node: node,
|
|
91
|
-
messageId: exports.noEffectDecorator,
|
|
92
|
-
fix: function (fixer) { return getFixes(node, sourceCode, fixer); }
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
_a;
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
function getCreateEffectFix(fixer, propertyValueExpression) {
|
|
100
|
-
return fixer.insertTextBefore(propertyValueExpression, "".concat(createEffectKeyword, "(() => { return "));
|
|
101
|
-
}
|
|
102
|
-
function getCreateEffectConfigFix(fixer, propertyValueExpression, configText) {
|
|
103
|
-
var append = configText ? ", ".concat(configText) : '';
|
|
104
|
-
return fixer.insertTextAfter(propertyValueExpression, "}".concat(append, ")"));
|
|
105
|
-
}
|
|
106
|
-
function getFixes(node, sourceCode, fixer) {
|
|
107
|
-
var classDeclaration = node.parent.parent.parent;
|
|
108
|
-
var propertyValueExpression = node.parent.value;
|
|
109
|
-
var _a = __read((0, utils_1.getDecoratorArguments)(node), 1), decoratorArgument = _a[0];
|
|
110
|
-
var configText = decoratorArgument
|
|
111
|
-
? sourceCode.getText(decoratorArgument)
|
|
112
|
-
: undefined;
|
|
113
|
-
return [
|
|
114
|
-
fixer.remove(node),
|
|
115
|
-
getCreateEffectFix(fixer, propertyValueExpression),
|
|
116
|
-
getCreateEffectConfigFix(fixer, propertyValueExpression, configText),
|
|
117
|
-
].concat((0, utils_1.getImportAddFix)({
|
|
118
|
-
fixer: fixer,
|
|
119
|
-
importName: createEffectKeyword,
|
|
120
|
-
moduleName: utils_1.NGRX_MODULE_PATHS.effects,
|
|
121
|
-
node: classDeclaration
|
|
122
|
-
}));
|
|
123
|
-
}
|
|
124
|
-
//# sourceMappingURL=no-effect-decorator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"no-effect-decorator.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/effects/no-effect-decorator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAA6B;AAC7B,mDAAgD;AAChD,qCAMqB;AAER,QAAA,iBAAiB,GAAG,mBA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AmB;QAC/B,UAAU,EAAE,yBAAiB,CAAC,OAAO;QACrC,IAAI,EAAE,gBAAgB;KACvB,CAAC,CACH,CAAC;AACJ,CAAC","sourcesContent":["import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';\nimport * as path from 'path';\nimport { createRule } from '../../rule-creator';\nimport {\n getDecoratorArguments,\n getImportAddFix,\n isIdentifier,\n NGRX_MODULE_PATHS,\n propertyDefinitionWithEffectDecorator,\n} from '../../utils';\n\nexport const noEffectDecorator = 'noEffectDecorator';\nexport const noEffectDecoratorSuggest = 'noEffectDecoratorSuggest';\n\ntype MessageIds = typeof noEffectDecorator | typeof noEffectDecoratorSuggest;\ntype Options = readonly [];\ntype EffectDecorator = TSESTree.Decorator & {\n parent: TSESTree.PropertyDefinition & {\n parent: TSESTree.ClassBody & { parent: TSESTree.ClassDeclaration };\n value: TSESTree.CallExpression;\n };\n};\n\nconst createEffectKeyword = 'createEffect';\n\nexport default createRule<Options, MessageIds>({\n name: path.parse(__filename).name,\n meta: {\n type: 'suggestion',\n hasSuggestions: true,\n ngrxModule: 'effects',\n docs: {\n description: `The \\`${createEffectKeyword}\\` is preferred as the \\`@Effect\\` decorator is deprecated.`,\n recommended: 'warn',\n suggestion: true,\n },\n fixable: 'code',\n schema: [],\n messages: {\n [noEffectDecorator]: `The \\`@Effect\\` decorator is deprecated. Use \\`${createEffectKeyword}\\` instead.`,\n [noEffectDecoratorSuggest]: `Remove the \\`@Effect\\` decorator.`,\n },\n },\n defaultOptions: [],\n create: (context) => {\n const sourceCode = context.getSourceCode();\n\n return {\n [propertyDefinitionWithEffectDecorator](node: EffectDecorator) {\n const isUsingEffectCreator =\n isIdentifier(node.parent.value.callee) &&\n node.parent.value.callee.name === createEffectKeyword;\n\n if (isUsingEffectCreator) {\n context.report({\n node,\n messageId: noEffectDecorator,\n suggest: [\n {\n messageId: noEffectDecoratorSuggest,\n fix: (fixer) => fixer.remove(node),\n },\n ],\n });\n } else {\n context.report({\n node,\n messageId: noEffectDecorator,\n fix: (fixer) => getFixes(node, sourceCode, fixer),\n });\n }\n },\n };\n },\n});\n\nfunction getCreateEffectFix(\n fixer: TSESLint.RuleFixer,\n propertyValueExpression: TSESTree.CallExpression\n): TSESLint.RuleFix {\n return fixer.insertTextBefore(\n propertyValueExpression,\n `${createEffectKeyword}(() => { return `\n );\n}\n\nfunction getCreateEffectConfigFix(\n fixer: TSESLint.RuleFixer,\n propertyValueExpression: TSESTree.CallExpression,\n configText?: string\n): TSESLint.RuleFix {\n const append = configText ? `, ${configText}` : '';\n return fixer.insertTextAfter(propertyValueExpression, `}${append})`);\n}\n\nfunction getFixes(\n node: EffectDecorator,\n sourceCode: Readonly<TSESLint.SourceCode>,\n fixer: TSESLint.RuleFixer\n): readonly TSESLint.RuleFix[] {\n const classDeclaration = node.parent.parent.parent;\n const {\n parent: { value: propertyValueExpression },\n } = node;\n\n const [decoratorArgument] = getDecoratorArguments(node);\n const configText = decoratorArgument\n ? sourceCode.getText(decoratorArgument)\n : undefined;\n\n return [\n fixer.remove(node),\n getCreateEffectFix(fixer, propertyValueExpression),\n getCreateEffectConfigFix(fixer, propertyValueExpression, configText),\n ].concat(\n getImportAddFix({\n fixer,\n importName: createEffectKeyword,\n moduleName: NGRX_MODULE_PATHS.effects,\n node: classDeclaration,\n })\n );\n}\n"]}
|