Skip to content

Commit

Permalink
fix(import): More import reorder
Browse files Browse the repository at this point in the history
  • Loading branch information
Sytten committed Jun 18, 2020
1 parent 03ac3a8 commit da1c04b
Show file tree
Hide file tree
Showing 18 changed files with 61 additions and 66 deletions.
20 changes: 10 additions & 10 deletions src/builders.test.ts
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand Down
12 changes: 6 additions & 6 deletions src/builders.ts
Original file line number Diff line number Diff line change
@@ -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';

/**
Expand Down
6 changes: 3 additions & 3 deletions src/plugin.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
10 changes: 5 additions & 5 deletions src/rules/base.ts
Original file line number Diff line number Diff line change
@@ -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<TypeName extends string, FieldName extends string>
implements ShieldRule<TypeName, FieldName> {
Expand Down
2 changes: 1 addition & 1 deletion src/rules/interface.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
4 changes: 2 additions & 2 deletions src/rules/logic.ts
Original file line number Diff line number Diff line change
@@ -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<TypeName extends string, FieldName extends string>
implements ShieldRule<TypeName, FieldName> {
Expand Down
7 changes: 3 additions & 4 deletions src/rules/operators/and.test.ts
Original file line number Diff line number Diff line change
@@ -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<GraphQLResolveInfo>;
Expand Down
6 changes: 3 additions & 3 deletions src/rules/operators/and.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
9 changes: 4 additions & 5 deletions src/rules/operators/chain.test.ts
Original file line number Diff line number Diff line change
@@ -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<GraphQLResolveInfo>;
Expand Down
6 changes: 3 additions & 3 deletions src/rules/operators/chain.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/rules/operators/false.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LogicRule } from '../logic';
import { ShieldRuleResult } from '../interface';
import { LogicRule } from '../logic';

export class RuleFalse extends LogicRule<any, any> {
constructor() {
Expand Down
7 changes: 3 additions & 4 deletions src/rules/operators/not.test.ts
Original file line number Diff line number Diff line change
@@ -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<GraphQLResolveInfo>;
Expand Down
6 changes: 3 additions & 3 deletions src/rules/operators/not.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
7 changes: 3 additions & 4 deletions src/rules/operators/or.test.ts
Original file line number Diff line number Diff line change
@@ -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<GraphQLResolveInfo>;
Expand Down
6 changes: 3 additions & 3 deletions src/rules/operators/or.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
9 changes: 4 additions & 5 deletions src/rules/operators/race.test.ts
Original file line number Diff line number Diff line change
@@ -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<GraphQLResolveInfo>;
Expand Down
6 changes: 3 additions & 3 deletions src/rules/operators/race.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/rules/operators/true.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LogicRule } from '../logic';
import { ShieldRuleResult } from '../interface';
import { LogicRule } from '../logic';

export class RuleTrue extends LogicRule<any, any> {
constructor() {
Expand Down

0 comments on commit da1c04b

Please sign in to comment.