Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Commit

Permalink
fix: updated eslint and tslint
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Sep 14, 2018
1 parent 2bd6e60 commit c2ae997
Show file tree
Hide file tree
Showing 6 changed files with 237 additions and 226 deletions.
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
"bugs": "https://github.com/oclif/oclif/issues",
"dependencies": {
"@oclif/command": "^1.5.0",
"@oclif/config": "^1.7.2",
"@oclif/config": "^1.7.6",
"@oclif/errors": "^1.2.0",
"@oclif/fixpack": "^2.3.0",
"@oclif/plugin-help": "^2.1.0",
"@oclif/plugin-help": "^2.1.2",
"@oclif/plugin-not-found": "^1.2.0",
"@oclif/plugin-warn-if-update-available": "^1.5.2",
"debug": "^3.1.0",
"lodash": "^4.17.10",
"debug": "^4.0.1",
"lodash": "^4.17.11",
"nps-utils": "^1.7.0",
"sort-pjson": "^1.0.3",
"tslib": "^1.9.3",
Expand All @@ -23,18 +23,18 @@
"yosay": "^2.0.2"
},
"devDependencies": {
"@oclif/dev-cli": "^1.17.0",
"@oclif/tslint": "^2.0.0",
"@oclif/dev-cli": "^1.18.0",
"@oclif/tslint": "^3.1.0",
"@types/lodash": "^4.14.116",
"@types/read-pkg": "^3.0.0",
"@types/shelljs": "^0.8.0",
"@types/yeoman-generator": "^2.0.3",
"@types/yosay": "^0.0.29",
"chai": "^4.1.2",
"eslint": "^5.4.0",
"eslint-config-oclif": "^3.0.0",
"eslint": "^5.5.0",
"eslint-config-oclif": "^3.1.0",
"execa": "^1.0.0",
"fancy-test": "^1.3.0",
"fancy-test": "^1.4.1",
"fs-extra": "^7.0.0",
"globby": "^8.0.1",
"mocha": "^5.2.0",
Expand All @@ -44,7 +44,7 @@
"tmp": "^0.0.33",
"ts-node": "^7.0.1",
"tslint": "^5.11.0",
"typescript": "^3.0.1"
"typescript": "^3.0.3"
},
"engines": {
"node": ">=8.0.0"
Expand Down
4 changes: 2 additions & 2 deletions scripts/release-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ module.exports = (_, options) => {
try {
execa.sync('git', ['commit', '-m', `${releaseType === 'patch' ? 'fix' : 'feat'}: oclif v${version}\n\n${notes}`], {stdio: 'inherit'})
sh.exec('git push')
} catch (err) {
console.error(err)
} catch (error) {
console.error(error)
}
sh.popd()
})
Expand Down
84 changes: 42 additions & 42 deletions src/generators/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ class App extends Generator {
async prompting() {
let msg
switch (this.type) {
case 'single':
msg = 'Time to build a single-command CLI with oclif!'
break
case 'multi':
msg = 'Time to build a multi-command CLI with oclif!'
break
default:
msg = `Time to build a oclif ${this.type}!`
case 'single':
msg = 'Time to build a single-command CLI with oclif!'
break
case 'multi':
msg = 'Time to build a multi-command CLI with oclif!'
break
default:
msg = `Time to build a oclif ${this.type}!`
}
this.log(yosay(`${msg} Version: ${version}`))

Expand Down Expand Up @@ -321,15 +321,15 @@ class App extends Generator {
this.sourceRoot(path.join(__dirname, '../../templates'))

switch (this.type) {
case 'multi':
case 'plugin':
this.pjson.oclif = {
commands: `./${this.ts ? 'lib' : 'src'}/commands`,
case 'multi':
case 'plugin':
this.pjson.oclif = {
commands: `./${this.ts ? 'lib' : 'src'}/commands`,
// hooks: {init: `./${this.ts ? 'lib' : 'src'}/hooks/init`},
...this.pjson.oclif,
}
break
default:
...this.pjson.oclif,
}
break
default:
}
if (this.type === 'plugin' && !this.pjson.oclif.devPlugins) {
this.pjson.oclif.devPlugins = [
Expand Down Expand Up @@ -394,58 +394,58 @@ class App extends Generator {
this.fs.write(this.destinationPath('.gitignore'), this._gitignore())

switch (this.type) {
case 'single':
this._writeSingle()
break
case 'plugin':
this._writePlugin()
break
case 'multi':
this._writeMulti()
break
default:
this._writeBase()
case 'single':
this._writeSingle()
break
case 'plugin':
this._writePlugin()
break
case 'multi':
this._writeMulti()
break
default:
this._writeBase()
}
}

install() {
const dependencies: string[] = []
const devDependencies: string[] = []
switch (this.type) {
case 'base': break
case 'single':
dependencies.push(
case 'base': break
case 'single':
dependencies.push(
'@oclif/config@^1',
'@oclif/command@^1',
'@oclif/plugin-help@^2',
)
break
case 'plugin':
dependencies.push(
break
case 'plugin':
dependencies.push(
'@oclif/command@^1',
'@oclif/config@^1',
)
devDependencies.push(
devDependencies.push(
'@oclif/dev-cli@^1',
'@oclif/plugin-help@^2',
'globby@^8',
)
break
case 'multi':
dependencies.push(
break
case 'multi':
dependencies.push(
'@oclif/config@^1',
'@oclif/command@^1',
'@oclif/plugin-help@^2',
)
devDependencies.push(
devDependencies.push(
'@oclif/dev-cli@^1',
'globby@^8',
)
}
if (this.mocha) {
devDependencies.push(
'mocha@^5',
'nyc@^12',
'nyc@^13',
'chai@^4',
)
if (this.type !== 'base') devDependencies.push(
Expand All @@ -465,14 +465,14 @@ class App extends Generator {
)
if (this.tslint) {
devDependencies.push(
'@oclif/tslint@^1',
'@oclif/tslint@^3',
'tslint@^5',
)
}
} else {
devDependencies.push(
'eslint@^5',
'eslint-config-oclif@^3',
'eslint@^5.5',
'eslint-config-oclif@^3.1',
)
}
if (isWindows) devDependencies.push('rimraf')
Expand Down
24 changes: 12 additions & 12 deletions templates/test/command.test.ts.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ import cmd = require('../src')

describe('<%- name %>', () => {
test
.stdout()
.stdout()
<%_ if (type === 'single') { _%>
.do(() => cmd.run([]))
.do(() => cmd.run([]))
<%_ } else { _%>
.command(['<%- name %>'])
.command(['<%- name %>'])
<%_ } _%>
.it('runs hello', ctx => {
expect(ctx.stdout).to.contain('hello world')
})
.it('runs hello', ctx => {
expect(ctx.stdout).to.contain('hello world')
})

test
.stdout()
.stdout()
<%_ if (type === 'single') { _%>
.do(() => cmd.run(['--name', 'jeff']))
.do(() => cmd.run(['--name', 'jeff']))
<%_ } else { _%>
.command(['<%- name %>', '--name', 'jeff'])
.command(['<%- name %>', '--name', 'jeff'])
<%_ } _%>
.it('runs hello --name jeff', ctx => {
expect(ctx.stdout).to.contain('hello jeff')
})
.it('runs hello --name jeff', ctx => {
expect(ctx.stdout).to.contain('hello jeff')
})
})
8 changes: 4 additions & 4 deletions templates/test/hook.test.ts.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {expect, test} from '@oclif/test'

describe('hooks', () => {
test
.stdout()
.hook('init', {id: 'mycommand'})
.do(output => expect(output.stdout).to.contain('example hook running mycommand'))
.it('shows a message')
.stdout()
.hook('init', {id: 'mycommand'})
.do(output => expect(output.stdout).to.contain('example hook running mycommand'))
.it('shows a message')
})
Loading

0 comments on commit c2ae997

Please sign in to comment.