|
1 | | -import xoTypeScript from "eslint-config-xo-typescript"; |
2 | | -import tsParser from "@typescript-eslint/parser"; |
3 | | -import tsPlugin from "@typescript-eslint/eslint-plugin"; |
4 | | -import importPlugin from "eslint-plugin-import"; |
5 | | -import unicornPlugin from "eslint-plugin-unicorn"; |
6 | | -import sonarjs from "eslint-plugin-sonarjs"; |
7 | | -import unusedImports from "eslint-plugin-unused-imports"; |
8 | | - |
9 | | -export default [ |
10 | | - // Base XO TypeScript config (flat) |
11 | | - ...xoTypeScript, |
12 | | - |
13 | | - // SonarJS recommended (flat) |
14 | | - sonarjs.configs.recommended, |
15 | | - |
16 | | - // Strict overlays and additional plugins |
17 | | - { |
18 | | - name: "@mikecbrant/eslint-config/strict-overrides", |
19 | | - files: [ |
20 | | - "**/*.js", |
21 | | - "**/*.mjs", |
22 | | - "**/*.jsx", |
23 | | - "**/*.ts", |
24 | | - "**/*.mts", |
25 | | - "**/*.tsx", |
26 | | - "**/*.d.ts", |
27 | | - ], |
28 | | - plugins: { |
29 | | - "@typescript-eslint": tsPlugin, |
30 | | - import: importPlugin, |
31 | | - unicorn: unicornPlugin, |
32 | | - "unused-imports": unusedImports, |
33 | | - }, |
34 | | - languageOptions: { |
35 | | - ecmaVersion: "latest", |
36 | | - sourceType: "module", |
37 | | - parser: tsParser, |
38 | | - parserOptions: { |
39 | | - // Enable type-aware rules without hardcoding absolute tsconfig paths |
40 | | - projectService: true, |
41 | | - }, |
42 | | - }, |
43 | | - settings: { |
44 | | - "import/resolver": { |
45 | | - typescript: { alwaysTryTypes: true }, |
46 | | - }, |
47 | | - }, |
48 | | - rules: { |
49 | | - // Confirmed strict thresholds (errors) |
50 | | - "max-lines-per-function": [ |
51 | | - "error", |
52 | | - { max: 60, skipComments: true, skipBlankLines: true }, |
53 | | - ], |
54 | | - complexity: ["error", 10], |
55 | | - "max-depth": ["error", 3], |
56 | | - "max-params": ["error", 4], |
57 | | - |
58 | | - // TS hygiene |
59 | | - "@typescript-eslint/consistent-type-imports": [ |
60 | | - "error", |
61 | | - { prefer: "type-imports", fixStyle: "inline-type-imports" }, |
62 | | - ], |
63 | | - "@typescript-eslint/no-floating-promises": "error", |
64 | | - |
65 | | - // Imports hygiene & sorting |
66 | | - "import/no-duplicates": "error", |
67 | | - "import/order": [ |
68 | | - "error", |
69 | | - { |
70 | | - groups: [ |
71 | | - ["builtin", "external"], |
72 | | - "internal", |
73 | | - "parent", |
74 | | - "sibling", |
75 | | - "index", |
76 | | - "object", |
77 | | - "type", |
78 | | - ], |
79 | | - alphabetize: { order: "asc", caseInsensitive: true }, |
80 | | - "newlines-between": "always", |
81 | | - }, |
82 | | - ], |
83 | | - "unused-imports/no-unused-imports": "error", |
84 | | - |
85 | | - // Misc |
86 | | - "no-console": "error", |
87 | | - |
88 | | - // Tame a few unicorn defaults |
89 | | - "unicorn/prevent-abbreviations": "off", |
90 | | - "unicorn/no-null": "off", |
91 | | - }, |
92 | | - }, |
93 | | - |
94 | | - // Explicitly omit CommonJS and TypeScript CJS |
95 | | - { ignores: ["**/*.cjs", "**/*.cts"] }, |
96 | | -]; |
| 1 | +export { default } from './config.mjs' |
0 commit comments