feat: enable prefer-node-protocol

This commit is contained in:
Anthony Fu 2023-03-04 15:23:51 +01:00
parent 6c0f76e229
commit 447d326997
3 changed files with 5 additions and 3 deletions

View File

@ -1,4 +1,4 @@
import path from 'path' import path from 'node:path'
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import Vue from '@vitejs/plugin-vue' import Vue from '@vitejs/plugin-vue'
import Pages from 'vite-plugin-pages' import Pages from 'vite-plugin-pages'

View File

@ -337,6 +337,8 @@ module.exports = {
'unicorn/prefer-type-error': 'error', 'unicorn/prefer-type-error': 'error',
// Use new when throwing error // Use new when throwing error
'unicorn/throw-new-error': '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 }], 'no-use-before-define': ['error', { functions: false, classes: false, variables: true }],
'eslint-comments/disable-enable-pair': 'off', 'eslint-comments/disable-enable-pair': 'off',

View File

@ -1,5 +1,5 @@
const fs = require('fs') const fs = require('node:fs')
const { join } = require('path') const { join } = require('node:path')
const basic = require('@antfu/eslint-config-basic') const basic = require('@antfu/eslint-config-basic')
const tsconfig = process.env.ESLINT_TSCONFIG || 'tsconfig.eslint.json' const tsconfig = process.env.ESLINT_TSCONFIG || 'tsconfig.eslint.json'