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

setup is defined but never used #8

Open
QuentinRoy opened this issue Feb 17, 2021 · 0 comments
Open

setup is defined but never used #8

QuentinRoy opened this issue Feb 17, 2021 · 0 comments

Comments

@QuentinRoy
Copy link

QuentinRoy commented Feb 17, 2021

Usage of p5 is mostly incompatible with the no-unused-vars rules at the moment because all globally exported functions will trigger an error.

It is possible to partially solve this using the varsIgnorePattern option. For example, here is my configuration file:

module.exports = {
  extends: ["eslint:recommended", "p5js"],
  env: { browser: true },
  rules: {
    "no-unused-vars": [
      "error",
      { varsIgnorePattern: "setup|draw|preload|mousePressed|keyPressed" },
    ],
  },
};

Of course I am missing a lot of events, I just added the one I am currently using. Unfortunately, I am lacking time for a PR, but I thought it might be of interest and relatively easy to implement.

The tradeoff is that I believe any variables called setup is going to be ignored. I don't think it has to be global.

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

No branches or pull requests

1 participant