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

fix lint warnings #5263

Merged
merged 3 commits into from
Aug 20, 2020
Merged

Conversation

antony
Copy link
Member

@antony antony commented Aug 12, 2020

To be merged after sveltejs/eslint-config#4 is merged and the config tagged.

This leaves only one lint warning, which is a bit of a complex fix and will need to be debated - the fact that we mutate the node assert builtin, in tests for Svelte. I've mostly fixed this locally, but there are still test failures, so this covers the low hanging fruit and cleans up all the other rules, with a view to fixing that one later.

  • This message body should clearly illustrate what problems it solves. If there are related issues, remember to reference them.
  • Ideally, include a test that fails without this PR but passes with it. PRs will only be merged once they pass CI. (Remember to npm run lint!)

Todo:

  • Get svelte-eslint merged and tagged
  • Update dependency in package.json to point to new tag

@antony antony requested a review from benmccann August 12, 2020 22:24
@antony antony requested a review from Conduitry August 12, 2020 23:41
Copy link
Member

@Conduitry Conduitry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vote we use a comment to disable the last warning for now (// eslint-disable-line no-import-assign). The ESM in the file may be invalid, but the CommonJS that we know it's getting compiled to is fine. We can revisit a cleaner solution to this later, but I think it would be good to officially get rid of all warnings at once.

@antony
Copy link
Member Author

antony commented Aug 13, 2020

I vote we use a comment to disable the last warning for now (// eslint-disable-line no-import-assign). The ESM in the file may be invalid, but the CommonJS that we know it's getting compiled to is fine. We can revisit a cleaner solution to this later, but I think it would be good to officially get rid of all warnings at once.

I had this exact conversation with @benmccann - It's up to you, but my personal preference is to leave it there. Mutating a node built-in isn't great at all, and is the exact sort of thing linting exists to prevent. If we mute it, it'll become forgotten and just be another exclusion to the linting rules. It's something I'd probably want to be constantly (gently) reminded of until it's fixed.

@benmccann
Copy link
Member

I'd be fine with just disabling the warning. I took a look at fixing it and I'm not sure it'd be very high ROI. There's nearly 700 places the function is used. It didn't look like VS Code's refactoring would work on it either - though I'm new to VS Code, so maybe don't have my project setup correctly or something. But without an automated way of changing it, I don't think it's worth our time. And if we're not realistically going to fix it, then the warning just becomes an annoyance

@antony
Copy link
Member Author

antony commented Aug 19, 2020

I'll concede that it's probably more effort to fix than it's worth, and at least it will hopefully prevent further issues.

I'll just ignore it for now and update this PR.

@antony antony changed the title fix all but one lint warning fix lint warnings Aug 19, 2020
@benmccann benmccann merged commit 82dc26a into sveltejs:master Aug 20, 2020
@antony antony deleted the feature/lint-warnings-to-errors branch August 20, 2020 15:58
taylorzane pushed a commit to taylorzane/svelte that referenced this pull request Dec 17, 2020
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.

None yet

3 participants