@ngrx/eslint-plugin 14.3.2 → 15.0.0-beta.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/package.json +2 -2
- 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/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.1",
|
|
4
4
|
"description": "NgRx ESLint Plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"typescript": ">=4.4.0"
|
|
48
48
|
},
|
|
49
49
|
"main": "./src/index.js",
|
|
50
|
-
"
|
|
50
|
+
"types": "./src/index.d.ts"
|
|
51
51
|
}
|
|
@@ -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"]}
|
|
@@ -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":"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","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,mBAAmB,CAAC;AACxC,QAAA,wBAAwB,GAAG,0BAA0B,CAAC;AAWnE,IAAM,mBAAmB,GAAG,cAAc,CAAC;AAE3C,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,EAAE,eAAS,mBAAmB,6DAA6D;YACtG,WAAW,EAAE,MAAM;YACnB,UAAU,EAAE,IAAI;SACjB;QACD,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,EAAE;QACV,QAAQ;YACN,GAAC,yBAAiB,IAAG,sDAAkD,mBAAmB,eAAa;YACvG,GAAC,gCAAwB,IAAG,iCAAmC;eAChE;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,UAAC,OAAO;;QACd,IAAM,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;QAE3C;YACE,GAAC,6CAAqC,IAAtC,UAAwC,IAAqB;gBAC3D,IAAM,oBAAoB,GACxB,IAAA,oBAAY,EAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;oBACtC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,mBAAmB,CAAC;gBAExD,IAAI,oBAAoB,EAAE;oBACxB,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI,MAAA;wBACJ,SAAS,EAAE,yBAAiB;wBAC5B,OAAO,EAAE;4BACP;gCACE,SAAS,EAAE,gCAAwB;gCACnC,GAAG,EAAE,UAAC,KAAK,IAAK,OAAA,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAlB,CAAkB;6BACnC;yBACF;qBACF,CAAC,CAAC;iBACJ;qBAAM;oBACL,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI,MAAA;wBACJ,SAAS,EAAE,yBAAiB;wBAC5B,GAAG,EAAE,UAAC,KAAK,IAAK,OAAA,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,EAAjC,CAAiC;qBAClD,CAAC,CAAC;iBACJ;YACH,CAAC;eACD;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,SAAS,kBAAkB,CACzB,KAAyB,EACzB,uBAAgD;IAEhD,OAAO,KAAK,CAAC,gBAAgB,CAC3B,uBAAuB,EACvB,UAAG,mBAAmB,qBAAkB,CACzC,CAAC;AACJ,CAAC;AAED,SAAS,wBAAwB,CAC/B,KAAyB,EACzB,uBAAgD,EAChD,UAAmB;IAEnB,IAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,YAAK,UAAU,CAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACnD,OAAO,KAAK,CAAC,eAAe,CAAC,uBAAuB,EAAE,WAAI,MAAM,MAAG,CAAC,CAAC;AACvE,CAAC;AAED,SAAS,QAAQ,CACf,IAAqB,EACrB,UAAyC,EACzC,KAAyB;IAEzB,IAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;IAEvC,IAAO,uBAAuB,GACtC,IAAI,aADkC,CACjC;IAEH,IAAA,KAAA,OAAsB,IAAA,6BAAqB,EAAC,IAAI,CAAC,IAAA,EAAhD,iBAAiB,QAA+B,CAAC;IACxD,IAAM,UAAU,GAAG,iBAAiB;QAClC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,iBAAiB,CAAC;QACvC,CAAC,CAAC,SAAS,CAAC;IAEd,OAAO;QACL,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;QAClB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,CAAC;QAClD,wBAAwB,CAAC,KAAK,EAAE,uBAAuB,EAAE,UAAU,CAAC;KACrE,CAAC,MAAM,CACN,IAAA,uBAAe,EAAC;QACd,KAAK,OAAA;QACL,UAAU,EAAE,mBAAmB;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"]}
|