perf: remove console (log, debug, and warn) messages
This commit is contained in:
@@ -19,32 +19,15 @@ module.exports = {
|
|||||||
"plugin:nuxt/recommended",
|
"plugin:nuxt/recommended",
|
||||||
],
|
],
|
||||||
ignorePatterns: ["helpers/backend/graphql.ts"],
|
ignorePatterns: ["helpers/backend/graphql.ts"],
|
||||||
plugins: ["vue", "prettier"],
|
plugins: ["vue", "nuxt", "prettier"],
|
||||||
// add your custom rules here
|
// add your custom rules here
|
||||||
rules: {
|
rules: {
|
||||||
semi: [2, "never"],
|
semi: [2, "never"],
|
||||||
"import/named": "off", // because, named import issue with typescript see: https://github.com/typescript-eslint/typescript-eslint/issues/154
|
"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-console": process.env.NODE_ENV === "production" ? "error" : "off",
|
||||||
"no-debugger": 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",
|
"vue/multi-word-component-names": "off",
|
||||||
"prettier/prettier": ["warn", { semi: false }],
|
|
||||||
"import/no-named-as-default": "off",
|
"import/no-named-as-default": "off",
|
||||||
"import/prefer-default-export": "off",
|
|
||||||
"import/no-named-as-default-member": "off",
|
"import/no-named-as-default-member": "off",
|
||||||
"import/default": "off",
|
"import/default": "off",
|
||||||
"no-undef": "off",
|
"no-undef": "off",
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ export default () => {
|
|||||||
const outcome = await deferredPrompt.userChoice
|
const outcome = await deferredPrompt.userChoice
|
||||||
|
|
||||||
if (outcome === "accepted") {
|
if (outcome === "accepted") {
|
||||||
console.log("Hoppscotch was installed successfully.")
|
console.info("Hoppscotch was installed successfully.")
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.info(
|
||||||
"Hoppscotch could not be installed. (Installation rejected by user.)"
|
"Hoppscotch could not be installed. (Installation rejected by user.)"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,11 +157,11 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
performMigrations()
|
performMigrations()
|
||||||
console.log(
|
console.info(
|
||||||
"%cWe ❤︎ open source!",
|
"%cWe ❤︎ open source!",
|
||||||
"background-color:white;padding:8px 16px;border-radius:8px;font-size:32px;color:red;"
|
"background-color:white;padding:8px 16px;border-radius:8px;font-size:32px;color:red;"
|
||||||
)
|
)
|
||||||
console.log(
|
console.info(
|
||||||
"%cContribute: https://github.com/hoppscotch/hoppscotch",
|
"%cContribute: https://github.com/hoppscotch/hoppscotch",
|
||||||
"background-color:black;padding:4px 8px;border-radius:8px;font-size:16px;color:white;"
|
"background-color:black;padding:4px 8px;border-radius:8px;font-size:16px;color:white;"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ const dispatchers = defineDispatchers({
|
|||||||
{ newIndex }: { newIndex: number }
|
{ newIndex }: { newIndex: number }
|
||||||
) {
|
) {
|
||||||
if (newIndex >= environments.length || newIndex <= -2) {
|
if (newIndex >= environments.length || newIndex <= -2) {
|
||||||
console.log(
|
// console.log(
|
||||||
`Ignoring possibly invalid current environment index assignment (value: ${newIndex})`
|
// `Ignoring possibly invalid current environment index assignment (value: ${newIndex})`
|
||||||
)
|
// )
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -299,6 +299,14 @@ export default {
|
|||||||
parallel: true,
|
parallel: true,
|
||||||
cache: true,
|
cache: true,
|
||||||
// hardSource: 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)
|
// Generate configuration (https://nuxtjs.org/api/configuration-generate)
|
||||||
|
|||||||
Reference in New Issue
Block a user