-
Notifications
You must be signed in to change notification settings - Fork 101
feat: converters for ngrx
rules
#1194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a563edf
feat: converters for `ngrx` rules
rafaelss95 e5e6028
Merge branch 'main' of github.com:typescript-eslint/tslint-to-eslint-…
rafaelss95 0d4b58f
fix: wrong name for `no-effect-decorator-and-creator`
rafaelss95 ac1a487
feat: add missing converter for `ngrx-no-duplicate-action-types`
rafaelss95 f10cc0a
fixup! feat: add missing converter for `ngrx-no-duplicate-action-types`
rafaelss95 9106d3b
refactor: rename folder
rafaelss95 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-ngrx/action-hygiene.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertActionHygiene: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/good-action-hygiene", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}; | ||
}; |
12 changes: 12 additions & 0 deletions
12
...ules/ruleConverters/eslint-plugin-ngrx/avoid-dispatching-multiple-actions-sequentially.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertAvoidDispatchingMultipleActionsSequentially: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/avoid-dispatching-multiple-actions-sequentially", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}; | ||
}; |
12 changes: 12 additions & 0 deletions
12
...rters/lintConfigs/rules/ruleConverters/eslint-plugin-ngrx/effect-creator-and-decorator.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertEffectCreatorAndDecorator: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/effect-decorator-and-creator", | ||
JoshuaKGoldberg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}; | ||
}; |
12 changes: 12 additions & 0 deletions
12
src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-ngrx/no-dispatch-in-effects.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertNoDispatchInEffects: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/no-dispatch-in-effects", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}; | ||
}; |
12 changes: 12 additions & 0 deletions
12
src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-ngrx/no-effect-decorator.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertNoEffectDecorator: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/no-effect-decorator", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}; | ||
}; |
12 changes: 12 additions & 0 deletions
12
...converters/lintConfigs/rules/ruleConverters/eslint-plugin-ngrx/no-effects-in-providers.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertNoEffectsInProviders: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/no-effects-in-providers", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}; | ||
}; |
12 changes: 12 additions & 0 deletions
12
...ers/lintConfigs/rules/ruleConverters/eslint-plugin-ngrx/no-multiple-actions-in-effects.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertNoMultipleActionsInEffects: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/no-multiple-actions-in-effects", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}; | ||
}; |
12 changes: 12 additions & 0 deletions
12
src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-ngrx/no-multiple-stores.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertNoMultipleStores: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/no-multiple-global-stores", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}; | ||
}; |
12 changes: 12 additions & 0 deletions
12
...converters/lintConfigs/rules/ruleConverters/eslint-plugin-ngrx/no-reducer-in-key-names.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertNoReducerInKeyNames: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/no-reducer-in-key-names", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}; | ||
}; |
12 changes: 12 additions & 0 deletions
12
src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-ngrx/no-typed-store.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertNoTypedStore: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/no-typed-global-store", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}; | ||
}; |
12 changes: 12 additions & 0 deletions
12
...rs/lintConfigs/rules/ruleConverters/eslint-plugin-ngrx/on-reducer-explicit-return-type.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertOnReducerExplicitReturnType: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/on-function-explicit-return-type", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}; | ||
}; |
12 changes: 12 additions & 0 deletions
12
src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-ngrx/selector-for-select.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { RuleConverter } from "../../ruleConverter"; | ||
|
||
export const convertSelectorForSelect: RuleConverter = () => { | ||
return { | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/use-selector-in-select", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}; | ||
}; |
18 changes: 18 additions & 0 deletions
18
...nverters/lintConfigs/rules/ruleConverters/eslint-plugin-ngrx/tests/action-hygiene.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { convertActionHygiene } from "../action-hygiene"; | ||
|
||
describe(convertActionHygiene, () => { | ||
test("conversion without arguments", () => { | ||
const result = convertActionHygiene({ | ||
ruleArguments: [], | ||
}); | ||
|
||
expect(result).toEqual({ | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/good-action-hygiene", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}); | ||
}); | ||
}); |
18 changes: 18 additions & 0 deletions
18
...nverters/eslint-plugin-ngrx/tests/avoid-dispatching-multiple-actions-sequentially.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { convertAvoidDispatchingMultipleActionsSequentially } from "../avoid-dispatching-multiple-actions-sequentially"; | ||
|
||
describe(convertAvoidDispatchingMultipleActionsSequentially, () => { | ||
test("conversion without arguments", () => { | ||
const result = convertAvoidDispatchingMultipleActionsSequentially({ | ||
ruleArguments: [], | ||
}); | ||
|
||
expect(result).toEqual({ | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/avoid-dispatching-multiple-actions-sequentially", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}); | ||
}); | ||
}); |
18 changes: 18 additions & 0 deletions
18
...onfigs/rules/ruleConverters/eslint-plugin-ngrx/tests/effect-creator-and-decorator.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { convertEffectCreatorAndDecorator } from "../effect-creator-and-decorator"; | ||
|
||
describe(convertEffectCreatorAndDecorator, () => { | ||
test("conversion without arguments", () => { | ||
const result = convertEffectCreatorAndDecorator({ | ||
ruleArguments: [], | ||
}); | ||
|
||
expect(result).toEqual({ | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/effect-decorator-and-creator", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}); | ||
}); | ||
}); |
18 changes: 18 additions & 0 deletions
18
.../lintConfigs/rules/ruleConverters/eslint-plugin-ngrx/tests/no-dispatch-in-effects.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { convertNoDispatchInEffects } from "../no-dispatch-in-effects"; | ||
|
||
describe(convertNoDispatchInEffects, () => { | ||
test("conversion without arguments", () => { | ||
const result = convertNoDispatchInEffects({ | ||
ruleArguments: [], | ||
}); | ||
|
||
expect(result).toEqual({ | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/no-dispatch-in-effects", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}); | ||
}); | ||
}); |
18 changes: 18 additions & 0 deletions
18
...ers/lintConfigs/rules/ruleConverters/eslint-plugin-ngrx/tests/no-effect-decorator.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { convertNoEffectDecorator } from "../no-effect-decorator"; | ||
|
||
describe(convertNoEffectDecorator, () => { | ||
test("conversion without arguments", () => { | ||
const result = convertNoEffectDecorator({ | ||
ruleArguments: [], | ||
}); | ||
|
||
expect(result).toEqual({ | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/no-effect-decorator", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}); | ||
}); | ||
}); |
18 changes: 18 additions & 0 deletions
18
...lintConfigs/rules/ruleConverters/eslint-plugin-ngrx/tests/no-effects-in-providers.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { convertNoEffectsInProviders } from "../no-effects-in-providers"; | ||
|
||
describe(convertNoEffectsInProviders, () => { | ||
test("conversion without arguments", () => { | ||
const result = convertNoEffectsInProviders({ | ||
ruleArguments: [], | ||
}); | ||
|
||
expect(result).toEqual({ | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/no-effects-in-providers", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}); | ||
}); | ||
}); |
18 changes: 18 additions & 0 deletions
18
...figs/rules/ruleConverters/eslint-plugin-ngrx/tests/no-multiple-actions-in-effects.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { convertNoMultipleActionsInEffects } from "../no-multiple-actions-in-effects"; | ||
|
||
describe(convertNoMultipleActionsInEffects, () => { | ||
test("conversion without arguments", () => { | ||
const result = convertNoMultipleActionsInEffects({ | ||
ruleArguments: [], | ||
}); | ||
|
||
expect(result).toEqual({ | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/no-multiple-actions-in-effects", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}); | ||
}); | ||
}); |
18 changes: 18 additions & 0 deletions
18
...ters/lintConfigs/rules/ruleConverters/eslint-plugin-ngrx/tests/no-multiple-stores.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { convertNoMultipleStores } from "../no-multiple-stores"; | ||
|
||
describe(convertNoMultipleStores, () => { | ||
test("conversion without arguments", () => { | ||
const result = convertNoMultipleStores({ | ||
ruleArguments: [], | ||
}); | ||
|
||
expect(result).toEqual({ | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/no-multiple-global-stores", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}); | ||
}); | ||
}); |
18 changes: 18 additions & 0 deletions
18
...lintConfigs/rules/ruleConverters/eslint-plugin-ngrx/tests/no-reducer-in-key-names.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { convertNoReducerInKeyNames } from "../no-reducer-in-key-names"; | ||
|
||
describe(convertNoReducerInKeyNames, () => { | ||
test("conversion without arguments", () => { | ||
const result = convertNoReducerInKeyNames({ | ||
ruleArguments: [], | ||
}); | ||
|
||
expect(result).toEqual({ | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/no-reducer-in-key-names", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}); | ||
}); | ||
}); |
18 changes: 18 additions & 0 deletions
18
...nverters/lintConfigs/rules/ruleConverters/eslint-plugin-ngrx/tests/no-typed-store.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { convertNoTypedStore } from "../no-typed-store"; | ||
|
||
describe(convertNoTypedStore, () => { | ||
test("conversion without arguments", () => { | ||
const result = convertNoTypedStore({ | ||
ruleArguments: [], | ||
}); | ||
|
||
expect(result).toEqual({ | ||
rules: [ | ||
{ | ||
ruleName: "ngrx/no-typed-global-store", | ||
}, | ||
], | ||
plugins: ["eslint-plugin-ngrx"], | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.