Skip to content

Commit

Permalink
fix: lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaperskyguru committed Apr 9, 2022
1 parent 57dd9c4 commit 02d8b4a
Show file tree
Hide file tree
Showing 24 changed files with 954 additions and 937 deletions.
12 changes: 0 additions & 12 deletions .eslintrc.json

This file was deleted.

16 changes: 8 additions & 8 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"trailingComma": "all",
"semi": false,
"singleQuote": true,
"useTabs": true,
"quoteProps": "consistent",
"bracketSpacing": true,
"arrowParens": "always",
"printWidth": 100
"trailingComma": "all",
"semi": false,
"singleQuote": true,
"useTabs": true,
"quoteProps": "consistent",
"bracketSpacing": true,
"arrowParens": "always",
"printWidth": 100
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ CACHE_DRIVER=file // defaults to FILE
import Cache from '@ioc:Kaperskyguru/Adonis-cache'

let posts = await Cache.remember('_posts_', 60, async function () {
return await Post.all()
return await Post.all()
})
```

Expand Down
42 changes: 21 additions & 21 deletions adonis-typings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@
*/

declare module '@ioc:Kaperskyguru/Adonis-Cache' {
/**
* Shape of adonis-cache config.
*/
export interface CacheConfig {
driver: string
drivers: object
}
/**
* Shape of adonis-cache config.
*/
export interface CacheConfig {
driver: string
drivers: object
}

export interface CacheInterface {
get(name: string): Promise<any>
set(name: string, data: any, duration: number): Promise<any>
forever(name: string, data: any): Promise<any>
update(name: string, data: any, duration?: number): Promise<any>
delete(name: string): Promise<Boolean>
remember(name: string, minutes: number, callback: Function): Promise<any>
rememberForever(name: string, callback: Function): Promise<any>
many(keys: Array<string>): Promise<object>
setMany(data: object, minutes: number): Promise<any>
flush(): Promise<void>
}
const Cache: CacheInterface
export default Cache
export interface CacheInterface {
get(name: string): Promise<any>
set(name: string, data: any, duration: number): Promise<any>
forever(name: string, data: any): Promise<any>
update(name: string, data: any, duration?: number): Promise<any>
delete(name: string): Promise<Boolean>
remember(name: string, minutes: number, callback: Function): Promise<any>
rememberForever(name: string, callback: Function): Promise<any>
many(keys: Array<string>): Promise<object>
setMany(data: object, minutes: number): Promise<any>
flush(): Promise<void>
}
const Cache: CacheInterface
export default Cache
}
2 changes: 1 addition & 1 deletion config/Config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
cacheDriver: 'file',
cacheDriver: 'file',
}
12 changes: 6 additions & 6 deletions instructions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
const path = require('path')

module.exports = async (cli) => {
try {
const inFile = path.join(__dirname, './config', 'Config.ts')
const outFile = path.join(cli.helpers.configPath(), 'cache.js')
await cli.copy(inFile, outFile)
cli.command.completed('create', 'config/cache.js')
} catch (error) {}
try {
const inFile = path.join(__dirname, './config', 'Config.ts')
const outFile = path.join(cli.helpers.configPath(), 'cache.js')
await cli.copy(inFile, outFile)
cli.command.completed('create', 'config/cache.js')
} catch (error) {}
}
2 changes: 1 addition & 1 deletion instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ const Cache = use('Cache')
const Cache = use('Cache')

Cache.get('posts').then((post) => {
res.json(post)
res.json(post)
})
```
Loading

0 comments on commit 02d8b4a

Please sign in to comment.