Skip to content
Permalink
Browse files

chore(lint-staged): add prettier to lint-staged

  • Loading branch information...
zaldih committed Jun 30, 2019
1 parent b8ba7db commit b24eb1cc5c37701570d57db58ddca815db4b29a0
Showing with 29 additions and 13 deletions.
  1. +6 −0 .prettierrc
  2. +1 −1 commitlint.config.js
  3. +11 −1 package.json
  4. +5 −5 src/controller.ts
  5. +1 −1 src/index.ts
  6. +5 −5 src/stuff.ts
@@ -0,0 +1,6 @@
{
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"singleQuote": true
}
@@ -1 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
module.exports = { extends: ["@commitlint/config-conventional"] };
@@ -18,7 +18,8 @@
],
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged"
}
},
"dependencies": {
@@ -43,7 +44,16 @@
"@types/node": "^12.0.0",
"husky": "^2.7.0",
"jest": "^24.8.0",
"lint-staged": "^8.2.1",
"pre-commit": "^1.2.2",
"prettier": "^1.18.2",
"ts-jest": "^24.0.2",
"ts-node": "^8.1.0"
},
"lint-staged": {
"*.{js,ts,css,json,md}": [
"prettier --write",
"git add"
]
}
}
@@ -9,7 +9,7 @@ import {
CURSOR_SIMBOL,
ROW_RESULTS_START,
TARGET_FOLDER,
UI_POSITIONS
UI_POSITIONS,
} from './constants/main.constants';
import { basename, dirname, normalize, resolve } from 'path';

@@ -70,14 +70,14 @@ export class Controller {
this.nodeFolders.push({
path: folder,
size: 0,
deleted: false
deleted: false,
});
this.setCursorAt([3, ROW_RESULTS_START + this.folderNewRow]);
this.print(folder);
// getFolderSize(folder, [90, ROW_RESULTS_START + i]);
this.drawFolderSize(folder, [
this.stdout.columns - 20,
ROW_RESULTS_START + this.folderNewRow
ROW_RESULTS_START + this.folderNewRow,
]);
this.folderNewRow++;
} else {
@@ -91,7 +91,7 @@ export class Controller {
delete: this.delete.bind(this),
execute: function(command: string, params: string[]) {
return this[command](params);
}
},
};

private setupKeysListener() {
@@ -107,7 +107,7 @@ export class Controller {
if (name == 'delete') {
this.KEYS.execute(name, {
nodeFolder: this.nodeFolders[this.cursorPosY - ROW_RESULTS_START],
position: [3, this.cursorPosY]
position: [3, this.cursorPosY],
});
} else {
this.KEYS.execute(name);
@@ -1,5 +1,5 @@
#!/usr/bin/env node

import { Controller } from "./controller";
import { Controller } from './controller';

const controller = new Controller();
@@ -18,15 +18,15 @@ function newResult(result) {
console.log(result);
}

const fg = require("fast-glob");
const fg = require('fast-glob');

const stream = fg.stream(["../**/[node_modules]/"], {
const stream = fg.stream(['../**/[node_modules]/'], {
onlyDirectories: true,
matchBase: true
matchBase: true,
});

stream.on("data", newResult);
stream.once("error", console.log);
stream.on('data', newResult);
stream.once('error', console.log);

/*---------------
const { lstatSync, readdirSync } = require("fs");

0 comments on commit b24eb1c

Please sign in to comment.
You can’t perform that action at this time.