wotan icon indicating copy to clipboard operation
wotan copied to clipboard

Investigate adding compatibility for ESLint rules

Open ajafff opened this issue 6 years ago • 4 comments

The TypeScript team is moving towards ESLint because of its performance and obviously bigger ecosystem: https://github.com/Microsoft/TypeScript/issues/29288

This proposes a new plugin module that can load and execute ESLint rules.

Because of the completely different AST traversal it needs to be evaluated if that's even possible (without sacrificing performance too much).

This does not propose a plugin like @fimbul/valtyr that can completely emulate ESLint. This seems unnecessary as ESLint already works reasonably well on its own.

ajafff avatar Jan 07 '19 22:01 ajafff

Related news https://medium.com/palantir/tslint-in-2019-1a144c2317a9 (or maybe it's the same news in a different channel, not sure)

This does not propose a plugin like @fimbul/valtyr that can completely emulate ESLint. This seems unnecessary as ESLint already works reasonably well on its own.

Does the above mean that people that want to use ESLint will not be able to integrate their config into running wotan? So they would need to run two linters if they want to use thing available through wotan?

I think for more adoption it would be a good idea to provide tooling similar to valtyr. This would make the switch for this tool from "a TSLint alternative" to "the pluggable linter that supports what you have and more".

Would be happy about any explaination of perspectives on this topic.

karfau avatar Feb 20 '19 07:02 karfau

TSLint in 2019

Palantir abandoned TSLint about 2 years ago. I expect nothing to come from their end regarding the topics in the blog post. Instead they will rely on other contributors to get things done. I'm hoping they deprecate TSLint sooner than later and don't encourage contributions for open issues in the meantime...


Does the above mean that people that want to use ESLint will not be able to integrate their config into running wotan?

Emulating the whole linter (cascading config, processors, .eslintignore, the actual linting, ...) is a bigger task than just loading and executing ESLint rules and displaying the results. This approach doesn't allow mixing rules from different linter engines in a single config (and therefore in a single execution of wotan).

What I had in mind was a plugin like @fimbul/heimdall that makes rules and formatters available in .wotanrc.yaml. At least that's what I want to start with.

Of course there could be a plugin to completely emulate ESLint. The only real benefit to executing eslint directly would be better support for TypeScript's tsconfig.json, semantic analysis using the TypeChecker, incremental parsing and faster updates after fixing.

ajafff avatar Feb 20 '19 15:02 ajafff

What I had in mind was a plugin like @fimbul/heimdall that makes rules and formatters available in .wotanrc.yaml. At least that's what I want to start with.

Thx for the clarification, sounds like a solid plan for me.

karfau avatar Feb 20 '19 19:02 karfau

Probably required to correctly convert the AST: https://github.com/typescript-eslint/typescript-eslint/issues/774

ajafff avatar Aug 13 '19 17:08 ajafff