From 1227c213c44bd4a6b1a6f4b3eb17f27a7c0dd920 Mon Sep 17 00:00:00 2001 From: Mathias Schreck Date: Mon, 11 Apr 2022 15:30:31 +0200 Subject: [PATCH] Fix ESLint errors --- .eslintrc.json | 19 ++++++++++++------- benchmarks/measure.js | 6 +++--- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 333cb76..4560cc8 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,6 +1,4 @@ { - "extends": [ "plugin:eslint-plugin/recommended" ], - "plugins": [ "eslint-plugin", "node", @@ -291,14 +289,21 @@ "lines-between-class-members": [ "error", "always"], "node/no-unsupported-features": "error", - "unicorn/prefer-includes": "error", - "eslint-plugin/require-meta-docs-url": [ - "error", - { "pattern": "https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/docs/rules/{{name}}.md" } - ] + "unicorn/prefer-includes": "error" }, "overrides": [ + { + + "files": ["lib/rules/**/*.js", "test/rules/**/*.js"], + "extends": [ "plugin:eslint-plugin/recommended" ], + "rules": { + "eslint-plugin/require-meta-docs-url": [ + "error", + { "pattern": "https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/docs/rules/{{name}}.md" } + ] + } + }, { "files": [ "test/**/*.js", "benchmarks/**/*.js"], "env": { "mocha": true }, diff --git a/benchmarks/measure.js b/benchmarks/measure.js index 5be8b23..d3717c4 100644 --- a/benchmarks/measure.js +++ b/benchmarks/measure.js @@ -1,7 +1,7 @@ 'use strict'; const os = require('os'); -const { performance } = require('perf_hooks'); +const { performance: performanceHooks } = require('perf_hooks'); const times = require('ramda/src/times'); const median = require('ramda/src/median'); const map = require('ramda/src/map'); @@ -30,10 +30,10 @@ function runBenchmark(fn, count) { const results = []; times(() => { - const startTime = performance.now(); + const startTime = performanceHooks.now(); const startMemory = process.memoryUsage().rss; fn(); - const endTime = performance.now(); + const endTime = performanceHooks.now(); const endMemory = process.memoryUsage().rss; const duration = endTime - startTime; const memory = endMemory - startMemory;