conarti / eslint-plugin-feature-sliced

Feature sliced design eslint plugin
38 stars 1 forks source link

Eslint flat config #9

Open koorya opened 8 months ago

koorya commented 8 months ago

Please provide example how to use this plugin with modern eslint flat config. Still can't achive public-api rule to work.

My configuration ```js // @ts-check import eslint from '@eslint/js'; import tseslint from 'typescript-eslint'; import eslintConfigPrettier from 'eslint-config-prettier'; import eslintPluginReact from 'eslint-plugin-react'; import eslintPluginReactHooks from 'eslint-plugin-react-hooks'; import eslintFeatureSliced from '@conarti/eslint-plugin-feature-sliced'; import eslintFeatureSlicedOrder from '@conarti/eslint-plugin-feature-sliced/import-order'; import * as eslintPluginImport from 'eslint-plugin-import'; import globals from 'globals'; export default tseslint.config( eslint.configs.recommended, ...tseslint.configs.recommendedTypeChecked, { languageOptions: { parserOptions: { project: ['./packages/*/tsconfig.json'], // project: true, tsconfigRootDir: import.meta.dirname, }, globals: { ...globals.browser }, }, files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'], plugins: { react: eslintPluginReact, 'react-hooks': eslintPluginReactHooks, '@conarti/feature-sliced': eslintFeatureSliced, import: eslintPluginImport, }, rules: { ...eslintPluginReact.configs['jsx-runtime'].rules, ...eslintPluginReactHooks.configs.recommended.rules, ...eslintFeatureSlicedOrder.configs.recommended.rules, ...eslintFeatureSliced.configs.rules.rules, '@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '^_', argsIgnorePattern: '^_' }], }, }, eslintConfigPrettier, // dissable conflicting rules { ignores: [ '**/node_modules', 'eslint.config.js', '**/vite.config.ts', '**/assets', '**/autogenerated', 'packages/api-client/index.d.ts', 'packages/api-client/openapi-config.ts', ], }, ); ```