diff --git a/src/builders.test.ts b/src/builders.test.ts index 4273ed7d..0eb1f512 100644 --- a/src/builders.test.ts +++ b/src/builders.test.ts @@ -1,24 +1,24 @@ import { - rule, - ruleType, - and, allow, - or, + and, chain, - race, - not, deny, + not, + or, + race, + rule, + ruleType, } from './builders'; import { BaseRule, - ShieldCache, RuleAnd, - RuleOr, RuleChain, - RuleRace, + RuleFalse, RuleNot, + RuleOr, + RuleRace, RuleTrue, - RuleFalse, + ShieldCache, } from './rules'; describe('Builders Tests', () => { diff --git a/src/builders.ts b/src/builders.ts index 28c86443..115aac5e 100644 --- a/src/builders.ts +++ b/src/builders.ts @@ -1,16 +1,16 @@ import { - ShieldRule, BaseRule, - ShieldRuleOptions, - ShieldRuleFunction, - RuleTrue, - RuleFalse, - ShieldCache, RuleAnd, RuleChain, + RuleFalse, RuleNot, RuleOr, RuleRace, + RuleTrue, + ShieldCache, + ShieldRule, + ShieldRuleFunction, + ShieldRuleOptions, } from './rules'; /** diff --git a/src/plugin.ts b/src/plugin.ts index a46aeb10..8e2db921 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -1,14 +1,14 @@ -import * as hash from 'object-hash'; import { plugin } from '@nexus/schema'; import { printedGenTyping, printedGenTypingImport, } from '@nexus/schema/dist/utils'; +import * as hash from 'object-hash'; import { allow } from './builders'; -import { isShieldRule } from './utils'; -import { ShieldContext, ShieldRule } from './rules'; import { ShieldPluginSettings } from './config'; +import { ShieldContext, ShieldRule } from './rules'; +import { isShieldRule } from './utils'; const FieldShieldImport = printedGenTypingImport({ module: 'nexus-shield', diff --git a/src/rules/base.ts b/src/rules/base.ts index e657047e..76e3175c 100644 --- a/src/rules/base.ts +++ b/src/rules/base.ts @@ -1,15 +1,15 @@ +import { ArgsValue, GetGen, RootValue } from '@nexus/schema/dist/core'; import { GraphQLResolveInfo } from 'graphql'; -import { RootValue, ArgsValue, GetGen } from '@nexus/schema/dist/core'; +import { ShieldPluginOptions } from '../config'; import { - ShieldRule, + ShieldCache, ShieldContext, - ShieldRuleResult, + ShieldRule, ShieldRuleFunction, - ShieldCache, ShieldRuleOptions, + ShieldRuleResult, } from './interface'; -import { ShieldPluginOptions } from '../config'; export class BaseRule implements ShieldRule { diff --git a/src/rules/interface.ts b/src/rules/interface.ts index 15fea600..e5f58c72 100644 --- a/src/rules/interface.ts +++ b/src/rules/interface.ts @@ -1,5 +1,5 @@ +import { ArgsValue, GetGen, RootValue } from '@nexus/schema/dist/core'; import { GraphQLResolveInfo } from 'graphql'; -import { RootValue, ArgsValue, GetGen } from '@nexus/schema/dist/core'; import { ShieldPluginOptions } from '../config'; diff --git a/src/rules/logic.ts b/src/rules/logic.ts index 320e5e7e..511dce5e 100644 --- a/src/rules/logic.ts +++ b/src/rules/logic.ts @@ -1,8 +1,8 @@ +import { ArgsValue, GetGen, RootValue } from '@nexus/schema/dist/core'; import { GraphQLResolveInfo } from 'graphql'; -import { RootValue, ArgsValue, GetGen } from '@nexus/schema/dist/core'; -import { ShieldRule, ShieldContext, ShieldRuleResult } from './interface'; import { ShieldPluginOptions } from '../config'; +import { ShieldContext, ShieldRule, ShieldRuleResult } from './interface'; export class LogicRule implements ShieldRule { diff --git a/src/rules/operators/and.test.ts b/src/rules/operators/and.test.ts index 3752cd18..b85bbde2 100644 --- a/src/rules/operators/and.test.ts +++ b/src/rules/operators/and.test.ts @@ -1,11 +1,10 @@ -import { mock, MockProxy } from 'jest-mock-extended'; import { GraphQLResolveInfo } from 'graphql'; +import { mock, MockProxy } from 'jest-mock-extended'; +import { pluginOptions, RuleThrow } from '../../../tests/helpers'; import { RuleAnd } from './and'; -import { RuleTrue } from './true'; import { RuleFalse } from './false'; - -import { pluginOptions, RuleThrow } from '../../../tests/helpers'; +import { RuleTrue } from './true'; describe('RuleAnd Tests', () => { let info: MockProxy; diff --git a/src/rules/operators/and.ts b/src/rules/operators/and.ts index 039f8f55..07f5d1f2 100644 --- a/src/rules/operators/and.ts +++ b/src/rules/operators/and.ts @@ -1,9 +1,9 @@ +import { ArgsValue, GetGen, RootValue } from '@nexus/schema/dist/core'; import { GraphQLResolveInfo } from 'graphql'; -import { RootValue, ArgsValue, GetGen } from '@nexus/schema/dist/core'; -import { ShieldRule, ShieldRuleResult, ShieldContext } from '../interface'; -import { LogicRule } from '../logic'; import { ShieldPluginOptions } from '../../config'; +import { ShieldContext, ShieldRule, ShieldRuleResult } from '../interface'; +import { LogicRule } from '../logic'; export class RuleAnd< TypeName extends string, diff --git a/src/rules/operators/chain.test.ts b/src/rules/operators/chain.test.ts index 86c67e33..8a067a28 100644 --- a/src/rules/operators/chain.test.ts +++ b/src/rules/operators/chain.test.ts @@ -1,12 +1,11 @@ -import { mock, MockProxy } from 'jest-mock-extended'; import { GraphQLResolveInfo } from 'graphql'; +import { mock, MockProxy } from 'jest-mock-extended'; +import { pluginOptions, RuleThrow } from '../../../tests/helpers'; +import { ShieldRule } from '../interface'; import { RuleChain } from './chain'; -import { RuleTrue } from './true'; import { RuleFalse } from './false'; -import { ShieldRule } from '../interface'; - -import { pluginOptions, RuleThrow } from '../../../tests/helpers'; +import { RuleTrue } from './true'; describe('RuleChain Tests', () => { let info: MockProxy; diff --git a/src/rules/operators/chain.ts b/src/rules/operators/chain.ts index 46610ef5..5b57a086 100644 --- a/src/rules/operators/chain.ts +++ b/src/rules/operators/chain.ts @@ -1,9 +1,9 @@ +import { ArgsValue, GetGen, RootValue } from '@nexus/schema/dist/core'; import { GraphQLResolveInfo } from 'graphql'; -import { RootValue, ArgsValue, GetGen } from '@nexus/schema/dist/core'; -import { ShieldRule, ShieldRuleResult, ShieldContext } from '../interface'; -import { LogicRule } from '../logic'; import { ShieldPluginOptions } from '../../config'; +import { ShieldContext, ShieldRule, ShieldRuleResult } from '../interface'; +import { LogicRule } from '../logic'; export class RuleChain< TypeName extends string, diff --git a/src/rules/operators/false.ts b/src/rules/operators/false.ts index e0877cd2..2c1ea202 100644 --- a/src/rules/operators/false.ts +++ b/src/rules/operators/false.ts @@ -1,5 +1,5 @@ -import { LogicRule } from '../logic'; import { ShieldRuleResult } from '../interface'; +import { LogicRule } from '../logic'; export class RuleFalse extends LogicRule { constructor() { diff --git a/src/rules/operators/not.test.ts b/src/rules/operators/not.test.ts index 02a7c8c3..66557d7e 100644 --- a/src/rules/operators/not.test.ts +++ b/src/rules/operators/not.test.ts @@ -1,11 +1,10 @@ -import { mock, MockProxy } from 'jest-mock-extended'; import { GraphQLResolveInfo } from 'graphql'; +import { mock, MockProxy } from 'jest-mock-extended'; +import { pluginOptions, RuleThrow } from '../../../tests/helpers'; +import { RuleFalse } from './false'; import { RuleNot } from './not'; import { RuleTrue } from './true'; -import { RuleFalse } from './false'; - -import { pluginOptions, RuleThrow } from '../../../tests/helpers'; describe('RuleNot Tests', () => { let info: MockProxy; diff --git a/src/rules/operators/not.ts b/src/rules/operators/not.ts index b1726ae5..6ee16e9c 100644 --- a/src/rules/operators/not.ts +++ b/src/rules/operators/not.ts @@ -1,9 +1,9 @@ +import { ArgsValue, GetGen, RootValue } from '@nexus/schema/dist/core'; import { GraphQLResolveInfo } from 'graphql'; -import { RootValue, ArgsValue, GetGen } from '@nexus/schema/dist/core'; -import { ShieldRule, ShieldRuleResult, ShieldContext } from '../interface'; -import { LogicRule } from '../logic'; import { ShieldPluginOptions } from '../../config'; +import { ShieldContext, ShieldRule, ShieldRuleResult } from '../interface'; +import { LogicRule } from '../logic'; export class RuleNot< TypeName extends string, diff --git a/src/rules/operators/or.test.ts b/src/rules/operators/or.test.ts index 42719928..cea310bf 100644 --- a/src/rules/operators/or.test.ts +++ b/src/rules/operators/or.test.ts @@ -1,11 +1,10 @@ -import { mock, MockProxy } from 'jest-mock-extended'; import { GraphQLResolveInfo } from 'graphql'; +import { mock, MockProxy } from 'jest-mock-extended'; +import { pluginOptions, RuleThrow } from '../../../tests/helpers'; +import { RuleFalse } from './false'; import { RuleOr } from './or'; import { RuleTrue } from './true'; -import { RuleFalse } from './false'; - -import { pluginOptions, RuleThrow } from '../../../tests/helpers'; describe('RuleOr Tests', () => { let info: MockProxy; diff --git a/src/rules/operators/or.ts b/src/rules/operators/or.ts index 0535fc33..7223c214 100644 --- a/src/rules/operators/or.ts +++ b/src/rules/operators/or.ts @@ -1,9 +1,9 @@ +import { ArgsValue, GetGen, RootValue } from '@nexus/schema/dist/core'; import { GraphQLResolveInfo } from 'graphql'; -import { RootValue, ArgsValue, GetGen } from '@nexus/schema/dist/core'; -import { ShieldRule, ShieldRuleResult, ShieldContext } from '../interface'; -import { LogicRule } from '../logic'; import { ShieldPluginOptions } from '../../config'; +import { ShieldContext, ShieldRule, ShieldRuleResult } from '../interface'; +import { LogicRule } from '../logic'; export class RuleOr< TypeName extends string, diff --git a/src/rules/operators/race.test.ts b/src/rules/operators/race.test.ts index 64cfed71..c80e6d9e 100644 --- a/src/rules/operators/race.test.ts +++ b/src/rules/operators/race.test.ts @@ -1,12 +1,11 @@ -import { mock, MockProxy } from 'jest-mock-extended'; import { GraphQLResolveInfo } from 'graphql'; +import { mock, MockProxy } from 'jest-mock-extended'; +import { pluginOptions, RuleThrow } from '../../../tests/helpers'; +import { ShieldRule } from '../interface'; +import { RuleFalse } from './false'; import { RuleRace } from './race'; import { RuleTrue } from './true'; -import { RuleFalse } from './false'; -import { ShieldRule } from '../interface'; - -import { pluginOptions, RuleThrow } from '../../../tests/helpers'; describe('RuleRace Tests', () => { let info: MockProxy; diff --git a/src/rules/operators/race.ts b/src/rules/operators/race.ts index 921a96a4..327aefd8 100644 --- a/src/rules/operators/race.ts +++ b/src/rules/operators/race.ts @@ -1,9 +1,9 @@ +import { ArgsValue, GetGen, RootValue } from '@nexus/schema/dist/core'; import { GraphQLResolveInfo } from 'graphql'; -import { RootValue, ArgsValue, GetGen } from '@nexus/schema/dist/core'; -import { ShieldRule, ShieldRuleResult, ShieldContext } from '../interface'; -import { LogicRule } from '../logic'; import { ShieldPluginOptions } from '../../config'; +import { ShieldContext, ShieldRule, ShieldRuleResult } from '../interface'; +import { LogicRule } from '../logic'; export class RuleRace< TypeName extends string, diff --git a/src/rules/operators/true.ts b/src/rules/operators/true.ts index 528acad1..c87314cb 100644 --- a/src/rules/operators/true.ts +++ b/src/rules/operators/true.ts @@ -1,5 +1,5 @@ -import { LogicRule } from '../logic'; import { ShieldRuleResult } from '../interface'; +import { LogicRule } from '../logic'; export class RuleTrue extends LogicRule { constructor() {