typescriptFormatter.js to support ESLint #10326
Open
+1
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello everybody!
I've a mini PR which you're welcome to not take, but it would make me very happy if you did 😄
I am an inveterate fiddler and tweaker. As such, I'm the sort of person who likes to either eject my
create-react-app
or use something like craco to customise it. I'm aware that this is on me and that there are no guarantees offered for customisation. Nevertheless, I've a tiny tweak to offer that I think might still be worth considering.A common thing for me to do when tweaking is to use the
fork-ts-checker-webpack-plugin
to handle ESLint as well as type checking. There's definitely some ego in there; it was me that added this ability to the plugin. However, it's also that I appreciate using a consistent mechanism for reporting issues, be they type checking or lint issues.Consider the following craco recipe:
This removes the
eslint-webpack-plugin
and turns on ESLint support in thefork-ts-checker-webpack-plugin
. Running this config on a project with a simple linting issue in it surfaces up the following:Please note, this works fine apart from one thing; the
undefined error
message. This is because theorigin
is"eslint"
and that key does not exist inissueOrigins
. Hence theundefined
asissueOrigins[origin]
fails to look up an entry.If we add in an
eslint
entry like so:Then this issue is resolved and we get a nice console message like so:
Of course, this is a niche issue, but I know I'm not the only person who would love this to be taken. So... what do you think?