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
Conversation
* 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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably change this in the common config:
https://github.com/sveltejs/eslint-config/blob/e8a9b27cd3f7aa66388474412b1a5c11c5a44ade/index.js#L31
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need it?
There was a problem hiding this comment.
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
}, | ||
// workaround for https://github.com/typescript-eslint/typescript-eslint/issues/1824 and rely solely on 'indent' rule | ||
rules: { | ||
"@typescript-eslint/indent": "off" | ||
} |
There was a problem hiding this comment.
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'.
Thanks for taking the initiative on this. I'm going to close this one in favor of #5263 which doesn't make whitespace changes |
resolves #5026
Checklist
npm run lint
!)Tests
npm test
oryarn test
)