Skip to content

Commit

Permalink
chore(deps): update dependency eslint-plugin-n to v17 (#16381)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
  • Loading branch information
renovate[bot] and sapphi-red authored Apr 15, 2024
1 parent a77707d commit 6cccef7
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 35 deletions.
33 changes: 20 additions & 13 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,8 @@ module.exports = defineConfig({
'n/no-extraneous-require': 'off',
'n/no-missing-import': 'off',
'n/no-missing-require': 'off',
// engine field doesn't exist in playgrounds
'n/no-unsupported-features/es-builtins': [
'error',
{
version: pkg.engines.node,
},
],
'n/no-unsupported-features/node-builtins': [
'error',
{
version: pkg.engines.node,
},
],
'n/no-unsupported-features/es-builtins': 'off',
'n/no-unsupported-features/node-builtins': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
},
Expand Down Expand Up @@ -216,6 +205,24 @@ module.exports = defineConfig({
'i/no-commonjs': 'error',
},
},
{
files: ['playground/**/__tests__/**'],
rules: {
// engine field doesn't exist in playgrounds
'n/no-unsupported-features/es-builtins': [
'error',
{
version: pkg.engines.node,
},
],
'n/no-unsupported-features/node-builtins': [
'error',
{
version: pkg.engines.node,
},
],
},
},
{
files: [
'playground/tsconfig-json/**',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"eslint": "^8.57.0",
"eslint-define-config": "^2.1.0",
"eslint-plugin-i": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-n": "^17.2.0",
"eslint-plugin-regexp": "^2.5.0",
"execa": "^8.0.1",
"feed": "^4.2.2",
Expand Down
1 change: 1 addition & 0 deletions packages/vite/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ warnCjsUsage()
module.exports.defineConfig = (config) => config

// proxy cjs utils (sync functions)
// eslint-disable-next-line n/no-missing-require -- will be generated by build
Object.assign(module.exports, require('./dist/node-cjs/publicUtils.cjs'))

// async functions, can be redirect from ESM build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ export { b } from './circular-b'

// since there is no .accept, it does full reload
import.meta.hot.on('vite:beforeFullReload', () => {
// eslint-disable-next-line no-console
console.log('full reload')
})
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { nonExisting } from '@vitejs/cjs-external'

// eslint-disable-next-line no-console
console.log(nonExisting)
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { nonExisting } from '@vitejs/esm-external'

// eslint-disable-next-line no-console
console.log(nonExisting)
1 change: 1 addition & 0 deletions packages/vite/src/node/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ function testCaseInsensitiveFS() {
}

export const urlCanParse =
// eslint-disable-next-line n/no-unsupported-features/node-builtins
URL.canParse ??
// URL.canParse is supported from Node.js 18.17.0+, 20.0.0+
((path: string, base?: string | undefined): boolean => {
Expand Down
2 changes: 2 additions & 0 deletions packages/vite/src/runtime/sourcemap/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export function enableSourceMapSupport(runtime: ViteRuntime): () => void {
`Cannot use "sourcemapInterceptor: 'node'" because global "process" variable is not available.`,
)
}
/* eslint-disable n/no-unsupported-features/node-builtins -- process.setSourceMapsEnabled and process.sourceMapsEnabled */
if (typeof process.setSourceMapsEnabled !== 'function') {
throw new TypeError(
`Cannot use "sourcemapInterceptor: 'node'" because "process.setSourceMapsEnabled" function is not available. Please use Node >= 16.6.0.`,
Expand All @@ -16,6 +17,7 @@ export function enableSourceMapSupport(runtime: ViteRuntime): () => void {
const isEnabledAlready = process.sourceMapsEnabled ?? false
process.setSourceMapsEnabled(true)
return () => !isEnabledAlready && process.setSourceMapsEnabled(false)
/* eslint-enable n/no-unsupported-features/node-builtins */
}
return interceptStackTrace(
runtime,
Expand Down
46 changes: 28 additions & 18 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6cccef7

Please sign in to comment.