Browse Source

🚨 fix eslint issues

pull/3/head
Nicolas Beaussart 6 years ago
parent
commit
7b796a90ec
No known key found for this signature in database GPG Key ID: 51D5A407BFCE64A9
  1. 1
      .eslintignore
  2. 2
      src/commands/add/prettier.ts
  3. 31
      src/commands/hello/index.ts
  4. 2
      src/utls/base-command.ts

1
.eslintignore

@ -1 +1,2 @@
/lib
lib/

2
src/commands/add/prettier.ts

@ -3,7 +3,7 @@ import { BaseCommand } from '../../utls/base-command';
import { system, filesystem } from 'gluegun';
import * as prompts from 'prompts';
import * as fs from 'fs';
import { plugins, statusMatrix, add, commit } from 'isomorphic-git';
import { plugins, add, commit } from 'isomorphic-git';
import { BaseAddCommand } from '../../utls/base-add-command';
plugins.set('fs', fs);

31
src/commands/hello/index.ts

@ -1,31 +0,0 @@
import { Command, flags } from '@oclif/command';
export default class Index extends Command {
static description = 'describe the command here';
static examples = [
`$ nbx hello
hello world from ./src/hello.ts!
`,
];
static flags = {
help: flags.help({ char: 'h' }),
// flag with a value (-n, --name=VALUE)
name: flags.string({ char: 'n', description: 'name to print' }),
// flag with no value (-f, --force)
force: flags.boolean({ char: 'f' }),
};
static args = [{ name: 'file' }];
async run() {
const { args, flags } = this.parse(Index);
const name = flags.name || 'world';
this.log(`hello ${name} (${args.file}) from ./src/commands/hello.ts`);
if (args.file && flags.force) {
this.log(`you input --force and --file: ${args.file}`);
}
}
}

2
src/utls/base-command.ts

@ -27,7 +27,7 @@ export abstract class BaseCommand extends Command {
async init() {
// do some initialization
const { flags, args, argv } = this.parse(<Input<any>>this.constructor);
const { flags, args, argv } = this.parse(this.constructor as Input<any>);
this.flags = flags;
if (flags.verbose) {

Loading…
Cancel
Save