Thx for the answer. So as I see it, if I want this fast, a custom eslint plugin might be the way to go. Though I would like to see some generic linter solution to start off for other linters, as there are linters out there that aren’t fully worked out, htmllint etc... for example.
mvg, Dieter Geerts UI/UX/FE Web App Engineer Kastanjestraat 47, 9000 Gent +32 499/33.67.44 ________________________________ From: Nicholas Zakas <[email protected]> Sent: Thursday, July 11, 2019 2:11:19 AM To: Dieter Geerts Cc: ESLint Subject: Re: [ESLint] Is it possible to lint other 'languages' with ESLint? Hi Dieter, ESLint is designed to work specifically with JavaScript, so unless a language is JS-based or otherwise embeds JS (like HTML or Markdown), ESLint won’t work for it. There are some generic concepts that could be applied to other linters, but right now the ESLint code is pretty tightly coupled to JS concepts, so extracting the generic pieces would be a massive amount of work. I did actually look at extracting the generic pieces previously and concluded that it would be easier to write a new generic linter from scratch than try to extract generic pieces from ESLint (I think I have the beginnings of that on my hard drive somewhere, but not in any shape to share). Regards. On Wed, Jul 10, 2019 at 12:24 AM Dieter Geerts <[email protected]<mailto:[email protected]>> wrote: I'm in search for some yaml linter, so I can lint yaml docs used to generate swagger ui (https://www.npmjs.com/package/swagger-jsdoc<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Fswagger-jsdoc&data=02%7C01%7C%7C3715422ea1704056cda008d705945486%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636984006934906907&sdata=0Vtliw4MIe4aI4JLsYs0UX%2BJz%2FKWPFzSCQNpIwWnP2Y%3D&reserved=0>). But the only one I can find is one that is very specifically tailored (https://github.com/replicatedhq/replicated-lint<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Freplicatedhq%2Freplicated-lint&data=02%7C01%7C%7C3715422ea1704056cda008d705945486%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636984006934926923&sdata=KUvvlLmyB3JmzKHXBXg1Q%2BJ6E7vzV1hQm%2FvYIv6nRRw%3D&reserved=0>). Now what I see is that the general principles/concepts ESLint has are the things needed, like the ability to extract the yaml pieces to lint (like the markdown plugin does to extract the JS code blocks). And in essence, it's just checking rules based on a AST, which can be created from yaml code (https://www.npmjs.com/package/yaml-ast-parser<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Fyaml-ast-parser&data=02%7C01%7C%7C3715422ea1704056cda008d705945486%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636984006934936952&sdata=HuoaDq%2BcgAMVSTAUgAHGq8TdvzItG5RgznL96NBM7JU%3D&reserved=0>). So I was wondering if it would be possible to use ESLint with other AST's to be able to lint other 'languages'? If this would not be possible, would it be logical to extract the generic concepts to a base linter for several linters? -- You received this message because you are subscribed to the Google Groups "ESLint" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]<mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/eslint/ce5928de-1a1a-44ab-aca4-4dccee74e3d5%40googlegroups.com<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Feslint%2Fce5928de-1a1a-44ab-aca4-4dccee74e3d5%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=02%7C01%7C%7C3715422ea1704056cda008d705945486%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636984006934956938&sdata=sQKN8088qkzC3YSfsWVio6DW7SY8zzyBAPKWtNg1ck8%3D&reserved=0>. For more options, visit https://groups.google.com/d/optout<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Foptout&data=02%7C01%7C%7C3715422ea1704056cda008d705945486%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636984006934966943&sdata=MEAQf705RqDZOm9dWyir048h9CcX7kegBa8W%2FhYvM9U%3D&reserved=0>. -- ______________________________ Nicholas C. Zakas @slicknet Author, Principles of Object-Oriented JavaScript<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Famzn.to%2F29Pmfrm&data=02%7C01%7C%7C3715422ea1704056cda008d705945486%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636984006934986959&sdata=AMIEF60X26RJa%2BR54cqCyyq1UHanKFAlqmrjlmTJqo4%3D&reserved=0> Author, Understanding ECMAScript 6<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Famzn.to%2F29K1mIy&data=02%7C01%7C%7C3715422ea1704056cda008d705945486%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636984006935006975&sdata=mqb8jIQUbl3vwrnwyYxjar0ltouJl2Bncmo72DjgcRg%3D&reserved=0> -- You received this message because you are subscribed to the Google Groups "ESLint" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/eslint/AM5PR04MB304230ACF56B7D82F8B8831BBDCC0%40AM5PR04MB3042.eurprd04.prod.outlook.com. For more options, visit https://groups.google.com/d/optout.
