Skip to content

Commit

Permalink
feat: insert prettier-ignore comment
Browse files Browse the repository at this point in the history
  • Loading branch information
solufa committed Feb 7, 2022
1 parent fe31e73 commit 4beee14
Show file tree
Hide file tree
Showing 10 changed files with 131 additions and 106 deletions.
204 changes: 110 additions & 94 deletions api/$api.ts

Large diffs are not rendered by default.

26 changes: 20 additions & 6 deletions api/$mock.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,42 @@
/* eslint-disable */
// prettier-ignore
import { AspidaClient } from 'aspida'
// prettier-ignore
import { MockClient, MockConfig, mockClient } from 'aspida-mock'
// prettier-ignore
import baseMiddleware from './@middleware'
// prettier-ignore
import api from './$api'
// prettier-ignore
import mock0 from './v2.0/index'
import mock1 from './v1.1/users/_userId@User[\'id\']'
// prettier-ignore
import mock1 from './v1.1/users/_userId@string'
// prettier-ignore
import mock2 from './v1.1/_articleId.json'
// prettier-ignore
import mock3 from './v1.1/3.1'
import mock4 from './v1.1/2/_hogeId@HogeId/test-4/_fugaId'
// prettier-ignore
import mock4 from './v1.1/2/_hogeId@string/test-4/_fugaId'
// prettier-ignore
import mock5 from './v1.1'
// prettier-ignore
import mock6 from './index'
import mock7 from './_sampleId.json@number'
// prettier-ignore
import mock7 from './_sampleId@number.json'

// prettier-ignore
export const mockRoutes = () => [
{ path: '/v2.0', methods: mock0 },
{ path: '/v1.1/users/_userId@User[\'id\']', methods: mock1 },
{ path: '/v1.1/users/_userId@string', methods: mock1 },
{ path: '/v1.1/_articleId.json', methods: mock2 },
{ path: '/v1.1/3.1', methods: mock3 },
{ path: '/v1.1/2/_hogeId@HogeId/test-4/_fugaId', methods: mock4 },
{ path: '/v1.1/2/_hogeId@string/test-4/_fugaId', methods: mock4 },
{ path: '/v1.1', methods: mock5 },
{ path: '', methods: mock6 },
{ path: '/_sampleId.json@number', methods: mock7 }
{ path: '/_sampleId@number.json', methods: mock7 }
]

// prettier-ignore
export default <U>(client: AspidaClient<U> | MockClient<U>, config?: MockConfig) => {
const middleware = [...baseMiddleware, ...(config?.middleware || [])]
const mock = 'attachRoutes' in client ? client : mockClient(client)
Expand Down
5 changes: 0 additions & 5 deletions api/@types.ts

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/cli/createRouteString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ export default <U>(client: AspidaClient<U> | MockClient<U>, config?: MockConfig)
mock.attachRoutes(mockRoutes(), ${hasMiddleware ? '{ ...config, middleware }' : 'config'})
return api(mock)
}\n`
}\n`.replace(/\n([a-z])/g, '\n// prettier-ignore\n$1')

0 comments on commit 4beee14

Please sign in to comment.