Giter Club home page Giter Club logo

Comments (8)

ArnaudBarre avatar ArnaudBarre commented on June 19, 2024 1

So I've look at it and both the types shipped by @types/eslint and TSESLint in typescript-eslint/typescript-eslint#7273 makes it totally useless to ship types for plugin, there is absolutely no validation on plugin name or options. This is sad. This is one of the reason I'm working on a new linter. Until ESLint takes really care about typing of their config, I considered this out of scope.

from eslint-plugin-react-refresh.

ArnaudBarre avatar ArnaudBarre commented on June 19, 2024

I can do that, but I'm quite unhappy is the low guidance of ESLint core for that. What are types you using to type your config? I don't think this is worth it adding a dependency on @types/eslint or a subpackage of @typescipt-eslint, so maybe having the module typed as { "only-export-components": any } would be a start, but that's bad that you can't get types for the parameters

from eslint-plugin-react-refresh.

valerii15298 avatar valerii15298 commented on June 19, 2024

@ArnaudBarre I completely agree.
The thing is I am using ES modules.
Probably with commonjs your current types are correct.
But with ES Modules there are some breaking changes.
Basically typescript with ES Modules does not work with namespaces any more.
You can check out this blogpost: https://devblogs.microsoft.com/typescript/typescripts-migration-to-modules/
You can check out my project here: https://github.com/valerii15298/int20h-2024/blob/main/api/eslint.config.js
It is a small one, so you can clone install deps and see that there is no any autocomplete for all eslint plugins...
Maybe I am doing something wrong though...

I also can create separate reproduction repo specifically for it if you want :)

from eslint-plugin-react-refresh.

ArnaudBarre avatar ArnaudBarre commented on June 19, 2024

I'll look at it, if you find any plugin that does things right, please share!

from eslint-plugin-react-refresh.

valerii15298 avatar valerii15298 commented on June 19, 2024

@ArnaudBarre can you share which linter are you working on?
I heard that Biome is quite promising...

from eslint-plugin-react-refresh.

ArnaudBarre avatar ArnaudBarre commented on June 19, 2024

I don't have anything ready for now, I've worked on something on Christmas/January but I have still some rules I want to implement before making the project public.
Here are some tweets I made about it:

Biome and OXC linter are two promising projects, but the lack of custom rules and type aware rules is a deal breaker for me.

A project in the same idea but IMO with a public API too low level is https://github.com/johnsoncodehk/typescript-linter

from eslint-plugin-react-refresh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.