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

Linting improvements #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

TimonVS
Copy link

@TimonVS TimonVS commented Apr 17, 2018

  • Warn for Prettier "errors" as to have eslint --fix fix formatting errors as well
  • Use JSON instead of Yaml to configure ESLint. Mainly because VS Code will give autocompletion for ESLint files that are authored in JSON:

image

I also think we should remove eslint-plugin-import because it'll display an error when importing sketch/* modules which will confuse users.

image

I tried configure eslint-plugin-import in a way that it will ignore sketch/*, but you can't ignore all sketch/* modules at once, you can only do the following:

{
  "settings": {
    "import/core-modules": ["sketch", "sketch/dom", ...]
  }
}

If you agree @mathieudutour I will remove eslint-plugin-import in this PR as well.

@mathieudutour
Copy link
Member

mathieudutour commented Apr 18, 2018

Warn for Prettier "errors" as to have eslint --fix fix formatting errors as well

Interesting. I personally prefer to show it at all to not be disturb while coding and just fix it on save/pre-commit. But I can be convinced otherwise. What's your workflow with eslint --fix?

Use JSON instead of Yaml to configure ESLint.

Happy to

If you agree @mathieudutour I will remove eslint-plugin-import in this PR as well.

I'd prefer to ignore the sketch modules. It's unlikely that they are going to change anyway and I really like this plugin 😄

Here is the list:

  • sketch
  • sketch/async
  • sketch/data-supplier
  • sketch/dom
  • sketch/settings
  • sketch/ui

@TimonVS
Copy link
Author

TimonVS commented Apr 18, 2018

Interesting. I personally prefer to show it at all to not be disturb while coding and just fix it on save/pre-commit. But I can be convinced otherwise. What's your workflow with eslint --fix?

I've configured VS Code to run auto fix on save (eslint.autoFixOnSave). I do agree with you that formatting errors can be a bit noisy. But ESLint can't auto fix a rule that doesn't emit a warning or an error :/. On the other hand, I wouldn't want users to have to download two plugins for their editor (ESLint and Prettier).

I'd prefer to ignore the sketch modules. It's unlikely that they are going to change anyway and I really like this plugin 😄

Sure :)

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 this pull request may close these issues.

2 participants