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 caused by recent ESLint configuration update #5031

Closed
wants to merge 2 commits into from
Closed

fix lint warnings caused by recent ESLint configuration update #5031

wants to merge 2 commits into from

Conversation

jgravois
Copy link

resolves #5026

  • fix trailing comma and indentation warnings
  • turn off typescript-eslint indent rule (to workaround myriad issues)
  • add manual single line ignore (i think that is the right move πŸ€·πŸΌβ€β™‚οΈ anyway)

disclaimer: i know that code style is a perennially prickly topic and i am a complete outsider to this codebase so i assure you no offense will be taken if any of my choices here are called into question.

Checklist

  • It's really useful if your PR relates to an outstanding issue, so please reference it in your PR, or create an explanatory one for discussion. In many cases features are absent for a reason.
  • 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!)

Tests

  • Run the tests tests with npm test or yarn test)

* fix trailing comma and indentation warnings
* turn off typescript-eslint indent rule (to workaround myriad issues)
* add manual single line ignore (i _think_ that is the right move πŸ€·πŸΌβ€β™‚οΈ anyway)
.eslintrc.js Outdated
},
// workaround for https://github.com/typescript-eslint/typescript-eslint/issues/1824 and rely solely on 'indent' rule
rules: {
"@typescript-eslint/indent": "off"
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

sounds good. i've opened sveltejs/eslint-config#1 and removed the custom rule i proposed initially here in 52eee5e.

@@ -153,7 +153,7 @@ export function normalizeHtml(window, html) {
export function setupHtmlEqual() {
const window = env();

assert.htmlEqual = (actual, expected, message) => {
assert.htmlEqual = (actual, expected, message) => { // eslint-disable-line no-import-assign
Copy link
Author

Choose a reason for hiding this comment

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

this is the single line ignore i mentioned above. it suppresses the following warning:

../svelte/test/helpers.js
  156:2  warning  The members of 'assert' are read-only  no-import-assign

Choose a reason for hiding this comment

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

do we need it?

Copy link
Author

Choose a reason for hiding this comment

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

i'm not sure what you mean. .htmlEqual is certainly in use in the test suite.

https://github.com/sveltejs/svelte/search?q=htmlEqual&unscoped_q=htmlEqual

.eslintrc.js Outdated
Comment on lines 13 to 17
},
// workaround for https://github.com/typescript-eslint/typescript-eslint/issues/1824 and rely solely on 'indent' rule
rules: {
"@typescript-eslint/indent": "off"
}
Copy link
Author

Choose a reason for hiding this comment

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

prior to making this change, it was not possible to use --fix to resolve the lint warnings reported by 'indent' itself.

this leads me to believe that 'indent' and '@typescript-eslint/indent" are at an impasse as to what the appropriate indentation should be. given the language in typescript-eslint/typescript-eslint#1824, it seemed safest to side with 'indent'.

@benmccann
Copy link
Member

Thanks for taking the initiative on this. I'm going to close this one in favor of #5263 which doesn't make whitespace changes

@benmccann benmccann closed this Aug 12, 2020
@jgravois jgravois deleted the patch-5026 branch August 17, 2020 16:58
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.

"Unchanged files with check annotations" flags distracting lint errors
3 participants