From 4ef5c1d1f89d29a3e947e84571e634bf022f7be5 Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Thu, 13 Oct 2022 09:18:51 -0400 Subject: [PATCH] fix: Node 14.17 support --- .eslintrc.js | 1 + lib/index.js | 4 ++-- lib/rules/require-meta-docs-url.js | 2 +- tests/lib/rule-setup.js | 4 ++-- tests/lib/utils.js | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 0e28dd56..4ff2ad29 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -33,6 +33,7 @@ module.exports = { 'unicorn/no-array-reduce': 'off', 'unicorn/no-null': 'off', 'unicorn/prefer-module': 'off', + 'unicorn/prefer-node-protocol': 'off', // TODO: enable once we drop support for Node 14.17. 'unicorn/prevent-abbreviations': 'off', }, overrides: [ diff --git a/lib/index.js b/lib/index.js index 6f74218b..baab06b4 100644 --- a/lib/index.js +++ b/lib/index.js @@ -9,8 +9,8 @@ // Requirements // ------------------------------------------------------------------------------ -const fs = require('node:fs'); -const path = require('node:path'); +const fs = require('fs'); +const path = require('path'); const packageMetadata = require('../package'); const PLUGIN_NAME = packageMetadata.name.replace(/^eslint-plugin-/, ''); diff --git a/lib/rules/require-meta-docs-url.js b/lib/rules/require-meta-docs-url.js index 11115013..4ef85063 100644 --- a/lib/rules/require-meta-docs-url.js +++ b/lib/rules/require-meta-docs-url.js @@ -8,7 +8,7 @@ // Requirements // ----------------------------------------------------------------------------- -const path = require('node:path'); +const path = require('path'); const util = require('../utils'); const { getStaticValue } = require('eslint-utils'); diff --git a/tests/lib/rule-setup.js b/tests/lib/rule-setup.js index 1e8a4e68..f1486cae 100644 --- a/tests/lib/rule-setup.js +++ b/tests/lib/rule-setup.js @@ -1,7 +1,7 @@ 'use strict'; -const { readdirSync, readFileSync } = require('node:fs'); -const path = require('node:path'); +const { readdirSync, readFileSync } = require('fs'); +const path = require('path'); const assert = require('chai').assert; const plugin = require('../..'); diff --git a/tests/lib/utils.js b/tests/lib/utils.js index 5b7afd54..ebebacca 100644 --- a/tests/lib/utils.js +++ b/tests/lib/utils.js @@ -1,6 +1,6 @@ 'use strict'; -const { inspect } = require('node:util'); +const { inspect } = require('util'); const lodash = require('lodash'); const espree = require('espree'); const eslintScope = require('eslint-scope');