Telegram-Mini-Apps / reactjs-template

Telegram Mini Apps application template using React, tma.js, TypeScript and Vite.
https://t.me/tmajsbot/react_example
102 stars 38 forks source link

Support for eslint 9 #1

Open Santalov opened 2 months ago

Santalov commented 2 months ago

This project comes with eslint config out of the box.

But eslint is not listed in the project deps. So running lint script errors.

The next obvious step is to install eslint

yarn add eslint

But by default latest version of the eslint is installed (eslint 9), which is incompatible with current config file. So developer meets unobvious errors which is a little frustrating.

You can see the first details about new config format here. And some examples are here https://stackoverflow.com/questions/74237042/how-to-correctly-configure-the-parser-plugins-with-eslints-new-flat-config

I suggest eslint configuration should be removed or updated to meet the latest version of eslint.

heyqbnk commented 2 months ago

Hey. Missing eslint package seems like a bug.

I am not sure we can switch to eslint@9 as long as it seems rather new for now and some of the plugins are not ready for a new major version.

Nevertheless, we can possibly recognize current eslint configuration as too subjective and remove all plugins just leaving only those, necessary for working with TypeScript. So, we would use some config like eslint/recommended. In this case, we can switch to eslint9.

What do you think about it? In case, its fine, could you create a PR proposing changes?

Santalov commented 2 months ago

What do you think about it? In case, its fine, could you create a PR proposing changes?

Sounds good. Will create one in a day or so

heyqbnk commented 2 months ago

Waiting for @typescript-eslint v9 support: https://github.com/typescript-eslint/typescript-eslint/pull/9002

heyqbnk commented 1 month ago

Waiting for @typescript-eslint v9 support: typescript-eslint/typescript-eslint#9002

Alpha version released. Now waiting for https://github.com/jsx-eslint/eslint-plugin-react/issues/3699