Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no console.log warnings anymore #301

Closed
miteyema opened this issue Jul 27, 2019 · 6 comments · Fixed by nuxt/eslint#56
Closed

no console.log warnings anymore #301

miteyema opened this issue Jul 27, 2019 · 6 comments · Fixed by nuxt/eslint#56

Comments

@miteyema
Copy link

miteyema commented Jul 27, 2019

Hi

Kudos on the new v2.9.0.
I've used it to scaffold a new project using yarn create nuxt-app.
It have the following dependencies in package.json:

 "devDependencies": {
    "@nuxtjs/eslint-config": "^1.0.1",
    "@nuxtjs/eslint-module": "^0.2.1",
    "babel-eslint": "^10.0.1",
    "eslint": "^5.15.1",
    "eslint-plugin-nuxt": ">=0.4.2",
    "eslint-config-prettier": "^4.1.0",
    "eslint-plugin-prettier": "^3.0.1",
    "prettier": "^1.16.4",
    "husky": "^2.6.0",
    "lint-staged": "^8.2.1",
    "nodemon": "^1.18.9"
  }

When I write for example this:

<script>
export default {
  computed: {
    test() {
      console.log('test')
      return 'test'
    }
  }
}
</script>

I don't get any warnings of console.log in my code, not for yarn dev nor for yarn build.
When I used the previous yarn create nuxt-app to scaffold a new project, I did get those warnings for console.log.

Why this change? Or did I miss something?

@clarkdo
Copy link
Member

clarkdo commented Jul 27, 2019

I fount it comes from nuxt/eslint#2, this rule is only enabled in production now.

@miteyema
Copy link
Author

@clarkdo Thanks for the reply, that already solves the development part. But I don't get any warnings/errors when I am in production: e.g. running yarn build or yarn generate. Why is that?

@clarkdo
Copy link
Member

clarkdo commented Jul 27, 2019

I’ll discuss with team and provide a proper solution, for now I think should be prepending “NODE_ENV=production” in lint scripts link.

@clarkdo
Copy link
Member

clarkdo commented Jul 27, 2019

Or override it in eslintrc.js:

  // add your custom rules here
  rules: {
    'no-console': 'off'
  }

@clarkdo
Copy link
Member

clarkdo commented Jul 27, 2019

@miteyema I made a pr for making it warning level in development mode

@miteyema
Copy link
Author

@manniL Awesome, thank you so much for this fast response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants