Skip to content

Commit 2f77c9e

Browse files
committed
🚨 Fix lint errorr
1 parent 610a758 commit 2f77c9e

3 files changed

Lines changed: 12 additions & 14 deletions

File tree

‎src/config.js‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
const Conf = require('conf')
22
const constants = require('./constants')
33

4-
54
const config = new Conf()
65

76
const getModelsPath = ()/* :void */ => config.get(constants.MODELS_PATH, constants.BASE_MODELS_PATH)
87
// const getModelsPath = ()/* :void */ => constants.BASE_MODELS_PATH
9-
const setModelsPath = (modelsPath/* :string */)/* :string */ => config.set(constants.MODELS_PATH, modelsPath)
8+
const setModelsPath = modelsPath/* :string */ => config.set(constants.MODELS_PATH, modelsPath)
109

1110
const getAll = () => {
1211
let result = {}
1312
constants.CONFIG_KEYS.forEach(key => {
1413
result[key] = config.get(key)
1514
})
16-
return result;
15+
return result
1716
}
1817

1918
module.exports = {

‎src/constants.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const {workDir} = require('./path')
22

33
// config key
44
const MODELS_PATH = 'models-path'
5-
const CONFIG_KEYS = [MODELS_PATH];
5+
const CONFIG_KEYS = [MODELS_PATH]
66

77
// values
88
const BASE_MODELS_PATH = `${workDir}/models`

‎src/index.js‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ const jq = require('node-jq')
33

44
const Repl = require('./repl')
55
const {initializeContext} = require('./sequelize-context')
6-
const { setModelsPath, getAll } = require('./config')
6+
const {setModelsPath, getAll} = require('./config')
77

88
const _initialFlags = {}
99

1010
class SequelizeTinkerCommand extends Command {
11-
1211
async run() {
1312
const {flags, args} = this.parse(SequelizeTinkerCommand)
1413

@@ -18,13 +17,13 @@ class SequelizeTinkerCommand extends Command {
1817

1918
// show config
2019
if (args.firstArg === 'config') {
21-
jq.run('.', getAll(), { input: 'json' })
22-
.then((output) => {
23-
this.log(output)
24-
})
25-
.catch((error) => {
26-
this.error(error)
27-
})
20+
jq.run('.', getAll(), {input: 'json'})
21+
.then(output => {
22+
this.log(output)
23+
})
24+
.catch(error => {
25+
this.error(error)
26+
})
2827
return
2928
}
3029

@@ -48,7 +47,7 @@ SequelizeTinkerCommand.flags = {
4847
// add --help flag to show CLI version
4948
help: flags.help({char: 'h'}),
5049
// name: flags.string({ char: 'n', description: 'name to print' })
51-
'models-path': flags.string({char: 'p', description: `Set Sequelize models's dir path.`}),
50+
'models-path': flags.string({char: 'p', description: 'Set Sequelize models\'s dir path.'}),
5251
}
5352

5453
SequelizeTinkerCommand.args = [

0 commit comments

Comments
 (0)