From 447d3269971abad7e713209a6f817ad2139661d3 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sat, 4 Mar 2023 15:23:51 +0100 Subject: [PATCH] feat: enable `prefer-node-protocol` --- fixtures/vitesse/vite.config.ts | 2 +- packages/basic/index.js | 2 ++ packages/typescript/index.js | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fixtures/vitesse/vite.config.ts b/fixtures/vitesse/vite.config.ts index 1097f32..8355807 100644 --- a/fixtures/vitesse/vite.config.ts +++ b/fixtures/vitesse/vite.config.ts @@ -1,4 +1,4 @@ -import path from 'path' +import path from 'node:path' import { defineConfig } from 'vite' import Vue from '@vitejs/plugin-vue' import Pages from 'vite-plugin-pages' diff --git a/packages/basic/index.js b/packages/basic/index.js index e303bb5..55abb98 100644 --- a/packages/basic/index.js +++ b/packages/basic/index.js @@ -337,6 +337,8 @@ module.exports = { 'unicorn/prefer-type-error': 'error', // Use new when throwing error 'unicorn/throw-new-error': 'error', + // Prefer using the node: protocol + 'unicorn/prefer-node-protocol': 'error', 'no-use-before-define': ['error', { functions: false, classes: false, variables: true }], 'eslint-comments/disable-enable-pair': 'off', diff --git a/packages/typescript/index.js b/packages/typescript/index.js index bef86ad..9393879 100644 --- a/packages/typescript/index.js +++ b/packages/typescript/index.js @@ -1,5 +1,5 @@ -const fs = require('fs') -const { join } = require('path') +const fs = require('node:fs') +const { join } = require('node:path') const basic = require('@antfu/eslint-config-basic') const tsconfig = process.env.ESLINT_TSCONFIG || 'tsconfig.eslint.json'