jgoz opened a new pull request #11142:
URL: https://github.com/apache/druid/pull/11142


   ### Description
   
   TSLint is deprecated and they recommend switching to ESLint which now has 
great support for TypeScript and more feature-rich lint plugins for React, 
React+hooks, etc.
   
   I used the `tslint-to-eslint-config` automated tool to translate the base 
config from `awesome-code-style` + local extensions and then reorganized it as 
additions/overrides to the "recommended" configs provided by ESLint, 
typescript-eslint, etc.
   
   Finally, I enabled a few more rules that didn't require significant manual 
changes, favoring those that included fixers.
   
   Once these rules are lifted into `awesome-code-style`, there will be a 
follow-up PR to use the base config it provides instead of specifying 
everything locally.
   
   #### Note on Prettier
   
   In the previous TSLint config, it used a plugin that treated Prettier as a 
lint rule. A similar plugin exists for ESLint, but doing this is [actively 
discouraged by 
Prettier](https://prettier.io/docs/en/integrating-with-linters.html). Instead, 
they recommend keeping the two separate, which avoids red squiggly noise in 
IDEs and is faster (so they say).
   
   But note that this requires a couple of changes:
   - Explicitly checking formatting during `npm test` — added the 
`prettify-check` script to deal with this
   - Enabling format-on-save in your IDE — e.g., in WebStorm, you can run 
Prettier on format and on save:
   
   <img width="734" alt="image" 
src="https://user-images.githubusercontent.com/132233/115590688-7e1fc880-a28e-11eb-90ce-c7d67ec819e4.png";>
   
   If we want the old behavior back, it would be trivial to add 
`eslint-plugin-prettier` to the setup, but I think we should give this a fair 
shake.
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
   - [x] been tested in a test Druid cluster.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to