perf: remove console (log, debug, and warn) messages

This commit is contained in:
liyasthomas
2021-11-05 13:41:25 +05:30
parent 68aa54bdb7
commit a63c0817cc
5 changed files with 16 additions and 25 deletions

View File

@@ -19,32 +19,15 @@ module.exports = {
"plugin:nuxt/recommended",
],
ignorePatterns: ["helpers/backend/graphql.ts"],
plugins: ["vue", "prettier"],
plugins: ["vue", "nuxt", "prettier"],
// add your custom rules here
rules: {
semi: [2, "never"],
"import/named": "off", // because, named import issue with typescript see: https://github.com/typescript-eslint/typescript-eslint/issues/154
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
"vue/max-attributes-per-line": "off",
"vue/component-name-in-template-casing": ["error", "PascalCase"],
"vue/html-self-closing": [
"error",
{
html: {
normal: "never",
void: "always",
},
},
],
"vue/singleline-html-element-content-newline": "off",
"vue/multiline-html-element-content-newline": "off",
"vue/require-default-prop": "warn",
"vue/require-prop-types": "warn",
"vue/multi-word-component-names": "off",
"prettier/prettier": ["warn", { semi: false }],
"import/no-named-as-default": "off",
"import/prefer-default-export": "off",
"import/no-named-as-default-member": "off",
"import/default": "off",
"no-undef": "off",

View File

@@ -46,9 +46,9 @@ export default () => {
const outcome = await deferredPrompt.userChoice
if (outcome === "accepted") {
console.log("Hoppscotch was installed successfully.")
console.info("Hoppscotch was installed successfully.")
} else {
console.log(
console.info(
"Hoppscotch could not be installed. (Installation rejected by user.)"
)
}

View File

@@ -157,11 +157,11 @@ export default defineComponent({
},
async mounted() {
performMigrations()
console.log(
console.info(
"%cWe ❤︎ open source!",
"background-color:white;padding:8px 16px;border-radius:8px;font-size:32px;color:red;"
)
console.log(
console.info(
"%cContribute: https://github.com/hoppscotch/hoppscotch",
"background-color:black;padding:4px 8px;border-radius:8px;font-size:16px;color:white;"
)

View File

@@ -37,9 +37,9 @@ const dispatchers = defineDispatchers({
{ newIndex }: { newIndex: number }
) {
if (newIndex >= environments.length || newIndex <= -2) {
console.log(
`Ignoring possibly invalid current environment index assignment (value: ${newIndex})`
)
// console.log(
// `Ignoring possibly invalid current environment index assignment (value: ${newIndex})`
// )
return {}
}

View File

@@ -299,6 +299,14 @@ export default {
parallel: true,
cache: true,
// hardSource: true,
terser: {
terserOptions: {
// https://github.com/terser/terser#compress-options
compress: {
pure_funcs: ["console.log", "console.debug", "console.warn"],
},
},
},
},
// Generate configuration (https://nuxtjs.org/api/configuration-generate)