@gooddata/eslint-config 11.19.0-alpha.7 → 11.19.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -80,31 +80,26 @@ import config from "@gooddata/eslint-config/esm-react-vitest";
80
80
  export default config;
81
81
  ```
82
82
 
83
- For TypeScript projects, use the `tsOverride` helper to configure the TypeScript parser with the correct `tsconfigRootDir`:
83
+ To add custom rules or overrides:
84
84
 
85
85
  ```typescript
86
86
  // eslint.config.ts
87
87
  // (C) 2025 GoodData Corporation
88
88
 
89
89
  import config from "@gooddata/eslint-config/esm-react-vitest";
90
- import { tsOverride } from "@gooddata/eslint-config/tsOverride";
91
90
 
92
91
  export default [
93
92
  ...config,
94
- tsOverride(import.meta.dirname, {
95
- // Optional: Add custom TypeScript rule overrides here
96
- "@typescript-eslint/no-namespace": "off",
97
- }),
93
+ {
94
+ rules: {
95
+ // Custom rule overrides (applies to all files)
96
+ "no-console": "warn",
97
+ },
98
+ },
98
99
  ];
99
100
  ```
100
101
 
101
- **What `tsOverride` does in v9:**
102
-
103
- - Configures `languageOptions.parserOptions.tsconfigRootDir` to point to your project directory
104
- - Applies to `**/*.ts` and `**/*.tsx` files
105
- - Allows you to pass custom rule overrides as the second parameter
106
-
107
- To add custom rules or overrides without TypeScript configuration:
102
+ To add TypeScript-specific rule overrides, specify a `files` pattern:
108
103
 
109
104
  ```typescript
110
105
  // eslint.config.ts
@@ -115,9 +110,11 @@ import config from "@gooddata/eslint-config/esm-react-vitest";
115
110
  export default [
116
111
  ...config,
117
112
  {
113
+ files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
118
114
  rules: {
119
- // Custom rule overrides
115
+ // TypeScript rule overrides (applies only to TS files)
120
116
  "@typescript-eslint/no-namespace": "off",
117
+ "@typescript-eslint/no-explicit-any": "warn",
121
118
  },
122
119
  },
123
120
  ];
@@ -125,34 +122,26 @@ export default [
125
122
 
126
123
  ### ESLint v8 (Legacy Config)
127
124
 
128
- For TypeScript projects using ESLint v8, use the `tsOverride` helper which automatically configures the TypeScript parser, import resolver, and other required settings:
125
+ For ESLint v8, use the legacy JSON-based configuration:
129
126
 
130
127
  ```javascript
131
128
  // .eslintrc.js
132
129
  // (C) 2020 GoodData Corporation
133
130
 
134
- const { tsOverride } = require("@gooddata/eslint-config/tsOverride");
135
-
136
131
  module.exports = {
137
132
  extends: ["@gooddata/eslint-config/react"],
138
133
  overrides: [
139
- tsOverride(__dirname, {
140
- // Optional: Add custom TypeScript rule overrides here
141
- "@typescript-eslint/no-namespace": "off",
142
- "@typescript-eslint/no-unsafe-assignment": "off",
143
- }),
134
+ {
135
+ files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
136
+ rules: {
137
+ // Custom TypeScript rule overrides
138
+ "@typescript-eslint/no-namespace": "off",
139
+ },
140
+ },
144
141
  ],
145
142
  };
146
143
  ```
147
144
 
148
- **What `tsOverride` does:**
149
-
150
- - Sets up the TypeScript parser (`@typescript-eslint/parser`)
151
- - Configures `tsconfigRootDir` to point to your project directory
152
- - Configures the import resolver to handle TypeScript imports correctly
153
- - Applies to `**/*.ts` and `**/*.tsx` files
154
- - Allows you to pass custom rule overrides as the second parameter
155
-
156
145
  ### Non-TypeScript Projects (v8)
157
146
 
158
147
  For non-TypeScript projects using ESLint v8, simply extend the configuration:
@@ -165,8 +154,6 @@ module.exports = {
165
154
 
166
155
  **Important Notes:**
167
156
 
168
- - **ESLint v8 TypeScript Projects**: Using `tsOverride(__dirname, rules)` is **mandatory** for TypeScript projects with ESLint v8. Without it, `@typescript-eslint/parser` won't know where to find your `tsconfig.json`, and import resolution will not work correctly.
169
-
170
157
  - **Peer Dependencies**: Only packages from the `common` configuration are listed in `peerDependencies`. Variant-specific packages (e.g., `eslint-plugin-react` for the `react` variant) are **not** included as peer dependencies since they're not required by all consumers.
171
158
 
172
159
  - **Verify Dependencies**: After adopting a configuration, run `npm run eslint` (or your lint command) to ensure all necessary dependencies are present in your project. If you get plugin errors, install the missing packages.
package/dist/base.js CHANGED
@@ -1246,6 +1246,11 @@ export default [
1246
1246
  "**/*.mts",
1247
1247
  "**/*.cts",
1248
1248
  ],
1249
+ languageOptions: {
1250
+ parserOptions: {
1251
+ projectService: true,
1252
+ },
1253
+ },
1249
1254
  rules: {
1250
1255
  "constructor-super": "off",
1251
1256
  "getter-return": "off",
package/dist/base.json CHANGED
@@ -1316,14 +1316,17 @@
1316
1316
  "parser": "@typescript-eslint/parser",
1317
1317
  "files": [
1318
1318
  "**/*.ts",
1319
- "**/*.tsx"
1319
+ "**/*.tsx",
1320
+ "**/*.mts",
1321
+ "**/*.cts"
1320
1322
  ],
1321
1323
  "extends": [
1322
1324
  "plugin:@typescript-eslint/recommended-type-checked"
1323
1325
  ],
1324
1326
  "parserOptions": {
1325
1327
  "ecmaVersion": 2022,
1326
- "sourceType": "module"
1328
+ "sourceType": "module",
1329
+ "projectService": true
1327
1330
  },
1328
1331
  "rules": {
1329
1332
  "@typescript-eslint/explicit-function-return-type": 0,
@@ -1247,6 +1247,11 @@ export default [
1247
1247
  "**/*.mts",
1248
1248
  "**/*.cts",
1249
1249
  ],
1250
+ languageOptions: {
1251
+ parserOptions: {
1252
+ projectService: true,
1253
+ },
1254
+ },
1250
1255
  rules: {
1251
1256
  "constructor-super": "off",
1252
1257
  "getter-return": "off",
@@ -1318,14 +1318,17 @@
1318
1318
  "parser": "@typescript-eslint/parser",
1319
1319
  "files": [
1320
1320
  "**/*.ts",
1321
- "**/*.tsx"
1321
+ "**/*.tsx",
1322
+ "**/*.mts",
1323
+ "**/*.cts"
1322
1324
  ],
1323
1325
  "extends": [
1324
1326
  "plugin:@typescript-eslint/recommended-type-checked"
1325
1327
  ],
1326
1328
  "parserOptions": {
1327
1329
  "ecmaVersion": 2022,
1328
- "sourceType": "module"
1330
+ "sourceType": "module",
1331
+ "projectService": true
1329
1332
  },
1330
1333
  "rules": {
1331
1334
  "@typescript-eslint/explicit-function-return-type": 0,
package/dist/browser.js CHANGED
@@ -1246,6 +1246,11 @@ export default [
1246
1246
  "**/*.mts",
1247
1247
  "**/*.cts",
1248
1248
  ],
1249
+ languageOptions: {
1250
+ parserOptions: {
1251
+ projectService: true,
1252
+ },
1253
+ },
1249
1254
  rules: {
1250
1255
  "constructor-super": "off",
1251
1256
  "getter-return": "off",
package/dist/browser.json CHANGED
@@ -1316,14 +1316,17 @@
1316
1316
  "parser": "@typescript-eslint/parser",
1317
1317
  "files": [
1318
1318
  "**/*.ts",
1319
- "**/*.tsx"
1319
+ "**/*.tsx",
1320
+ "**/*.mts",
1321
+ "**/*.cts"
1320
1322
  ],
1321
1323
  "extends": [
1322
1324
  "plugin:@typescript-eslint/recommended-type-checked"
1323
1325
  ],
1324
1326
  "parserOptions": {
1325
1327
  "ecmaVersion": 2022,
1326
- "sourceType": "module"
1328
+ "sourceType": "module",
1329
+ "projectService": true
1327
1330
  },
1328
1331
  "rules": {
1329
1332
  "@typescript-eslint/explicit-function-return-type": 0,
@@ -1251,6 +1251,11 @@ export default [
1251
1251
  "**/*.mts",
1252
1252
  "**/*.cts",
1253
1253
  ],
1254
+ languageOptions: {
1255
+ parserOptions: {
1256
+ projectService: true,
1257
+ },
1258
+ },
1254
1259
  rules: {
1255
1260
  "constructor-super": "off",
1256
1261
  "getter-return": "off",
@@ -1354,14 +1354,17 @@
1354
1354
  "parser": "@typescript-eslint/parser",
1355
1355
  "files": [
1356
1356
  "**/*.ts",
1357
- "**/*.tsx"
1357
+ "**/*.tsx",
1358
+ "**/*.mts",
1359
+ "**/*.cts"
1358
1360
  ],
1359
1361
  "extends": [
1360
1362
  "plugin:@typescript-eslint/recommended-type-checked"
1361
1363
  ],
1362
1364
  "parserOptions": {
1363
1365
  "ecmaVersion": 2022,
1364
- "sourceType": "module"
1366
+ "sourceType": "module",
1367
+ "projectService": true
1365
1368
  },
1366
1369
  "rules": {
1367
1370
  "@typescript-eslint/explicit-function-return-type": 0,
@@ -1251,6 +1251,11 @@ export default [
1251
1251
  "**/*.mts",
1252
1252
  "**/*.cts",
1253
1253
  ],
1254
+ languageOptions: {
1255
+ parserOptions: {
1256
+ projectService: true,
1257
+ },
1258
+ },
1254
1259
  rules: {
1255
1260
  "constructor-super": "off",
1256
1261
  "getter-return": "off",
@@ -1356,14 +1356,17 @@
1356
1356
  "parser": "@typescript-eslint/parser",
1357
1357
  "files": [
1358
1358
  "**/*.ts",
1359
- "**/*.tsx"
1359
+ "**/*.tsx",
1360
+ "**/*.mts",
1361
+ "**/*.cts"
1360
1362
  ],
1361
1363
  "extends": [
1362
1364
  "plugin:@typescript-eslint/recommended-type-checked"
1363
1365
  ],
1364
1366
  "parserOptions": {
1365
1367
  "ecmaVersion": 2022,
1366
- "sourceType": "module"
1368
+ "sourceType": "module",
1369
+ "projectService": true
1367
1370
  },
1368
1371
  "rules": {
1369
1372
  "@typescript-eslint/explicit-function-return-type": 0,
@@ -1250,6 +1250,11 @@ export default [
1250
1250
  "**/*.mts",
1251
1251
  "**/*.cts",
1252
1252
  ],
1253
+ languageOptions: {
1254
+ parserOptions: {
1255
+ projectService: true,
1256
+ },
1257
+ },
1253
1258
  rules: {
1254
1259
  "constructor-super": "off",
1255
1260
  "getter-return": "off",
@@ -1355,14 +1355,17 @@
1355
1355
  "parser": "@typescript-eslint/parser",
1356
1356
  "files": [
1357
1357
  "**/*.ts",
1358
- "**/*.tsx"
1358
+ "**/*.tsx",
1359
+ "**/*.mts",
1360
+ "**/*.cts"
1359
1361
  ],
1360
1362
  "extends": [
1361
1363
  "plugin:@typescript-eslint/recommended-type-checked"
1362
1364
  ],
1363
1365
  "parserOptions": {
1364
1366
  "ecmaVersion": 2022,
1365
- "sourceType": "module"
1367
+ "sourceType": "module",
1368
+ "projectService": true
1366
1369
  },
1367
1370
  "rules": {
1368
1371
  "@typescript-eslint/explicit-function-return-type": 0,
package/dist/esm-react.js CHANGED
@@ -1249,6 +1249,11 @@ export default [
1249
1249
  "**/*.mts",
1250
1250
  "**/*.cts",
1251
1251
  ],
1252
+ languageOptions: {
1253
+ parserOptions: {
1254
+ projectService: true,
1255
+ },
1256
+ },
1252
1257
  rules: {
1253
1258
  "constructor-super": "off",
1254
1259
  "getter-return": "off",
@@ -1346,14 +1346,17 @@
1346
1346
  "parser": "@typescript-eslint/parser",
1347
1347
  "files": [
1348
1348
  "**/*.ts",
1349
- "**/*.tsx"
1349
+ "**/*.tsx",
1350
+ "**/*.mts",
1351
+ "**/*.cts"
1350
1352
  ],
1351
1353
  "extends": [
1352
1354
  "plugin:@typescript-eslint/recommended-type-checked"
1353
1355
  ],
1354
1356
  "parserOptions": {
1355
1357
  "ecmaVersion": 2022,
1356
- "sourceType": "module"
1358
+ "sourceType": "module",
1359
+ "projectService": true
1357
1360
  },
1358
1361
  "rules": {
1359
1362
  "@typescript-eslint/explicit-function-return-type": 0,
@@ -1248,6 +1248,11 @@ export default [
1248
1248
  "**/*.mts",
1249
1249
  "**/*.cts",
1250
1250
  ],
1251
+ languageOptions: {
1252
+ parserOptions: {
1253
+ projectService: true,
1254
+ },
1255
+ },
1251
1256
  rules: {
1252
1257
  "constructor-super": "off",
1253
1258
  "getter-return": "off",
@@ -1327,14 +1327,17 @@
1327
1327
  "parser": "@typescript-eslint/parser",
1328
1328
  "files": [
1329
1329
  "**/*.ts",
1330
- "**/*.tsx"
1330
+ "**/*.tsx",
1331
+ "**/*.mts",
1332
+ "**/*.cts"
1331
1333
  ],
1332
1334
  "extends": [
1333
1335
  "plugin:@typescript-eslint/recommended-type-checked"
1334
1336
  ],
1335
1337
  "parserOptions": {
1336
1338
  "ecmaVersion": 2022,
1337
- "sourceType": "module"
1339
+ "sourceType": "module",
1340
+ "projectService": true
1338
1341
  },
1339
1342
  "rules": {
1340
1343
  "@typescript-eslint/explicit-function-return-type": 0,
package/dist/esm.js CHANGED
@@ -1247,6 +1247,11 @@ export default [
1247
1247
  "**/*.mts",
1248
1248
  "**/*.cts",
1249
1249
  ],
1250
+ languageOptions: {
1251
+ parserOptions: {
1252
+ projectService: true,
1253
+ },
1254
+ },
1250
1255
  rules: {
1251
1256
  "constructor-super": "off",
1252
1257
  "getter-return": "off",
package/dist/esm.json CHANGED
@@ -1318,14 +1318,17 @@
1318
1318
  "parser": "@typescript-eslint/parser",
1319
1319
  "files": [
1320
1320
  "**/*.ts",
1321
- "**/*.tsx"
1321
+ "**/*.tsx",
1322
+ "**/*.mts",
1323
+ "**/*.cts"
1322
1324
  ],
1323
1325
  "extends": [
1324
1326
  "plugin:@typescript-eslint/recommended-type-checked"
1325
1327
  ],
1326
1328
  "parserOptions": {
1327
1329
  "ecmaVersion": 2022,
1328
- "sourceType": "module"
1330
+ "sourceType": "module",
1331
+ "projectService": true
1329
1332
  },
1330
1333
  "rules": {
1331
1334
  "@typescript-eslint/explicit-function-return-type": 0,
@@ -1250,6 +1250,11 @@ export default [
1250
1250
  "**/*.mts",
1251
1251
  "**/*.cts",
1252
1252
  ],
1253
+ languageOptions: {
1254
+ parserOptions: {
1255
+ projectService: true,
1256
+ },
1257
+ },
1253
1258
  rules: {
1254
1259
  "constructor-super": "off",
1255
1260
  "getter-return": "off",
@@ -1352,14 +1352,17 @@
1352
1352
  "parser": "@typescript-eslint/parser",
1353
1353
  "files": [
1354
1354
  "**/*.ts",
1355
- "**/*.tsx"
1355
+ "**/*.tsx",
1356
+ "**/*.mts",
1357
+ "**/*.cts"
1356
1358
  ],
1357
1359
  "extends": [
1358
1360
  "plugin:@typescript-eslint/recommended-type-checked"
1359
1361
  ],
1360
1362
  "parserOptions": {
1361
1363
  "ecmaVersion": 2022,
1362
- "sourceType": "module"
1364
+ "sourceType": "module",
1365
+ "projectService": true
1363
1366
  },
1364
1367
  "rules": {
1365
1368
  "@typescript-eslint/explicit-function-return-type": 0,
@@ -1249,6 +1249,11 @@ export default [
1249
1249
  "**/*.mts",
1250
1250
  "**/*.cts",
1251
1251
  ],
1252
+ languageOptions: {
1253
+ parserOptions: {
1254
+ projectService: true,
1255
+ },
1256
+ },
1252
1257
  rules: {
1253
1258
  "constructor-super": "off",
1254
1259
  "getter-return": "off",
@@ -1353,14 +1353,17 @@
1353
1353
  "parser": "@typescript-eslint/parser",
1354
1354
  "files": [
1355
1355
  "**/*.ts",
1356
- "**/*.tsx"
1356
+ "**/*.tsx",
1357
+ "**/*.mts",
1358
+ "**/*.cts"
1357
1359
  ],
1358
1360
  "extends": [
1359
1361
  "plugin:@typescript-eslint/recommended-type-checked"
1360
1362
  ],
1361
1363
  "parserOptions": {
1362
1364
  "ecmaVersion": 2022,
1363
- "sourceType": "module"
1365
+ "sourceType": "module",
1366
+ "projectService": true
1364
1367
  },
1365
1368
  "rules": {
1366
1369
  "@typescript-eslint/explicit-function-return-type": 0,
package/dist/react.js CHANGED
@@ -1248,6 +1248,11 @@ export default [
1248
1248
  "**/*.mts",
1249
1249
  "**/*.cts",
1250
1250
  ],
1251
+ languageOptions: {
1252
+ parserOptions: {
1253
+ projectService: true,
1254
+ },
1255
+ },
1251
1256
  rules: {
1252
1257
  "constructor-super": "off",
1253
1258
  "getter-return": "off",
package/dist/react.json CHANGED
@@ -1344,14 +1344,17 @@
1344
1344
  "parser": "@typescript-eslint/parser",
1345
1345
  "files": [
1346
1346
  "**/*.ts",
1347
- "**/*.tsx"
1347
+ "**/*.tsx",
1348
+ "**/*.mts",
1349
+ "**/*.cts"
1348
1350
  ],
1349
1351
  "extends": [
1350
1352
  "plugin:@typescript-eslint/recommended-type-checked"
1351
1353
  ],
1352
1354
  "parserOptions": {
1353
1355
  "ecmaVersion": 2022,
1354
- "sourceType": "module"
1356
+ "sourceType": "module",
1357
+ "projectService": true
1355
1358
  },
1356
1359
  "rules": {
1357
1360
  "@typescript-eslint/explicit-function-return-type": 0,
package/dist/vitest.js CHANGED
@@ -1247,6 +1247,11 @@ export default [
1247
1247
  "**/*.mts",
1248
1248
  "**/*.cts",
1249
1249
  ],
1250
+ languageOptions: {
1251
+ parserOptions: {
1252
+ projectService: true,
1253
+ },
1254
+ },
1250
1255
  rules: {
1251
1256
  "constructor-super": "off",
1252
1257
  "getter-return": "off",
package/dist/vitest.json CHANGED
@@ -1325,14 +1325,17 @@
1325
1325
  "parser": "@typescript-eslint/parser",
1326
1326
  "files": [
1327
1327
  "**/*.ts",
1328
- "**/*.tsx"
1328
+ "**/*.tsx",
1329
+ "**/*.mts",
1330
+ "**/*.cts"
1329
1331
  ],
1330
1332
  "extends": [
1331
1333
  "plugin:@typescript-eslint/recommended-type-checked"
1332
1334
  ],
1333
1335
  "parserOptions": {
1334
1336
  "ecmaVersion": 2022,
1335
- "sourceType": "module"
1337
+ "sourceType": "module",
1338
+ "projectService": true
1336
1339
  },
1337
1340
  "rules": {
1338
1341
  "@typescript-eslint/explicit-function-return-type": 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/eslint-config",
3
- "version": "11.19.0-alpha.7",
3
+ "version": "11.19.0-alpha.8",
4
4
  "license": "MIT",
5
5
  "author": "GoodData",
6
6
  "repository": {
@@ -70,10 +70,6 @@
70
70
  "./esm-react-vitest-storybook": {
71
71
  "import": "./dist/esm-react-vitest-storybook.js",
72
72
  "require": "./dist/esm-react-vitest-storybook.json"
73
- },
74
- "./tsOverride": {
75
- "import": "./dist/tsOverride.js",
76
- "require": "./dist/tsOverride.cjs"
77
73
  }
78
74
  },
79
75
  "devDependencies": {
@@ -82,6 +78,7 @@
82
78
  "@types/node": "^22.13.0",
83
79
  "@typescript-eslint/eslint-plugin": "8.52.0",
84
80
  "@typescript-eslint/parser": "8.52.0",
81
+ "@typescript/native-preview": "7.0.0-dev.20260202.1",
85
82
  "@vitest/eslint-plugin": "1.6.6",
86
83
  "eslint": "^9.39.2",
87
84
  "eslint-import-resolver-typescript": "4.4.4",
@@ -120,13 +117,13 @@
120
117
  "scripts": {
121
118
  "_phase:build": "npm run build",
122
119
  "_phase:validate": "npm run validate",
123
- "build": "rm -rf dist && mkdir dist && vite-node scripts/build.ts",
120
+ "build": "rm -rf dist && mkdir dist && vite-node scripts/build.ts && tsgo",
124
121
  "clean": "../../common/scripts/clean-command-state.sh && rm -rf ci dist esm coverage *.log tsconfig.tsbuildinfo",
125
122
  "eslint": "eslint .",
126
123
  "eslint-fix": "eslint . --fix",
127
124
  "oxfmt-check": "oxfmt --check .",
128
125
  "oxfmt-write": "oxfmt .",
129
126
  "update-package": "vite-node scripts/updatePackage.ts",
130
- "validate": "tsc && npm run eslint && npm run oxfmt-check"
127
+ "validate": "npm run eslint && npm run oxfmt-check"
131
128
  }
132
129
  }
@@ -1,23 +0,0 @@
1
- // (C) 2025 GoodData Corporation
2
-
3
- module.exports = {
4
- tsOverride: (__dirname, rules = {}) => {
5
- return {
6
- files: ["**/*.ts", "**/*.tsx"],
7
- parser: "@typescript-eslint/parser",
8
- parserOptions: { tsconfigRootDir: __dirname, project: "tsconfig.json" },
9
- rules,
10
- settings: {
11
- "import/resolver": {
12
- node: {
13
- extensions: [".js", ".ts"],
14
- },
15
- typescript: {
16
- alwaysTryTypes: true,
17
- project: "./tsconfig.json",
18
- },
19
- },
20
- },
21
- };
22
- },
23
- };
@@ -1,35 +0,0 @@
1
- // (C) 2025-2026 GoodData Corporation
2
-
3
- export interface IFlatConfig {
4
- files?: string[];
5
- ignores?: string[];
6
- languageOptions?: Record<string, unknown>;
7
- linterOptions?: Record<string, unknown>;
8
- processor?: unknown;
9
- plugins?: Record<string, unknown>;
10
- rules?: Record<string, unknown>;
11
- settings?: Record<string, unknown>;
12
- }
13
-
14
- /**
15
- * Creates a TypeScript override config for v9 flat config.
16
- * Use `import.meta.dirname` for the dirname parameter (requires Node 20.11+).
17
- *
18
- * @example
19
- * ```ts
20
- * import gooddata from "@gooddata/eslint-config/esm-react-vitest";
21
- * import { tsOverride } from "@gooddata/eslint-config/tsOverride";
22
- *
23
- * export default [
24
- * ...gooddata,
25
- * tsOverride(import.meta.dirname, {
26
- * "@typescript-eslint/no-explicit-any": "warn",
27
- * }),
28
- * ];
29
- * ```
30
- *
31
- * @param dirname - The directory containing tsconfig.json (use import.meta.dirname)
32
- * @param rules - Additional rules to apply
33
- * @returns Flat config object for TypeScript files
34
- */
35
- export function tsOverride(dirname: string, rules?: Record<string, unknown>): IFlatConfig;
@@ -1,49 +0,0 @@
1
- // (C) 2025-2026 GoodData Corporation
2
-
3
- import tsParser from "@typescript-eslint/parser";
4
-
5
- /**
6
- * Creates a TypeScript override config for v9 flat config.
7
- * Use `import.meta.dirname` for the dirname parameter (requires Node 20.11+).
8
- *
9
- * @example
10
- * ```js
11
- * import gooddata from "@gooddata/eslint-config/esm-react-vitest";
12
- * import { tsOverride } from "@gooddata/eslint-config/tsOverride";
13
- *
14
- * export default [
15
- * ...gooddata,
16
- * tsOverride(import.meta.dirname, {
17
- * "@typescript-eslint/no-explicit-any": "warn",
18
- * }),
19
- * ];
20
- * ```
21
- *
22
- * @param {string} dirname - The directory containing tsconfig.json (use import.meta.dirname)
23
- * @param {Record<string, unknown>} rules - Additional rules to apply
24
- * @returns {object} Flat config object for TypeScript files
25
- */
26
- export function tsOverride(dirname, rules = {}) {
27
- return {
28
- files: ["**/*.ts", "**/*.tsx"],
29
- languageOptions: {
30
- parser: tsParser,
31
- parserOptions: {
32
- tsconfigRootDir: dirname,
33
- project: "tsconfig.json",
34
- },
35
- },
36
- settings: {
37
- "import/resolver": {
38
- node: {
39
- extensions: [".js", ".ts"],
40
- },
41
- typescript: {
42
- alwaysTryTypes: true,
43
- project: "./tsconfig.json",
44
- },
45
- },
46
- },
47
- rules,
48
- };
49
- }