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

refactor: upgraded code to es6 standard #427

Merged
merged 14 commits into from May 2, 2020
57 changes: 2 additions & 55 deletions .eslintrc.json
Expand Up @@ -7,65 +7,12 @@
"jest": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
"extends": ["eslint:recommended", "standard", "plugin:prettier/recommended"],
"globals": {
"msCrypto": true
},
"parser": "babel-eslint",
"rules": {
"array-bracket-spacing": ["warn", "never"],
"arrow-body-style": ["warn", "as-needed"],
"arrow-spacing": "warn",
"brace-style": ["warn", "1tbs"],
"camelcase": "warn",
"comma-spacing": [
"warn",
{
"after": true
}
],
"dot-notation": "warn",
"eqeqeq": ["warn", "smart"],
"indent": [
"warn",
2,
{
"SwitchCase": 1,
"FunctionDeclaration": {
"parameters": 1
},
"MemberExpression": 1,
"CallExpression": {
"arguments": 1
}
}
],
"key-spacing": [
"warn",
{
"beforeColon": false,
"afterColon": true,
"mode": "minimum"
}
],
"keyword-spacing": "warn",
"no-console": "off",
"no-empty": "off",
"no-multi-spaces": "warn",
"no-redeclare": "off",
"no-restricted-globals": ["warn", "Promise"],
"no-trailing-spaces": "warn",
"no-undef": "error",
"no-unused-vars": [
"warn",
{
"args": "none"
}
],
"one-var": ["warn", "never"],
"padded-blocks": ["warn", "never"],
"react/prop-types": "off",
"react/jsx-no-bind": "off",
"semi": ["warn", "always"]
"no-var": ["error"]
}
}
2 changes: 1 addition & 1 deletion README_js.md
Expand Up @@ -5,7 +5,7 @@ runmd.onRequire = (path) => {
};

// Shim Date and crypto so generated ids are consistent across doc revisions
runmd.Date.prototype.getTime = () => 1551914748172;
runmd.Date.now = () => 1551914748172;

let seed = 0xdefaced;
require('crypto').randomBytes = function () {
Expand Down
4 changes: 3 additions & 1 deletion examples/benchmark/benchmark.js
@@ -1,3 +1,4 @@
// eslint-disable-next-line no-unused-vars
/* global Benchmark:false, uuidv1:false, uuidv3:false, uuidv4:false, uuidv5:false */
const Benchmark = (typeof window !== 'undefined' && window.Benchmark) || require('benchmark');
const uuidv1 = (typeof window !== 'undefined' && window.uuidv1) || require('uuid').v1;
Expand All @@ -9,6 +10,7 @@ console.log('Starting. Tests take ~1 minute to run ...');

const array = new Array(16);
const suite = new Benchmark.Suite();

suite
.add('uuidv1()', function () {
uuidv1();
Expand All @@ -29,7 +31,7 @@ suite
uuidv5('hello.example.com', uuidv5.DNS);
})
.on('cycle', function (event) {
console.log(String(event.target));
console.log(event.target.toString());
})
.on('complete', function () {
console.log('Fastest is ' + this.filter('fastest').map('name'));
Expand Down