|
| 1 | +/* eslint-disable @typescript-eslint/no-explicit-any */ |
| 2 | + |
| 3 | +import js from "@eslint/js"; |
| 4 | +import { globalIgnores } from "eslint/config"; |
| 5 | +import globals from "globals"; |
| 6 | +import tseslint from "typescript-eslint"; |
| 7 | +import pluginPrettier from "eslint-plugin-prettier"; |
| 8 | +import pluginReact from "eslint-plugin-react"; |
| 9 | +import pluginReactHooks from "eslint-plugin-react-hooks"; |
| 10 | + |
| 11 | +const config: any[] = [ |
| 12 | + globalIgnores([ |
| 13 | + "**/dist/**", |
| 14 | + "**/node_modules/**", |
| 15 | + "**/build/**", |
| 16 | + "**/.next/**", |
| 17 | + "**/.angular/**", |
| 18 | + "**/releases/**", |
| 19 | + "packages/styles/dist.css", |
| 20 | + "packages/angular/**", |
| 21 | + ]), |
| 22 | + ...tseslint.configs.recommended, |
| 23 | + { |
| 24 | + // All TypeScript files |
| 25 | + files: ["**/*.ts", "**/*.tsx"], |
| 26 | + plugins: { js, prettier: pluginPrettier }, |
| 27 | + languageOptions: { globals: { ...globals.browser, ...globals.node } }, |
| 28 | + rules: { |
| 29 | + "prettier/prettier": "error", |
| 30 | + "arrow-body-style": "off", |
| 31 | + "prefer-arrow-callback": "off", |
| 32 | + }, |
| 33 | + }, |
| 34 | + { |
| 35 | + // React package specific rules |
| 36 | + files: ["packages/react/src/**/*.{ts,tsx}"], |
| 37 | + plugins: { react: pluginReact, "react-hooks": pluginReactHooks }, |
| 38 | + languageOptions: { |
| 39 | + parserOptions: { |
| 40 | + ecmaFeatures: { |
| 41 | + jsx: true, |
| 42 | + }, |
| 43 | + }, |
| 44 | + }, |
| 45 | + settings: { |
| 46 | + react: { |
| 47 | + version: "detect", |
| 48 | + }, |
| 49 | + }, |
| 50 | + rules: { |
| 51 | + ...pluginReact.configs.recommended.rules, |
| 52 | + ...pluginReactHooks.configs.recommended.rules, |
| 53 | + "react/react-in-jsx-scope": "off", // Not needed with React 17+ |
| 54 | + }, |
| 55 | + }, |
| 56 | + { |
| 57 | + // Test files - more lenient rules |
| 58 | + files: ["**/*.test.{ts,tsx}", "**/*.spec.{ts,tsx}", "**/tests/**/*.{ts,tsx}"], |
| 59 | + rules: { |
| 60 | + "@typescript-eslint/no-explicit-any": "off", |
| 61 | + "@typescript-eslint/no-unused-vars": "off", |
| 62 | + }, |
| 63 | + }, |
| 64 | +]; |
| 65 | + |
| 66 | +export default config; |
0 commit comments