Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint command usage by husky and required files #189

Merged
merged 1 commit into from
Sep 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 9 additions & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ prog
peerDependencies: template === 'react' ? { react: '>=16' } : {},
husky: {
hooks: {
'pre-commit': 'pretty-quick --staged',
agilgur5 marked this conversation as resolved.
Show resolved Hide resolved
'pre-commit': 'tsdx lint',
},
},
prettier: {
Expand All @@ -273,15 +273,7 @@ prog
process.exit(1);
}

let deps = [
'@types/jest',
'husky',
'pretty-quick',
'prettier',
'tsdx',
'tslib',
'typescript',
].sort();
let deps = ['@types/jest', 'husky', 'tsdx', 'tslib', 'typescript'].sort();

if (template === 'react') {
deps = [
Expand Down Expand Up @@ -493,14 +485,20 @@ prog
.option('--ignore-pattern', 'Ignore a pattern')
.example('lint src test --ignore-pattern test/foobar.ts')
.option('--write-file', 'Write the config file locally')
.example('lint src test --write-file')
.example('lint --write-file')
.action(
async (opts: {
fix: boolean;
'ignore-pattern': string;
'write-file': boolean;
_: string[];
}) => {
if (opts['_'].length === 0) {
prog.help('lint');
console.log(chalk.red('No input files specified.'));
process.exit(1);
}

const cli = new CLIEngine({
baseConfig: {
...createEslintConfig({
Expand Down