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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make project eslint standardjs compatible #7

Merged
merged 10 commits into from
Dec 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cache:
directories:
- website/.lanyon
install: npm install # <-- yarn still messes up nested bins: https://github.com/yarnpkg/yarn/issues/760
script: npm run test
script: npm run lint && npm run test
before_cache:
- rm -f ./node_modules/.bin/which
before_deploy: node_modules/.bin/lanyon postinstall
Expand Down
13 changes: 8 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,27 @@ Here's is a combined todo/done list. You can see what todos are planned for the

## Ideas

- [ ] Add a logo for display up on http://transloadify.io
- [ ] Add a logo for display up on http://transloadify.io (@kvz)
- [ ] A way to register at Transloadit straight from the CLI
- [ ] Can we get this tested on appveyor so we can try to get Windows support?

## v0.2.2

Released: Not yet
Released: TBA.

[Diff](https://github.com/transloadit/transloadify/compare/v0.2.0...master).

- [ ] Add linting via eslint with standardjs.com (Fix codebase via `eslint --fix`, make violations fatal on Travis CI tests) (@kvz)
- [ ] Make tests running & passing on Travis
- [ ] Document the Template on-disk feature in the README.md (@adrusi)
- [ ] Fix remaining linting issues, then merge https://github.com/transloadit/transloadify/pull/7 (@adrusi)
- [x] Add linting via eslint with standardjs.com (Fix codebase via `eslint --fix`, make violations fatal on Travis CI tests) (@kvz)
- [x] Make tests running & passing on Travis (@adrusi)

## v0.2.1

Released: 2016-12-01.

[Diff](https://github.com/transloadit/transloadify/compare/v0.1.14...v0.1.0).

- [x] release management via npm scripts (Since Go was claiming up until `v0.1.14`, we start at `v0.2.1` - SemVer says you can break BC < 1)
- [x] release management via npm scripts (Since Go was claiming up until `v0.1.14`, we start at `v0.2.1` - SemVer says you can break BC < 1) (@kvz)
- [x] Add a simple website, based on README.md, CHANGELOG.md, FAQ.md (@kvz)
- [x] First Node.js based version of Transloadify (previously Go) (@adrusi)
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"eslintConfig": {
"extends": "standard",
"env": {
"node": true
"node": true,
"mocha": true
}
},
"author": "Adrian Sinclair <adrian@transloadit.com>",
Expand Down
58 changes: 29 additions & 29 deletions src/OutputCtl.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
export default class OutputCtl {
constructor({ logLevel, jsonMode }) {
this.json = jsonMode;
this.logLevel = logLevel;

process.stdout.on("error", err => {
if (err.code === "EPIPE") return process.exit(0);
});
process.stderr.on("error", err => {
if (err.code === "EPIPE") return process.exit(0);
});
}

error(msg) {
console.error("ERROR ", msg);
}
constructor ({ logLevel, jsonMode }) {
this.json = jsonMode
this.logLevel = logLevel

warn(msg) {
if (this.logLevel > 0) console.error("WARNING", msg);
}
process.stdout.on('error', err => {
if (err.code === 'EPIPE') return process.exit(0)
})
process.stderr.on('error', err => {
if (err.code === 'EPIPE') return process.exit(0)
})
}

info(msg) {
if (this.logLevel > 0) console.error("INFO ", msg);
}
error (msg) {
console.error('ERROR ', msg)
}

debug(msg) {
if (this.logLevel > 1) console.error("DEBUG ", msg);
}
warn (msg) {
if (this.logLevel > 0) console.error('WARNING', msg)
}

print(simple, json) {
if (this.json) console.log(JSON.stringify(json));
else if (typeof simple === "string") console.log(simple);
else console.dir(simple, { depth: null });
}
info (msg) {
if (this.logLevel > 0) console.error('INFO ', msg)
}

debug (msg) {
if (this.logLevel > 1) console.error('DEBUG ', msg)
}

print (simple, json) {
if (this.json) console.log(JSON.stringify(json))
else if (typeof simple === 'string') console.log(simple)
else console.dir(simple, { depth: null })
}
}
Loading