SPFx: ESLint instead of TSLint
TSLint is deprecated nowadays as ESLint supports TypeScript. However, we cannot replace TSLint with ESLint in SPFx projects because TSLint task is a part of the build process internally. It would be nice to use ESLint by default.
A couple of GitHub links about the topic:
A couple of interesting historical facts:
“In fact, it all started a long time ago: the last release of the tslint kernel was already in 2016. And this is the moment when it is time to start saying “last,” if someone still says “last,” because that release was really the last. On February 19, 2019, an official post was released to stop the development of tslint. In it, the development company (by the way, it’s not even Microsoft) strongly advises everyone to switch to eslint, since their efforts will now be aimed at improving TypeScript support in this linter.”
“...[Microsoft] wrote a migration plan. In accordance with this plan, the development of tslint rules has already been discontinued on August 1, 2019, and the development of tslint itself will cease on November 1, 2019. Although, to be honest, development has been discontinued a long time ago (see above for the latest release).”
Alisher Abdurakhmanov commented
Really helpful blogpost from Sergei Sergeev "SharePoint Framework with ESLint" — https://spblog.net/post/2020/12/22/sharepoint-framework-with-eslint
TSlint cannot be more deprecated. One should use the tslint-plugins for eslint, these are the ones supported. Furthermore, we cannot use the react-hooks-eslint-plugins, recommended and provided by React.
Please replace tslint with eslint
Michael Smith commented
I've just wasted 2 hours of my time getting an ESLint config broadly working only to have to give up due to this issue