]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: disallow console statement (#9986)
author三咲智子 Kevin Deng <sxzz@sxzz.moe>
Thu, 4 Jan 2024 07:54:48 +0000 (15:54 +0800)
committerGitHub <noreply@github.com>
Thu, 4 Jan 2024 07:54:48 +0000 (15:54 +0800)
.eslintrc.cjs
packages/runtime-core/src/components/Suspense.ts
packages/server-renderer/src/renderToStream.ts

index b8afcf9843f7bbe4b79134c0d253bc42ba901d8e..65653f40da2d7bb110d03992b94a39560db18bcf 100644 (file)
@@ -19,6 +19,7 @@ module.exports = {
   plugins: ['jest', 'import', '@typescript-eslint'],
   rules: {
     'no-debugger': 'error',
+    'no-console': ['error', { allow: ['warn', 'error', 'info'] }],
     // most of the codebase are expected to be env agnostic
     'no-restricted-globals': ['error', ...DOMGlobals, ...NodeGlobals],
 
@@ -58,6 +59,7 @@ module.exports = {
     {
       files: ['**/__tests__/**', 'packages/dts-test/**'],
       rules: {
+        'no-console': 'off',
         'no-restricted-globals': 'off',
         'no-restricted-syntax': 'off',
         'jest/no-disabled-tests': 'error',
@@ -92,6 +94,7 @@ module.exports = {
       rules: {
         'no-restricted-globals': ['error', ...NodeGlobals],
         'no-restricted-syntax': ['error', banConstEnum],
+        'no-console': 'off',
       },
     },
     // JavaScript files
@@ -113,6 +116,7 @@ module.exports = {
       rules: {
         'no-restricted-globals': 'off',
         'no-restricted-syntax': ['error', banConstEnum],
+        'no-console': 'off',
       },
     },
     // Import nodejs modules in compiler-sfc
index 01aeb6188b28935b71dbfbf3bae3b2052c5658d7..8fbb07de9a122cfcd17c95e7eff3bb978d34e87b 100644 (file)
@@ -444,6 +444,7 @@ function createSuspenseBoundary(
   if (__DEV__ && !__TEST__ && !hasWarned) {
     hasWarned = true
     // @ts-expect-error `console.info` cannot be null error
+    // eslint-disable-next-line no-console
     console[console.info ? 'info' : 'log'](
       `<Suspense> is an experimental feature and its API will likely change.`,
     )
index c807b4a22362eefffc1277d1c67ceb5ef7dfc6b0..828e385cb90031a7fcfb3daf99ebef2fb05e038f 100644 (file)
@@ -206,6 +206,7 @@ export function pipeToWebWritable(
     },
     destroy(err) {
       // TODO better error handling?
+      // eslint-disable-next-line no-console
       console.log(err)
       writer.close()
     },