Skip to content

Commit 46eeb5b

Browse files
committed
style(lint): fix various linter errors
1 parent b82fcc9 commit 46eeb5b

File tree

4 files changed

+12
-18
lines changed

4 files changed

+12
-18
lines changed

bench/index.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const fixtures = {
1414
'undefined ': undefined,
1515
'function '() {},
1616

17-
'buffer ': new Buffer(1),
17+
'buffer ': Buffer.from(1),
1818
'date ': new Date(),
1919
'error ': new Error(),
2020
'map ': new Map(),
@@ -37,12 +37,9 @@ try {
3737
} catch (error) {
3838
console.error('cannot benchmark generator functions');
3939
}
40-
[
41-
'Float64Array', 'Float32Array',
42-
'Uint32Array', 'Uint16Array', 'Uint8Array',
43-
'Int32Array', 'Int16Array', 'Int8Array',
44-
'Uint8ClampedArray',
45-
].forEach((value) => {
40+
const arrayTypes = [ 'Float64', 'Float32', 'Uint32', 'Uint16', 'Uint8', 'Int32', 'Int16', 'Int8', 'Uint8Clamped' ];
41+
arrayTypes.forEach((value) => {
42+
value += 'Array';
4643
if (typeof global[value] === 'function') {
4744
fixtures[value + new Array(19 - value.length).join(' ')] = new (global[value])(1);
4845
}

karma.conf.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ let branch = 'local';
55
let job = Date.now();
66
let startConnect = false;
77
const reporters = [ 'progress', 'coverage' ];
8-
const tags = [
9-
`${ packageJson.name }@${ packageJson.version }`,
10-
];
8+
const tags = [ `${ packageJson.name }@${ packageJson.version }` ];
119
const frameworks = [ 'mocha' ];
1210

1311
/* eslint-disable no-process-env */

rollup.conf.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@ import transform from 'rollup-plugin-buble';
55
import nyc from 'nyc';
66
const Instrumenter = (new (new nyc)._instrumenterLib.istanbul).createInstrumenter; // eslint-disable-line
77
const env = process.env.NODE_ENV || 'test'; // eslint-disable-line no-process-env
8+
const plugins = [ common(), resolve(), transform() ];
9+
if (env === 'test') {
10+
plugins.unshift(coverage({ exclude: 'test/*.js', instrumenter: { Instrumenter } }));
11+
}
812
export default {
913
input: env === 'test' ? 'test/index.js' : 'index.js',
1014
output: {
1115
file: env === 'test' ? 'type-detect.test.js' : 'type-detect.js',
1216
name: 'typeDetect',
1317
format: 'iife',
1418
},
15-
plugins: [
16-
env === 'test' ? coverage({ exclude: 'test/*.js', instrumenter: { Instrumenter } }) : null,
17-
common(),
18-
resolve(),
19-
transform(),
20-
].filter(Boolean),
19+
plugins,
2120
};

test/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ describe('Generic', () => {
112112
describe('Stubbed ES2015 Types', () => {
113113
const originalObjectToString = Object.prototype.toString;
114114
function stubObjectToStringOnce(staticValue) {
115-
Object.prototype.toString = function () { // eslint-disable-line no-extend-native
116-
Object.prototype.toString = originalObjectToString; // eslint-disable-line no-extend-native
115+
Object.prototype.toString = function () { // eslint-disable-line no-extend-native
116+
Object.prototype.toString = originalObjectToString; // eslint-disable-line no-extend-native
117117
return staticValue;
118118
};
119119
}

0 commit comments

Comments
 (0)