allohamora / cli

cli to initialize projects and more
https://www.npmjs.com/package/@allohamora/cli
MIT License
1 stars 0 forks source link

Eslint config upgrades #244

Open allohamora opened 3 weeks ago

allohamora commented 3 weeks ago

New eslint config upgrades, need time to be sure what changes should be done, cause everything was working several releases ago

allohamora commented 3 weeks ago

Now the ignores should be as a separate item

from:

[
  {
    files: ['**/*.ts'],
    ignores: ['node_modules', 'dist'],
  }
]

to:

[
  {
    ignores: ['node_modules', 'dist'],
  },
  {
    files: ['**/*.ts'],
  }
]
allohamora commented 3 weeks ago

In a monorepo vscode load types for some packages and for some not https://www.npmjs.com/package/@types/eslint__js

allohamora commented 3 weeks ago

eslint-plugin-react ships broken types, but it can be fixed in the next releases

/// @ts-expect-error https://github.com/jsx-eslint/eslint-plugin-react/issues/3838
pluginReact.configs.flat['jsx-runtime']
allohamora commented 3 weeks ago

eslint-plugin-react requires providing a react version (maybe only in monorepo)

{
  settings: {
    react: {
      version: 'detect'
    }
  }
}
allohamora commented 3 weeks ago

pluginReact.configs.flat.recommended should be in config as well

/// @ts-expect-error https://github.com/jsx-eslint/eslint-plugin-react/issues/3838
pluginReact.configs.flat.recommended
allohamora commented 3 weeks ago

Maybe move to recommendedTypeChecked with stylisticTypeChecked

...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,