eslint-config-vylda-typescript 7.0.1 → 7.1.0

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.
@@ -4,6 +4,26 @@ All notable changes to this component will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [7.1.0] - 2026-09-30
8
+ ### Added
9
+ - Rules [Vilda Lipold]
10
+ - @typescript-eslint/no-unsafe-enum-assignment (error, strict)
11
+ ### Updated
12
+ - Packages [Vilda Lipold]
13
+ - @types/node (24.19.0)
14
+ - eslint-config-vylda-vanilla (6.0.2)
15
+ - typescript-eslint (8.71.0)
16
+ - Readme [Vilda Lipold]
17
+
18
+ ## [7.0.2] - 2026-09-26
19
+ ### Added
20
+ - Integration tests that count rules from `src/rules/*.ts` through the TypeScript AST and verify that the built `getConfig()` applies every expected rule to the `files`, `tsFiles` and `barrelsFiles` extensions via `calculateConfigForFile()` [Vilda Lipold]
21
+ ### Changed
22
+ - TypeScript now enables `noUncheckedIndexedAccess`; potentially missing array entries and regular-expression captures are explicitly handled [Vilda Lipold]
23
+ ### Updated
24
+ - Packages
25
+ - eslint-config-vylda-vanilla (6.0.1)
26
+
7
27
  ## [7.0.1] - 2026-09-21
8
28
  ### Added
9
29
  - `ts` script (`tsc --noEmit --pretty`), a faster standalone type-check against the root `tsconfig.json` for use while iterating and in CI/pre-commit [Vilda Lipold]
package/README.md CHANGED
@@ -7,10 +7,10 @@ Enhances Vylda's ESLint vanilla config with TypeScript support.
7
7
  ### 1. Install dependencies
8
8
 
9
9
  ```bash
10
- npm install eslint typescript eslint-config-vylda-typescript --save-dev
10
+ npm install eslint eslint-config-vylda-typescript --save-dev
11
11
  ```
12
12
 
13
- `eslint-import-resolver-typescript` and `typescript-eslint` ship as dependencies of this package, so they don't have to be installed separately. `typescript` does, because `typescript-eslint` needs it in your own project.
13
+ Your project is expected to already have `typescript` installed (`typescript-eslint` uses it to parse your code). Supported versions are those allowed by [`typescript-eslint`'s peer dependency range](https://typescript-eslint.io/users/dependency-versions/#typescript).
14
14
 
15
15
  If you write the ESLint config itself in TypeScript (`eslint.config.ts`, `eslint.config.mts` or `eslint.config.cts`), also install `jiti` — ESLint needs it to load a TypeScript config file; see the [TypeScript configuration files documentation](https://eslint.org/docs/latest/use/configure/configuration-files#typescript-configuration-files).
16
16
 
@@ -26,7 +26,7 @@ You can also use any other supported flat config file name, such as `eslint.conf
26
26
 
27
27
  ```typescript
28
28
  // eslint.config.ts
29
- import getConfig, { tsFiles } from 'eslint-config-vylda-typescript';
29
+ import getConfig, { files } from 'eslint-config-vylda-typescript';
30
30
  import type { Linter } from 'eslint';
31
31
 
32
32
  const baseDir = import.meta.dirname;
@@ -34,7 +34,7 @@ const baseDir = import.meta.dirname;
34
34
  const eslintConfig: Array<Linter.Config> = [
35
35
  ...getConfig(baseDir),
36
36
  {
37
- files: tsFiles,
37
+ files,
38
38
  name: 'my-rules',
39
39
  rules: {
40
40
  // Add custom rules here
@@ -63,14 +63,13 @@ npx eslint ./src/
63
63
 
64
64
  ESLint will lint all `.cjs`, `.cts`, `.js`, `.mjs`, `.mts` and `.ts` files within the current or `./src` folder, and output results to your terminal.
65
65
 
66
- The `node_modules/`, `dist/`, `build/`, `coverage/`, `test/`, `tests/`, `tmp/` and `temp/` folders are ignored globally, so they are never linted (see the `ignores` export).
66
+ The `node_modules/`, `dist/`, `build/`, `coverage/`, `test/`, `tests/`, `tmp/` and `temp/` folders in the project root are ignored globally (see the `ignores` export).
67
67
 
68
68
  You can also get results in realtime inside most IDEs via a plugin.
69
69
 
70
70
  ## Customization
71
71
 
72
- You can customize all rules with `rules` property in the `eslint.config.ts` file.
73
- You can also add custom rules to the `rules` property.
72
+ To change any rule, add your own config object after `...getConfig(baseDir)` and set it in its `rules` (see the `my-rules` block in [Configure ESLint](#2-configure-eslint)). Later config objects override earlier ones, so your settings win. To use rules from another plugin, register the plugin as well; see [Adding a custom plugin](#adding-a-custom-plugin).
74
73
 
75
74
  ### Customize extensions for ESLint import rules
76
75
 
@@ -171,7 +170,7 @@ The `importResolverAlias` option is for the aliases that live outside the tsconf
171
170
 
172
171
  ```typescript
173
172
  // eslint.config.ts
174
- import getConfig, { tsFiles } from 'eslint-config-vylda-typescript';
173
+ import getConfig, { files } from 'eslint-config-vylda-typescript';
175
174
  import type { Linter } from 'eslint';
176
175
 
177
176
  const baseDir = import.meta.dirname;
@@ -186,7 +185,7 @@ const config: Array<Linter.Config> = getConfig(baseDir, {
186
185
  const eslintConfig: Array<Linter.Config> = [
187
186
  ...config,
188
187
  {
189
- files: tsFiles,
188
+ files,
190
189
  name: 'my-rules',
191
190
  rules: {
192
191
  // Add custom rules here
@@ -472,8 +471,10 @@ const eslintConfig: Array<Linter.Config> = [
472
471
  ...configWithFiles,
473
472
  ...tsConfigWithFiles,
474
473
  ...barrelsWithFiles,
474
+
475
475
  // globally ignored folders: node_modules/, dist/ and the rest
476
476
  ...ignores,
477
+
477
478
  // your own rules, last so they win over everything above
478
479
  {
479
480
  files,
@@ -482,6 +483,7 @@ const eslintConfig: Array<Linter.Config> = [
482
483
  'no-console': 'warn',
483
484
  },
484
485
  },
486
+
485
487
  // parser override, last so it is not undone by an earlier config
486
488
  myNonTsFilesRule,
487
489
  ];
@@ -502,7 +504,7 @@ You can also use `mapFiles` function to map files for all rules.
502
504
  - `default getConfig` - default helper for getting ESLint config with custom options ([source](./src/index.ts), [documentation](https://eslint.org/docs/latest/use/configure/configuration-files))
503
505
  - `barrels` - ESLint config with rules for barrel files, used for both vanilla and TypeScript files ([source](https://gitlab.com/eslint-configs/eslint-config-vylda-vanilla/-/blob/main/src/rules/barrels.ts), [documentation](https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/prefer-default-export.md))
504
506
  - `barrelsFiles` - default file patterns for barrel files ([source](./src/index.ts), [documentation](https://eslint.org/docs/latest/use/configure/configuration-files#configuration-objects))
505
- - `base` - ESLint config with TypeScript-only rules that have no vanilla equivalent ([source](./src/rules/baseTs.ts), [documentation](https://typescript-eslint.io/rules))
507
+ - `base` - ESLint config with TypeScript-only rules that have no vanilla equivalent ([source](./src/rules/baseTs.ts), [documentation](https://typescript-eslint.io/rules/))
506
508
  - `bestPractices` - ESLint config combining vanilla best-practices rules with a TypeScript-aware `@typescript-eslint/no-magic-numbers` override, and disabling the core best-practices rules that a `@typescript-eslint` equivalent already replaces ([source](./src/rules/best-practices.ts), [documentation (js)](https://eslint.org/docs/latest/rules), [documentation (stylistic)](https://eslint.style/rules))
507
509
  - `constants` - constants used for some rules ([source](https://gitlab.com/eslint-configs/eslint-config-vylda-vanilla/-/blob/main/src/rules/constants.ts))
508
510
  - `customs` - ESLint config with custom rules, same as `vanillaBaseConfigs.customs` ([source](https://gitlab.com/eslint-configs/eslint-config-vylda-vanilla/-/blob/main/src/rules/customs.ts))
@@ -521,29 +523,29 @@ You can also use `mapFiles` function to map files for all rules.
521
523
  - `node` - ESLint config with rules for Node.js, same as `vanillaBaseConfigs.node` ([source](https://gitlab.com/eslint-configs/eslint-config-vylda-vanilla/-/blob/main/src/rules/node.ts), [documentation](https://github.com/eslint-community/eslint-plugin-n/?tab=readme-ov-file#-rules))
522
524
  - `nonTsConfigFiles` - array of non-TypeScript files for `nonTsConfigFilesRule` ([source](./src/index.ts), [documentation](https://eslint.org/docs/latest/use/configure/configuration-files#specify-files-and-ignores))
523
525
  - `nonTsConfigFilesRule` - ESLint rule for non-TypeScript files ([source](./src/index.ts), [documentation](https://eslint.org/docs/latest/use/configure/language-options#specify-parser-options))
524
- - `off` - ESLint config split into named per-category blocks (`typescript eslint/off/<category>`, one per vanilla rule-set it applies to) that disable core rules already covered by a `@typescript-eslint` equivalent or by the TypeScript compiler itself; every rule is commented with the replacement or the reason none is needed ([source](./src/rules/off.ts), [documentation](https://typescript-eslint.io/rules))
525
- - `offImports` - the `off` block for import rules on their own, so it can be applied to TypeScript files only instead of through `getImportConfig`'s `includeOffRules` option ([source](./src/index.ts), [documentation](https://typescript-eslint.io/rules))
526
+ - `off` - ESLint config split into named per-category blocks (`typescript eslint/off/<category>`, one per vanilla rule-set it applies to) that disable core rules already covered by a `@typescript-eslint` equivalent or by the TypeScript compiler itself; every rule is commented with the replacement or the reason none is needed ([source](./src/rules/off.ts), [documentation](https://typescript-eslint.io/rules/))
527
+ - `offImports` - the `off` block for import rules on their own, so it can be applied to TypeScript files only instead of through `getImportConfig`'s `includeOffRules` option ([source](./src/index.ts), [documentation](https://typescript-eslint.io/rules/))
526
528
  - `perfectionist` - ESLint config with rules for Perfectionist, same as `vanillaBaseConfigs.perfectionist` ([source](https://gitlab.com/eslint-configs/eslint-config-vylda-vanilla/-/blob/main/src/rules/perfectionist.ts), [documentation](https://perfectionist.dev/rules))
527
529
  - `plugins` - default plugins used in this config ([source](./src/index.ts), [documentation](https://eslint.org/docs/latest/use/configure/plugins))
528
530
  - `plus` - ESLint config combining vanilla extended rules with TypeScript-specific updates and additions ([source](./src/rules/plus.ts), [documentation](https://eslint.style/rules))
529
- - `strict` - ESLint config combining vanilla strict-mode rules with additional TypeScript-only strict rules ([source](./src/rules/strictTs.ts), [documentation](https://typescript-eslint.io/rules))
530
- - `stylistic` - ESLint config combining vanilla stylistic rules with TypeScript-specific updates and additional TypeScript-only stylistic rules ([source](./src/rules/stylisticTs.ts), [documentation](https://eslint.style/packages/ts))
531
+ - `strict` - ESLint config combining vanilla strict-mode rules with additional TypeScript-only strict rules ([source](./src/rules/strictTs.ts), [documentation](https://typescript-eslint.io/rules/))
532
+ - `stylistic` - ESLint config combining vanilla stylistic rules with TypeScript-specific updates and additional TypeScript-only stylistic rules ([source](./src/rules/stylisticTs.ts), [documentation](https://eslint.style/rules))
531
533
  - `TConfig` - TypeScript type for an ESLint flat config array, same as vanilla's `TConfig` ([source](./src/types.ts))
532
534
  - `TGetConfigOptions` - TypeScript type for the options object accepted by `getConfig` ([source](./src/types.ts))
533
535
  - `TGetTsImportConfigOptions` - TypeScript type for the options object accepted by `getImportConfig`, vanilla's import options plus `includeOffRules` ([source](./src/types.ts))
534
536
  - `TPlugin` - TypeScript type alias for a single ESLint plugin (`ESLint.Plugin`) ([source](./src/types.ts))
535
537
  - `TPlugins` - TypeScript type alias for a map of plugins (`Record<string, TPlugin>`) ([source](./src/types.ts))
536
- - `tsConfigs` - every rule set this package applies to TypeScript files, in one config: `base`, `bestPractices`, `errors`, `es6`, `plus`, `strict`, `stylistic` and `variables` combined ([source](./src/rules/typescriptConfig.ts), [documentation](https://typescript-eslint.io/rules))
538
+ - `tsConfigs` - every rule set this package applies to TypeScript files, in one config: `base`, `bestPractices`, `errors`, `es6`, `plus`, `strict`, `stylistic` and `variables` combined ([source](./src/rules/typescriptConfig.ts), [documentation](https://typescript-eslint.io/rules/))
537
539
  - `tsFiles` - default file pattern for TypeScript rules only ([source](./src/index.ts), [documentation](https://eslint.org/docs/latest/use/configure/configuration-files#configuration-objects))
538
- - `tsPlugins` - default TypeScript plugins only used in this config ([source](./src/index.ts), [documentation](https://typescript-eslint.io/getting-started))
540
+ - `tsPlugins` - default TypeScript plugins only used in this config ([source](./src/index.ts), [documentation](https://typescript-eslint.io/getting-started/))
539
541
  - `vanillaBaseConfigs` - object grouping the pure, unmodified vanilla rule-set configs (`barrels`, `bestPractices`, `customs`, `errors`, `es6`, `node`, `perfectionist`, `plus`, `strict`, `stylistic`, `variables`) under their original vanilla names — use this if you want vanilla's rules without this package's TypeScript-specific updates ([source](./src/index.ts), [documentation](https://gitlab.com/eslint-configs/eslint-config-vylda-vanilla))
540
542
  - `vanillaConfigs` - ESLint configuration for vanilla JavaScript only (including vanilla's `plus` rules), without import rules ([source](./src/index.ts), [documentation](https://eslint.org/docs/latest/use/configure/configuration-files))
541
543
  - `vanillaPlugins` - default plugins used in this config for vanilla JavaScript ([source](https://gitlab.com/eslint-configs/eslint-config-vylda-vanilla/-/blob/main/src/index.ts), [documentation](https://eslint.org/docs/latest/use/configure/plugins))
542
- - `variables` - ESLint config combining vanilla variable rules with TypeScript-aware updates to `no-shadow` and `no-use-before-define`, and disabling the core variable rules (`no-undef`, `no-unused-vars`, `init-declarations` included) that a `@typescript-eslint` equivalent or the compiler itself already covers ([source](./src/rules/variablesTs.ts), [documentation](https://typescript-eslint.io/rules))
544
+ - `variables` - ESLint config combining vanilla variable rules with TypeScript-aware updates to `no-shadow` and `no-use-before-define`, and disabling the core variable rules (`no-undef`, `no-unused-vars`, `init-declarations` included) that a `@typescript-eslint` equivalent or the compiler itself already covers ([source](./src/rules/variablesTs.ts), [documentation](https://typescript-eslint.io/rules/))
543
545
 
544
546
  ## Additional Documentation
545
547
 
546
- - [Changelog.md](Changelog.md)
548
+ - [CHANGELOG.md](CHANGELOG.md)
547
549
 
548
550
  ## Credits
549
551
 
@@ -1 +1 @@
1
- {"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/rules/imports.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAM3B,MAAM,6BAA6B,CAAC;AAOrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAI1D,KAAK,kBAAkB,GAAG;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAIF,eAAO,MAAM,uBAAuB,UAI5B,CAAC;AAET,eAAO,MAAM,yCAAyC;;CAGrD,CAAC;AACF,OAAO,EAAE,0BAA0B,EAAE,CAAC;AACtC,eAAO,MAAM,mCAAmC,UAIxC,CAAC;AACT,eAAO,MAAM,oDAAoD,UAAO,CAAC;AAOzE,eAAO,MAAM,oBAAoB,GAAI,eAAe,MAAM,KAAG,kBAG3D,CAAC;AAsBH,QAAA,MAAM,eAAe,GACnB,eAAe,MAAM,EACrB,UAAS,yBAA0C,KAClD,KAAK,CAAC,MAAM,CAAC,MAAM,CAkCrB,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/rules/imports.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAM3B,MAAM,6BAA6B,CAAC;AAOrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAI1D,KAAK,kBAAkB,GAAG;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAIF,eAAO,MAAM,uBAAuB,UAI5B,CAAC;AAET,eAAO,MAAM,yCAAyC;;CAGrD,CAAC;AACF,OAAO,EAAE,0BAA0B,EAAE,CAAC;AACtC,eAAO,MAAM,mCAAmC,UAIxC,CAAC;AACT,eAAO,MAAM,oDAAoD,UAAO,CAAC;AAOzE,eAAO,MAAM,oBAAoB,GAAI,eAAe,MAAM,KAAG,kBAG3D,CAAC;AAsBH,QAAA,MAAM,eAAe,GACnB,eAAe,MAAM,EACrB,UAAS,yBAA0C,KAClD,KAAK,CAAC,MAAM,CAAC,MAAM,CAsCrB,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -53,6 +53,9 @@ const getImportConfig = (tsConfigPath, options = defaultOptions) => {
53
53
  importResolverAlias,
54
54
  importResolverNodeExtensions,
55
55
  });
56
+ if (config === undefined) {
57
+ throw new Error('Vanilla import config is empty');
58
+ }
56
59
  const { settings = {}, ...rest } = config;
57
60
  return [
58
61
  {
@@ -1 +1 @@
1
- {"version":3,"file":"strictTs.d.ts","sourceRoot":"","sources":["../../src/rules/strictTs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAiIhC,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"strictTs.d.ts","sourceRoot":"","sources":["../../src/rules/strictTs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAqIhC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -46,6 +46,9 @@ const config = [
46
46
  // Disallows calling a value with type 'any'.
47
47
  // https://typescript-eslint.io/rules/no-unsafe-call/
48
48
  '@typescript-eslint/no-unsafe-call': 'error',
49
+ // Disallow assigning non-enum values to enum typed locations
50
+ // https://typescript-eslint.io/rules/no-unsafe-enum-assignment/
51
+ '@typescript-eslint/no-unsafe-enum-assignment': 'error',
49
52
  // Disallows comparing an enum value with a non-enum value.
50
53
  // https://typescript-eslint.io/rules/no-unsafe-enum-comparison/
51
54
  '@typescript-eslint/no-unsafe-enum-comparison': 'error',
package/package.json CHANGED
@@ -4,15 +4,15 @@
4
4
  "url": "https://gitlab.com/eslint-configs/eslint-config-vylda-typescript/-/issues"
5
5
  },
6
6
  "dependencies": {
7
- "eslint-config-vylda-vanilla": "^6.0.0",
7
+ "eslint-config-vylda-vanilla": "^6.0.2",
8
8
  "eslint-import-resolver-typescript": "^4.4.5",
9
9
  "espree": "^11.2.0",
10
- "typescript-eslint": "^8.70.1"
10
+ "typescript-eslint": "^8.71.0"
11
11
  },
12
12
  "description": "Enhances Vylda's ESLint vanilla config with TypeScript support",
13
13
  "devDependencies": {
14
14
  "@eslint/config-inspector": "^3.5.0",
15
- "@types/node": "^24.13.5",
15
+ "@types/node": "^24.19.0",
16
16
  "cross-env": "^10.1.0",
17
17
  "eslint": "^10.11.0",
18
18
  "husky": "^9.1.7",
@@ -64,5 +64,5 @@
64
64
  },
65
65
  "type": "module",
66
66
  "types": "dist/index.d.ts",
67
- "version": "7.0.1"
67
+ "version": "7.1.0"
68
68
  }