Skip to content

Commit

Permalink
chore: fix linting issues
Browse files Browse the repository at this point in the history
Adapt codebase to use rules `arrow-parens` and `prefer-object-spread`.
  • Loading branch information
macedigital committed Sep 7, 2019
1 parent b3dda39 commit e18e58b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const updateDOM = (file, config) => {
return file;
};

const transformFactory = config => function transform(file, encoding, callback) {
const transformFactory = (config) => function transform(file, encoding, callback) {
if (file.isBuffer()) {
return callback(null, updateDOM(file, config));
}
Expand All @@ -110,13 +110,13 @@ const transformFactory = config => function transform(file, encoding, callback)
};

const configure = (options = {}) => {
const config = Object.assign({}, {
const config = {
algo: options.algo || DEFAULT_ALGO,
prefix: options.prefix || '',
selector: options.selector || DEFAULT_SELECTOR,
relative: !!options.relative || false,
cacheParser: !!options.cacheParser || false,
});
};

if (!supportedAlgos.has(config.algo)) {
throw new PluginError(PLUGIN_NAME, 'Hashing algorithm is unsupported');
Expand Down
8 changes: 4 additions & 4 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const nestedChecksums = require('./fixtures/nested/checksum.json');

const plugin = require('../');

const fixtures = glob => path.join(__dirname, 'fixtures', glob);
const fixtures = (glob) => path.join(__dirname, 'fixtures', glob);

const assertCount = (buffer, selector, num) => {
const $ = cheerio.load(buffer);
Expand All @@ -26,19 +26,19 @@ describe('gulp-sri-hash', () => {
});

describe('plugin()', () => {
it('should pass through singular null files', done => gulp.src(fixtures('doesnotexist'), { allowEmpty: true })
it('should pass through singular null files', (done) => gulp.src(fixtures('doesnotexist'), { allowEmpty: true })
.pipe(streamAssert.length(0))
.pipe(plugin())
.pipe(streamAssert.length(0))
.pipe(streamAssert.end(done)));

it('should pass through glob of null files', done => gulp.src(fixtures('does/not/exists/**/*'), { allowEmpty: false })
it('should pass through glob of null files', (done) => gulp.src(fixtures('does/not/exists/**/*'), { allowEmpty: false })
.pipe(streamAssert.length(0))
.pipe(plugin())
.pipe(streamAssert.length(0))
.pipe(streamAssert.end(done)));

it('should throw on streams', done => gulp.src(fixtures('flat/*.html'), { buffer: false })
it('should throw on streams', (done) => gulp.src(fixtures('flat/*.html'), { buffer: false })
.pipe(streamAssert.length(3))
.pipe(plugin())
.on('error', (err) => {
Expand Down

0 comments on commit e18e58b

Please sign in to comment.