mirror of https://github.com/vuejs/core.git
chore: disallow console statement (#9986)
This commit is contained in:
parent
0ae651a5f0
commit
fda51925f4
|
@ -19,6 +19,7 @@ module.exports = {
|
||||||
plugins: ['jest', 'import', '@typescript-eslint'],
|
plugins: ['jest', 'import', '@typescript-eslint'],
|
||||||
rules: {
|
rules: {
|
||||||
'no-debugger': 'error',
|
'no-debugger': 'error',
|
||||||
|
'no-console': ['error', { allow: ['warn', 'error', 'info'] }],
|
||||||
// most of the codebase are expected to be env agnostic
|
// most of the codebase are expected to be env agnostic
|
||||||
'no-restricted-globals': ['error', ...DOMGlobals, ...NodeGlobals],
|
'no-restricted-globals': ['error', ...DOMGlobals, ...NodeGlobals],
|
||||||
|
|
||||||
|
@ -58,6 +59,7 @@ module.exports = {
|
||||||
{
|
{
|
||||||
files: ['**/__tests__/**', 'packages/dts-test/**'],
|
files: ['**/__tests__/**', 'packages/dts-test/**'],
|
||||||
rules: {
|
rules: {
|
||||||
|
'no-console': 'off',
|
||||||
'no-restricted-globals': 'off',
|
'no-restricted-globals': 'off',
|
||||||
'no-restricted-syntax': 'off',
|
'no-restricted-syntax': 'off',
|
||||||
'jest/no-disabled-tests': 'error',
|
'jest/no-disabled-tests': 'error',
|
||||||
|
@ -92,6 +94,7 @@ module.exports = {
|
||||||
rules: {
|
rules: {
|
||||||
'no-restricted-globals': ['error', ...NodeGlobals],
|
'no-restricted-globals': ['error', ...NodeGlobals],
|
||||||
'no-restricted-syntax': ['error', banConstEnum],
|
'no-restricted-syntax': ['error', banConstEnum],
|
||||||
|
'no-console': 'off',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// JavaScript files
|
// JavaScript files
|
||||||
|
@ -113,6 +116,7 @@ module.exports = {
|
||||||
rules: {
|
rules: {
|
||||||
'no-restricted-globals': 'off',
|
'no-restricted-globals': 'off',
|
||||||
'no-restricted-syntax': ['error', banConstEnum],
|
'no-restricted-syntax': ['error', banConstEnum],
|
||||||
|
'no-console': 'off',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Import nodejs modules in compiler-sfc
|
// Import nodejs modules in compiler-sfc
|
||||||
|
|
|
@ -444,6 +444,7 @@ function createSuspenseBoundary(
|
||||||
if (__DEV__ && !__TEST__ && !hasWarned) {
|
if (__DEV__ && !__TEST__ && !hasWarned) {
|
||||||
hasWarned = true
|
hasWarned = true
|
||||||
// @ts-expect-error `console.info` cannot be null error
|
// @ts-expect-error `console.info` cannot be null error
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console[console.info ? 'info' : 'log'](
|
console[console.info ? 'info' : 'log'](
|
||||||
`<Suspense> is an experimental feature and its API will likely change.`,
|
`<Suspense> is an experimental feature and its API will likely change.`,
|
||||||
)
|
)
|
||||||
|
|
|
@ -206,6 +206,7 @@ export function pipeToWebWritable(
|
||||||
},
|
},
|
||||||
destroy(err) {
|
destroy(err) {
|
||||||
// TODO better error handling?
|
// TODO better error handling?
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console.log(err)
|
console.log(err)
|
||||||
writer.close()
|
writer.close()
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue