Skip to content

Commit

Permalink
Merge pull request #246 from mjeanroy/greenkeeper/eslint-config-googl…
Browse files Browse the repository at this point in the history
…e-0.10.0

Update eslint-config-google to the latest version 🚀
  • Loading branch information
mjeanroy committed Sep 10, 2018
2 parents 83599d7 + f469589 commit 9cbb540
Show file tree
Hide file tree
Showing 10 changed files with 269 additions and 269 deletions.
32 changes: 16 additions & 16 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ gulp.task('clean', () => {

gulp.task('build', ['clean', 'lint'], () => {
return gulp.src(path.join(SRC, '*.js'))
.pipe(babel())
.pipe(gulp.dest(DIST));
.pipe(babel())
.pipe(gulp.dest(DIST));
});

gulp.task('lint', () => {
Expand All @@ -66,31 +66,31 @@ gulp.task('lint', () => {
];

return gulp.src(src)
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});

gulp.task('changelog', () => {
const changelog = path.join(ROOT, 'CHANGELOG.md');
return gulp.src(changelog, {buffer: false})
.pipe(conventionalChangelog({
releaseCount: 0,
}))
.pipe(gulp.dest(ROOT));
.pipe(conventionalChangelog({
releaseCount: 0,
}))
.pipe(gulp.dest(ROOT));
});

gulp.task('commit:pre', () => {
const packageJson = path.join(ROOT, 'package.json');
return gulp.src([packageJson, DIST])
.pipe(git.add({args: '-f'}))
.pipe(git.commit('release: release version'));
.pipe(git.add({args: '-f'}))
.pipe(git.commit('release: release version'));
});

gulp.task('commit:post', () => {
return gulp.src(DIST)
.pipe(git.rm({args: '-r'}))
.pipe(git.commit('release: prepare next release'));
.pipe(git.rm({args: '-r'}))
.pipe(git.commit('release: prepare next release'));
});

gulp.task('tag', (done) => {
Expand All @@ -102,9 +102,9 @@ gulp.task('tag', (done) => {
['major', 'minor', 'patch'].forEach((level) => {
gulp.task(`bump:${level}`, () => {
return gulp.src(path.join(ROOT, 'package.json'))
.pipe(bump({type: level}))
.on('error', (e) => log.error(e))
.pipe(gulp.dest(ROOT));
.pipe(bump({type: level}))
.on('error', (e) => log.error(e))
.pipe(gulp.dest(ROOT));
});

gulp.task('release:' + level, ['build'], () => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@babel/preset-env": "7.0.0",
"del": "3.0.0",
"eslint": "5.5.0",
"eslint-config-google": "0.9.1",
"eslint-config-google": "0.10.0",
"fancy-log": "1.3.2",
"gulp": "3.9.1",
"gulp-babel": "8.0.0",
Expand Down
12 changes: 6 additions & 6 deletions src/dependency.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ class Dependency {
// Map it to a valid license field.
// See: https://docs.npmjs.com/files/package.json#license
dependency.license = `(${_.chain(dependency.licenses)
.map((license) => license.type || license)
.join(' OR ')
.value()})`;
.map((license) => license.type || license)
.join(' OR ')
.value()})`;

// Remove it.
delete dependency.licenses;
Expand Down Expand Up @@ -124,9 +124,9 @@ class Dependency {
lines.push(`${prefix}Contributors:${suffix}`);

const allContributors = _.chain(this.contributors)
.map((contributor) => contributor.text())
.map((line) => `${prefix} ${line}${suffix}`)
.value();
.map((contributor) => contributor.text())
.map((line) => `${prefix} ${line}${suffix}`)
.value();

lines.push(...allContributors);
}
Expand Down
12 changes: 6 additions & 6 deletions src/license-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,12 @@ class LicensePlugin {

const includePrivate = thirdParty.includePrivate;
const text = _.chain(this._dependencies)
.values()
.filter((dependency) => includePrivate || !dependency.private)
.map((dependency) => dependency.text())
.join(`${EOL}${EOL}---${EOL}${EOL}`)
.trim()
.value();
.values()
.filter((dependency) => includePrivate || !dependency.private)
.map((dependency) => dependency.text())
.join(`${EOL}${EOL}---${EOL}${EOL}`)
.trim()
.value();

const encoding = thirdParty.encoding || 'utf-8';
this.debug(`use encoding: ${encoding}`);
Expand Down
52 changes: 26 additions & 26 deletions test/base.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,34 @@ const Dependency = require('../dist/dependency.js');
const Person = require('../dist/person.js');

beforeEach(() => {
jasmine.addCustomEqualityTester((first, second) => {
if ((first instanceof Person) || (second instanceof Person)) {
const o1 = _.toPlainObject(first);
const o2 = _.toPlainObject(second);
return _.isEqual(o1, o2);
}
});

jasmine.addCustomEqualityTester((first, second) => {
if ((first instanceof Dependency) || (second instanceof Dependency)) {
const o1 = _.toPlainObject(first);
const o2 = _.toPlainObject(second);
jasmine.addCustomEqualityTester((first, second) => {
if ((first instanceof Person) || (second instanceof Person)) {
const o1 = _.toPlainObject(first);
const o2 = _.toPlainObject(second);
return _.isEqual(o1, o2);
}
});

if (o1.author) {
o1.author = _.toPlainObject(o1.author);
}
if (o1.contributors) {
o1.contributors = _.map(o1.contributors, _.toPlainObject);
}
jasmine.addCustomEqualityTester((first, second) => {
if ((first instanceof Dependency) || (second instanceof Dependency)) {
const o1 = _.toPlainObject(first);
const o2 = _.toPlainObject(second);

if (o2.author) {
o2.author = _.toPlainObject(o2.author);
}
if (o2.contributors) {
o2.contributors = _.map(o2.contributors, _.toPlainObject);
}
if (o1.author) {
o1.author = _.toPlainObject(o1.author);
}
if (o1.contributors) {
o1.contributors = _.map(o1.contributors, _.toPlainObject);
}

return _.isEqual(o1, o2);
if (o2.author) {
o2.author = _.toPlainObject(o2.author);
}
if (o2.contributors) {
o2.contributors = _.map(o2.contributors, _.toPlainObject);
}
});

return _.isEqual(o1, o2);
}
});
});
106 changes: 53 additions & 53 deletions test/dependency.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ describe('Dependency', () => {
const dependency = new Dependency(pkg);

expect(dependency.text()).toEqual(
`Name: ${pkg.name}\n` +
`Version: ${pkg.version}\n` +
`License: ${pkg.license}\n` +
`Private: false`
`Name: ${pkg.name}\n` +
`Version: ${pkg.version}\n` +
`License: ${pkg.license}\n` +
`Private: false`
);
});

Expand All @@ -144,11 +144,11 @@ describe('Dependency', () => {
const dependency = new Dependency(pkg);

expect(dependency.text()).toEqual(
`Name: ${pkg.name}\n` +
`Version: ${pkg.version}\n` +
`License: ${pkg.license}\n` +
`Private: false\n` +
`Description: ${pkg.description}`
`Name: ${pkg.name}\n` +
`Version: ${pkg.version}\n` +
`License: ${pkg.license}\n` +
`Private: false\n` +
`Description: ${pkg.description}`
);
});

Expand All @@ -166,11 +166,11 @@ describe('Dependency', () => {
const dependency = new Dependency(pkg);

expect(dependency.text()).toEqual(
`Name: ${pkg.name}\n` +
`Version: ${pkg.version}\n` +
`License: ${pkg.license}\n` +
`Private: false\n` +
`Author: ${pkg.author.name} <${pkg.author.email}>`
`Name: ${pkg.name}\n` +
`Version: ${pkg.version}\n` +
`License: ${pkg.license}\n` +
`Private: false\n` +
`Author: ${pkg.author.name} <${pkg.author.email}>`
);
});

Expand All @@ -188,11 +188,11 @@ describe('Dependency', () => {
const dependency = new Dependency(pkg);

expect(dependency.text()).toEqual(
`Name: ${pkg.name}\n` +
`Version: ${pkg.version}\n` +
`License: ${pkg.license}\n` +
`Private: false\n` +
`Repository: ${pkg.repository.url}`
`Name: ${pkg.name}\n` +
`Version: ${pkg.version}\n` +
`License: ${pkg.license}\n` +
`Private: false\n` +
`Repository: ${pkg.repository.url}`
);
});

Expand All @@ -207,11 +207,11 @@ describe('Dependency', () => {
const dependency = new Dependency(pkg);

expect(dependency.text()).toEqual(
`Name: ${pkg.name}\n` +
`Version: ${pkg.version}\n` +
`License: ${pkg.license}\n` +
`Private: false\n` +
`Homepage: ${pkg.homepage}`
`Name: ${pkg.name}\n` +
`Version: ${pkg.version}\n` +
`License: ${pkg.license}\n` +
`Private: false\n` +
`Homepage: ${pkg.homepage}`
);
});

Expand All @@ -229,13 +229,13 @@ describe('Dependency', () => {
const dependency = new Dependency(pkg);

expect(dependency.text()).toEqual(
`Name: ${pkg.name}\n` +
`Version: ${pkg.version}\n` +
`License: ${pkg.license}\n` +
`Private: false\n` +
`Contributors:\n` +
` ${pkg.contributors[0].name} <${pkg.contributors[0].email}>\n` +
` ${pkg.contributors[1].name}`
`Name: ${pkg.name}\n` +
`Version: ${pkg.version}\n` +
`License: ${pkg.license}\n` +
`Private: false\n` +
`Contributors:\n` +
` ${pkg.contributors[0].name} <${pkg.contributors[0].email}>\n` +
` ${pkg.contributors[1].name}`
);
});

Expand All @@ -257,17 +257,17 @@ describe('Dependency', () => {
const dependency = new Dependency(pkg);

expect(dependency.text()).toEqual(
`Name: ${pkg.name}\n` +
`Version: ${pkg.version}\n` +
`License: ${pkg.license}\n` +
`Private: false\n` +
`Description: ${pkg.description}\n` +
`Repository: ${pkg.repository.url}\n` +
`Homepage: ${pkg.homepage}\n` +
`Author: ${pkg.author.name} <${pkg.author.email}>\n` +
`Contributors:\n` +
` ${pkg.contributors[0].name} <${pkg.contributors[0].email}>\n` +
` ${pkg.contributors[1].name}`
`Name: ${pkg.name}\n` +
`Version: ${pkg.version}\n` +
`License: ${pkg.license}\n` +
`Private: false\n` +
`Description: ${pkg.description}\n` +
`Repository: ${pkg.repository.url}\n` +
`Homepage: ${pkg.homepage}\n` +
`Author: ${pkg.author.name} <${pkg.author.email}>\n` +
`Contributors:\n` +
` ${pkg.contributors[0].name} <${pkg.contributors[0].email}>\n` +
` ${pkg.contributors[1].name}`
);
});

Expand All @@ -289,17 +289,17 @@ describe('Dependency', () => {
const dependency = new Dependency(pkg);

expect(dependency.text(' * ', ' --')).toEqual(
` * Name: ${pkg.name} --\n` +
` * Version: ${pkg.version} --\n` +
` * License: ${pkg.license} --\n` +
` * Private: false --\n` +
` * Description: ${pkg.description} --\n` +
` * Repository: ${pkg.repository.url} --\n` +
` * Homepage: ${pkg.homepage} --\n` +
` * Author: ${pkg.author.name} <${pkg.author.email}> --\n` +
` * Contributors: --\n` +
` * ${pkg.contributors[0].name} <${pkg.contributors[0].email}> --\n` +
` * ${pkg.contributors[1].name} --`
` * Name: ${pkg.name} --\n` +
` * Version: ${pkg.version} --\n` +
` * License: ${pkg.license} --\n` +
` * Private: false --\n` +
` * Description: ${pkg.description} --\n` +
` * Repository: ${pkg.repository.url} --\n` +
` * Homepage: ${pkg.homepage} --\n` +
` * Author: ${pkg.author.name} <${pkg.author.email}> --\n` +
` * Contributors: --\n` +
` * ${pkg.contributors[0].name} <${pkg.contributors[0].email}> --\n` +
` * ${pkg.contributors[1].name} --`
);
});
});
10 changes: 5 additions & 5 deletions test/generate-block-comment.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ describe('generateBlockComment', () => {
const comment = generateBlockComment(text);

expect(comment).toEqual(
`/**\n` +
` * First Line\n` +
` *\n` +
` * Second Line\n` +
` */\n`
`/**\n` +
` * First Line\n` +
` *\n` +
` * Second Line\n` +
` */\n`
);
});
});
Loading

0 comments on commit 9cbb540

Please sign in to comment.