@juuso.piikkila/eslint-config-typescript 4.1.0 → 4.2.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.
package/AGENTS.md ADDED
@@ -0,0 +1,112 @@
1
+ <!--
2
+ This file is intended to help AI coding assistants make useful, repository-specific
3
+ edits in the `eslint-config-typescript` project. Keep guidance short and actionable.
4
+ -->
5
+
6
+ # Repository snapshot
7
+
8
+ - Purpose: a shareable ESLint configuration package for TypeScript (and Vue) projects.
9
+ - Package: `@juuso.piikkila/eslint-config-typescript` (published to npm)
10
+ - Key entry points:
11
+ - `index.mjs` — package export that composes base + TypeScript configurations.
12
+ - `eslint.config.mjs` — ESLint configuration used when linting this repo directly.
13
+ - `configurations/` — modular rule sets (see `base/`, `typescript/`, `vue/`).
14
+ - `test/` — Vitest tests for rule validation.
15
+ - `test-fixtures/` — fixture files for testing specific rule behaviors.
16
+
17
+ ## What to change and where (high-value areas)
18
+
19
+ - **Add or tweak rules**: edit `configurations/*/index.mjs`.
20
+ - `base/index.mjs` composes canonical and stylistic rules and sets project-wide stylistic choices (indentation 4 spaces, max-len 120, trailing commas, import sorting with `perfectionist/sort-imports`).
21
+ - `typescript/index.mjs` adds TypeScript-specific rules and languageOptions (note: `parserOptions.project: true` and `extraFileExtensions: ['.vue']`). Includes naming conventions and type-checking rules.
22
+ - `vue/index.mjs` adds Vue.js specific rules, accessibility rules, and Vue parser configuration.
23
+
24
+ - **Compose exports**: `index.mjs` aggregates the configurations. Default export spreads `base` and `typescript` (Vue is opt-in). If you add a new configuration (e.g., `node`), import and spread it into the default array.
25
+
26
+ - **Testing**: add test fixtures in `test-fixtures/` and update `test/lint-rules.test.mjs` when adding or significantly changing rules.
27
+
28
+ ## Conventions and patterns (do not break)
29
+
30
+ - Rule files export arrays of ESLint config objects (not a single object). Files use ESM (`.mjs`) imports/exports.
31
+ - File globs: most configurations target globs such as `**/*.{js,jsx,cjs,mjs,ts,tsx,vue}` — preserve these patterns when adding new rule blocks unless intentionally narrowing scope.
32
+ - Import style: dependencies often import entire recommended sets from `eslint-config-canonical` and spread them (e.g. `...canonical.recommended`). Follow the same pattern for adding upstream presets.
33
+ - Sorting/imports: `perfectionist/sort-imports` is enabled with explicit groupings; avoid disabling globally unless necessary.
34
+
35
+ ## Developer workflows & commands
36
+
37
+ - **Package manager**: Yarn v4 (project specifies `packageManager: "yarn@4.12.0"` and `.yarn/releases/yarn-4.12.0.cjs` is used). Use the repository Yarn when running commands (e.g., `yarn -v` should report v4.x in CI). Avoid changing `packageManager` without updating `.yarnrc.yml`.
38
+ - **Lint**: run `yarn lint` (runs: `eslint "configurations/**/*.mjs" "eslint.config.mjs" "index.mjs"`). This is the primary local check.
39
+ - **Test**: run `yarn test` to execute Vitest tests that validate rules against fixtures. Use `yarn test:watch` for development.
40
+ - **Releases**: semantic-release is configured in `.releaserc.json` and CI (`.github/workflows/main.yml`) uses semantic-release. Maintain Conventional Commits semantics for automated releases (see `.releaserc.json` for release rules).
41
+ - **Dependency updates**: Renovate config `renovate.json` groups minor/major updates and uses semantic commit messages. Keep dependency version style (tilde `~`) — it's intentional to make Renovate open grouped PRs.
42
+
43
+ ## Common change tasks & examples
44
+
45
+ - **To add a new stylistic rule for TypeScript files only**:
46
+ - Edit `configurations/typescript/index.mjs` and add the rule inside the `rules` object in the exported config that targets `**/*.{ts,tsx,vue}`.
47
+ - Example: Adding a rule to enforce return type annotations:
48
+ ```javascript
49
+ '@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true }]
50
+ ```
51
+
52
+ - **To add a new plugin globally**:
53
+ - Add the plugin to `dependencies` in `package.json` and import it at the top of `configurations/base/index.mjs`.
54
+ - Register it in the `plugins` entry of the relevant config object and add rules under `rules`.
55
+ - Example: Adding a new plugin `eslint-plugin-security`:
56
+ ```javascript
57
+ import securityPlugin from 'eslint-plugin-security';
58
+ // ... in config object:
59
+ plugins: {
60
+ security: securityPlugin,
61
+ },
62
+ rules: {
63
+ 'security/detect-object-injection': 'warn',
64
+ }
65
+ ```
66
+
67
+ - **To modify import sorting behavior**:
68
+ - Edit the `perfectionist/sort-imports` rule in `configurations/base/index.mjs`.
69
+ - The `groups` array defines order. Current grouping:
70
+ 1. `type` - All type imports
71
+ 2. `builtin`, `external` - Node built-ins and npm packages
72
+ 3. `internal` - Internal modules
73
+ 4. `parent`, `sibling`, `index` - Relative imports
74
+ 5. `unknown` - Special cases
75
+ - `newlinesBetween: 1` enforces blank lines between groups.
76
+
77
+ - **To add Vue-specific rules**:
78
+ - Edit `configurations/vue/index.mjs` and add rules to the config targeting `**/*.vue` files.
79
+ - Vue config is opt-in; consumers must explicitly import it.
80
+
81
+ - **To add test coverage for a rule**:
82
+ - Create fixtures in `test-fixtures/<rule-name>/` with subdirectories for `valid-*` and `invalid-*` cases.
83
+ - Update `test/lint-rules.test.mjs` to include the new rule test.
84
+ - Each fixture directory should contain representative code that the rule should pass or fail.
85
+
86
+ ## Integration & testing notes for AI edits
87
+
88
+ - Keep changes small and focused. After edits, verify lint script passes locally using the repository Yarn: `yarn lint`.
89
+ - Avoid changing published API shape: the package default export must remain an array of config objects (the library is consumed via `import config from '@.../eslint-config-typescript'`).
90
+ - Do not change `type: "module"` or convert file extensions away from `.mjs` without updating build/consumption expectations.
91
+
92
+ ## Files to reference when making edits
93
+
94
+ - `index.mjs` — where configurations are composed and exported.
95
+ - `eslint.config.mjs` — how this repo is linted; useful when adding repository-only rules.
96
+ - `configurations/base/index.mjs` — global stylistic and canonical rules.
97
+ - `configurations/typescript/index.mjs` — TypeScript specific rules and parserOptions.
98
+ - `configurations/vue/index.mjs` — Vue.js specific rules and parser configuration.
99
+ - `package.json`, `.yarnrc.yml` — package manager and script information.
100
+ - `.releaserc.json`, `.github/workflows/main.yml`, `renovate.json` — release/CI/automation expectations.
101
+ - `README.md` — user-facing documentation with installation, usage, and configuration details.
102
+ - `test/lint-rules.test.mjs` — Vitest tests for validating rule behavior.
103
+ - `test-fixtures/` — sample code for testing specific rules.
104
+
105
+ ## Safety & review guidance
106
+
107
+ - If a change touches dependencies or CI (package.json, `.yarnrc.yml`, workflow files), add a short note in the PR description explaining why it's needed and how it was tested (`yarn lint` results, CI run link).
108
+ - Prefer incremental PRs for rules changes (one plugin or rule group per PR) so maintainers can review behavior and release impact.
109
+
110
+ ---
111
+
112
+ If anything above is unclear or you want more examples (e.g. how to add a `vue`-specific rule set), tell me which area to expand and I will iterate.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## [4.2.0](https://github.com/optioni/eslint-config-typescript/compare/4.1.1...4.2.0) (2026-01-30)
2
+
3
+ ### Features
4
+
5
+ * **deps:** update dependency eslint-config-canonical to ~47.4.0 ([4e76f5e](https://github.com/optioni/eslint-config-typescript/commit/4e76f5e08dba554036e0ffb0568d4bb8bcdabfcf))
6
+ * **deps:** update dependency globals to ~17.1.0 ([7cfe68f](https://github.com/optioni/eslint-config-typescript/commit/7cfe68f3b3b47619ad404298fc112a87088fd7f8))
7
+
8
+ ## [4.1.1](https://github.com/optioni/eslint-config-typescript/compare/4.1.0...4.1.1) (2026-01-23)
9
+
10
+ ### Bug Fixes
11
+
12
+ * fix perfectionist/sort-imports groups ([e6cb074](https://github.com/optioni/eslint-config-typescript/commit/e6cb074d5e03869151b9e2bccacc4d63d4473897))
13
+
1
14
  ## [4.1.0](https://github.com/optioni/eslint-config-typescript/compare/4.0.0...4.1.0) (2026-01-23)
2
15
 
3
16
  ### Features
@@ -134,19 +134,12 @@ export default function createBaseConfig() {
134
134
  'builtin',
135
135
  'external',
136
136
  ],
137
- 'internal-type',
138
137
  'internal',
139
- [
140
- 'parent-type',
141
- 'sibling-type',
142
- 'index-type',
143
- ],
144
138
  [
145
139
  'parent',
146
140
  'sibling',
147
141
  'index',
148
142
  ],
149
- 'object',
150
143
  'unknown',
151
144
  ],
152
145
  ignoreCase: true,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@juuso.piikkila/eslint-config-typescript",
3
3
  "description": "ESLint config for typescript projects",
4
- "version": "4.1.0",
4
+ "version": "4.2.0",
5
5
  "main": "index.mjs",
6
6
  "author": "Juuso Piikkilä",
7
7
  "license": "MIT",
@@ -17,10 +17,10 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "eslint": "~9.39.0",
20
- "eslint-config-canonical": "~47.3.0",
20
+ "eslint-config-canonical": "~47.4.0",
21
21
  "eslint-plugin-vue": "~10.7.0",
22
22
  "eslint-plugin-vuejs-accessibility": "~2.4.0",
23
- "globals": "~17.0.0",
23
+ "globals": "~17.1.0",
24
24
  "vue-eslint-parser": "~10.2.0"
25
25
  },
26
26
  "devDependencies": {