You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
Thus the new prettier 2.0 behavior, when applied on anonymous function, creates linter errors, whenever anonymous function is being declared. Here is sample code based on ESLint docs and mentioned prettier release:
If the anonymous property can be configured as ignore, preserving all others with default values, the linter
behaviour can be aligned with both prettier default one and most usecases on DT (functions with both space and no space for anonymous functions):
this will yeld no lint error. So both versions would be allowed to coexists.
Otherwise users will start adding exlusion rules just to correct that prettier 2.0 behavior and linter defualt rules, as experienced here: DefinitelyTyped/DefinitelyTyped#46284 (comment)
The exclusion rule was added just for fixing linter rule because of the default prettier new behaviour.
Thanks!
The text was updated successfully, but these errors were encountered:
I'd like to discuss addition of rule for
dt.json
that could one apsect of current setup on theDT with
prettier
2.* anddtslint
.The
prettier
2.* comes with default, non-confiugrable behavior ofspace-before-paren
:Prettier 2.0 “2020”: Always add a space after the function keyword
prettier
is now used as the default formatter on the DT project:https://github.com/definitelyTyped/DefinitelyTyped/#common-mistakes
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/.prettierrc.json
The custom rule for
space-before-function-paren
is not defined indtslint
, so I believe it takes default values:https://palantir.github.io/tslint/rules/space-before-function-paren/
IMO these are:
Thus the new
prettier
2.0 behavior, when applied on anonymous function, creates linter errors, whenever anonymous function is being declared. Here is sample code based on ESLint docs and mentionedprettier
release:this results
Spaces before function parens are disallowed (space-before-function-paren)
4 errors for:If the
anonymous
property can be configured asignore
, preserving all others with default values, the linterbehaviour can be aligned with both
prettier
default one and most usecases on DT (functions with both space and no space for anonymous functions):this will yeld no lint error. So both versions would be allowed to coexists.
Otherwise users will start adding exlusion rules just to correct that
prettier
2.0 behavior and linter defualt rules, as experienced here:DefinitelyTyped/DefinitelyTyped#46284 (comment)
The exclusion rule was added just for fixing linter rule because of the default prettier new behaviour.
Thanks!
The text was updated successfully, but these errors were encountered: