@juuso.piikkila/eslint-config-typescript 3.4.0 → 3.5.4
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/CHANGELOG.md +33 -0
- package/README.md +131 -1
- package/configurations/base/index.mjs +2 -1
- package/eslint.config.mjs +5 -3
- package/index.mjs +2 -2
- package/package.json +10 -7
- package/vitest.config.mjs +10 -0
- package/.nvmrc +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,36 @@
|
|
|
1
|
+
## [3.5.4](https://github.com/optioni/eslint-config-typescript/compare/3.5.3...3.5.4) (2025-12-19)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* Revert "chore: remove npmrc" ([d2a3491](https://github.com/optioni/eslint-config-typescript/commit/d2a34915435779846c421947d1b53cfd680b170e))
|
|
6
|
+
* update workflow ([f710c77](https://github.com/optioni/eslint-config-typescript/commit/f710c770653563d63dcb06ea2af2fcc31340edd5))
|
|
7
|
+
|
|
8
|
+
## [3.5.3](https://github.com/optioni/eslint-config-typescript/compare/3.5.2...3.5.3) (2025-12-19)
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* restore npm token ([b415192](https://github.com/optioni/eslint-config-typescript/commit/b415192d9e2f7acf25994b295c0ba437fee84928))
|
|
13
|
+
|
|
14
|
+
## [3.5.2](https://github.com/optioni/eslint-config-typescript/compare/3.5.1...3.5.2) (2025-12-19)
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* update docs ([bb02106](https://github.com/optioni/eslint-config-typescript/commit/bb021066c1f50d7d0501f41870f986daa38b5fd5))
|
|
19
|
+
|
|
20
|
+
## [3.5.1](https://github.com/optioni/eslint-config-typescript/compare/3.5.0...3.5.1) (2025-12-19)
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* disable unicorn/no-array-sort ([60b1325](https://github.com/optioni/eslint-config-typescript/commit/60b1325973faa198fae9ed579e497483fce1df55))
|
|
25
|
+
* fix import paths ([32306bc](https://github.com/optioni/eslint-config-typescript/commit/32306bcc6b0d0ec0c0d51b701d1025ac10097d23))
|
|
26
|
+
* update perfectionist/sort-imports ([0fcb24b](https://github.com/optioni/eslint-config-typescript/commit/0fcb24b9d3be6ce15be08fca63d9fe8471f115b1))
|
|
27
|
+
|
|
28
|
+
## [3.5.0](https://github.com/optioni/eslint-config-typescript/compare/3.4.0...3.5.0) (2025-11-28)
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
|
|
32
|
+
* **deps:** update dependency eslint-plugin-vue to ~10.6.0 ([df4f3eb](https://github.com/optioni/eslint-config-typescript/commit/df4f3eb532b43e765ee80ae3b06fdc68ae9c2e04))
|
|
33
|
+
|
|
1
34
|
## [3.4.0](https://github.com/optioni/eslint-config-typescript/compare/3.3.0...3.4.0) (2025-11-07)
|
|
2
35
|
|
|
3
36
|
### Features
|
package/README.md
CHANGED
|
@@ -3,7 +3,137 @@
|
|
|
3
3
|
ESLint shareable config for TypeScript projects by Juuso Piikkilä.
|
|
4
4
|
|
|
5
5
|
## Purpose
|
|
6
|
-
This repository publishes an ESLint configuration package for TypeScript projects.
|
|
6
|
+
This repository publishes an ESLint configuration package for TypeScript projects. It provides opinionated, production-ready ESLint rules built on top of `eslint-config-canonical` with customizations for TypeScript and Vue.js projects.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install --save-dev @juuso.piikkila/eslint-config-typescript
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
or
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
yarn add -D @juuso.piikkila/eslint-config-typescript
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### Basic Setup (TypeScript)
|
|
23
|
+
|
|
24
|
+
Create an `eslint.config.mjs` file in your project root:
|
|
25
|
+
|
|
26
|
+
```javascript
|
|
27
|
+
import config from '@juuso.piikkila/eslint-config-typescript';
|
|
28
|
+
|
|
29
|
+
export default config;
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
This includes both the base configuration and TypeScript-specific rules.
|
|
33
|
+
|
|
34
|
+
### Custom Configuration
|
|
35
|
+
|
|
36
|
+
You can extend or override the configuration:
|
|
37
|
+
|
|
38
|
+
```javascript
|
|
39
|
+
import config from '@juuso.piikkila/eslint-config-typescript';
|
|
40
|
+
|
|
41
|
+
export default [
|
|
42
|
+
...config,
|
|
43
|
+
{
|
|
44
|
+
rules: {
|
|
45
|
+
// Your custom rules here
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Modular Configurations
|
|
52
|
+
|
|
53
|
+
The package exports modular configurations that you can compose:
|
|
54
|
+
|
|
55
|
+
```javascript
|
|
56
|
+
import base from '@juuso.piikkila/eslint-config-typescript/configurations/base/index.mjs';
|
|
57
|
+
import typescript from '@juuso.piikkila/eslint-config-typescript/configurations/typescript/index.mjs';
|
|
58
|
+
import vue from '@juuso.piikkila/eslint-config-typescript/configurations/vue/index.mjs';
|
|
59
|
+
|
|
60
|
+
export default [
|
|
61
|
+
...base,
|
|
62
|
+
...typescript,
|
|
63
|
+
...vue, // Add if using Vue.js
|
|
64
|
+
];
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Configuration Modules
|
|
68
|
+
|
|
69
|
+
### Base Configuration
|
|
70
|
+
- **Built on**: `eslint-config-canonical` (canonical + regexp presets)
|
|
71
|
+
- **Key features**:
|
|
72
|
+
- 4-space indentation
|
|
73
|
+
- Max line length: 120 characters
|
|
74
|
+
- Consistent array/object formatting
|
|
75
|
+
- Enforces trailing commas in multiline structures
|
|
76
|
+
- Sorted imports with `perfectionist/sort-imports`
|
|
77
|
+
- Numeric separators for readability (e.g., `10_000`)
|
|
78
|
+
- Arrow functions: concise style when possible
|
|
79
|
+
- Function declarations preferred (arrow functions allowed)
|
|
80
|
+
|
|
81
|
+
### TypeScript Configuration
|
|
82
|
+
- **Built on**: `eslint-config-canonical/typescript` + type-checking rules
|
|
83
|
+
- **Key features**:
|
|
84
|
+
- Interfaces preferred over type aliases
|
|
85
|
+
- Strict naming conventions:
|
|
86
|
+
- Variables: `camelCase`, `UPPER_CASE`, or `PascalCase`
|
|
87
|
+
- Parameters: `camelCase` (leading underscore allowed)
|
|
88
|
+
- Enum members: `UPPER_CASE`
|
|
89
|
+
- Types/Interfaces: `PascalCase`
|
|
90
|
+
- No extraneous classes (except with decorators)
|
|
91
|
+
- TypeScript member delimiter: none for multiline, semicolon for single-line
|
|
92
|
+
- Type-checked rules enabled (requires `tsconfig.json`)
|
|
93
|
+
|
|
94
|
+
### Vue Configuration
|
|
95
|
+
- **Built on**: `eslint-plugin-vue` (recommended) + `eslint-plugin-vuejs-accessibility`
|
|
96
|
+
- **Key features**:
|
|
97
|
+
- 4-space HTML indentation
|
|
98
|
+
- Component names: `PascalCase`
|
|
99
|
+
- Custom events: `kebab-case`
|
|
100
|
+
- Attribute hyphenation: always
|
|
101
|
+
- Self-closing components: always for non-HTML elements
|
|
102
|
+
- Multi-word component names enforced
|
|
103
|
+
- Accessibility (a11y) rules enabled
|
|
104
|
+
|
|
105
|
+
## Highlighted Rules
|
|
106
|
+
|
|
107
|
+
### Import Sorting (`perfectionist/sort-imports`)
|
|
108
|
+
Imports are automatically sorted with blank lines between groups:
|
|
109
|
+
1. Type imports
|
|
110
|
+
2. Built-in and external modules
|
|
111
|
+
3. Internal type imports
|
|
112
|
+
4. Internal modules
|
|
113
|
+
5. Parent/sibling/index type imports
|
|
114
|
+
6. Parent/sibling/index modules
|
|
115
|
+
7. Object imports
|
|
116
|
+
8. Unknown imports
|
|
117
|
+
|
|
118
|
+
### Numeric Separators (`unicorn/numeric-separators-style`)
|
|
119
|
+
- Numbers ≥ 10,000: grouped by thousands (e.g., `10_000`)
|
|
120
|
+
- Hexadecimal: grouped by 2 digits (e.g., `0xFF_FF`)
|
|
121
|
+
- Binary/Octal: grouped by 4 digits
|
|
122
|
+
|
|
123
|
+
## TypeScript Project Setup
|
|
124
|
+
|
|
125
|
+
This configuration requires a `tsconfig.json` in your project root for type-checked rules to work. Example:
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"compilerOptions": {
|
|
130
|
+
"strict": true,
|
|
131
|
+
"target": "ES2020",
|
|
132
|
+
"module": "ESNext"
|
|
133
|
+
},
|
|
134
|
+
"include": ["src/**/*"]
|
|
135
|
+
}
|
|
136
|
+
```
|
|
7
137
|
|
|
8
138
|
## Release & dependency automation
|
|
9
139
|
- Renovate is configured to:
|
|
@@ -145,7 +145,7 @@ export default [
|
|
|
145
145
|
],
|
|
146
146
|
ignoreCase: true,
|
|
147
147
|
maxLineLength: undefined,
|
|
148
|
-
newlinesBetween:
|
|
148
|
+
newlinesBetween: 1,
|
|
149
149
|
type: 'natural',
|
|
150
150
|
},
|
|
151
151
|
],
|
|
@@ -177,6 +177,7 @@ export default [
|
|
|
177
177
|
},
|
|
178
178
|
},
|
|
179
179
|
],
|
|
180
|
+
'unicorn/no-array-sort': 'off',
|
|
180
181
|
},
|
|
181
182
|
},
|
|
182
183
|
];
|
package/eslint.config.mjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
import base from './configurations/base/index.mjs';
|
|
2
|
+
import typescript from './configurations/typescript/index.mjs';
|
|
3
3
|
|
|
4
4
|
export default [
|
|
5
|
-
...
|
|
5
|
+
...base,
|
|
6
|
+
...typescript,
|
|
6
7
|
{
|
|
7
8
|
rules: {
|
|
8
9
|
'import/no-extraneous-dependencies': 'off',
|
|
10
|
+
'import/no-useless-path-segments': 'off',
|
|
9
11
|
},
|
|
10
12
|
},
|
|
11
13
|
];
|
package/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juuso.piikkila/eslint-config-typescript",
|
|
3
3
|
"description": "ESLint config for typescript projects",
|
|
4
|
-
"version": "3.4
|
|
4
|
+
"version": "3.5.4",
|
|
5
5
|
"main": "index.mjs",
|
|
6
6
|
"author": "Juuso Piikkilä",
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"packageManager": "yarn@4.
|
|
8
|
+
"packageManager": "yarn@4.12.0",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
|
-
"lint": "eslint \"configurations/**/*.mjs\" \"eslint.config.mjs\" \"index.mjs\""
|
|
14
|
+
"lint": "eslint \"configurations/**/*.mjs\" \"eslint.config.mjs\" \"index.mjs\"",
|
|
15
|
+
"test": "vitest run",
|
|
16
|
+
"test:watch": "vitest"
|
|
15
17
|
},
|
|
16
18
|
"dependencies": {
|
|
17
19
|
"eslint": "~9.39.0",
|
|
18
|
-
"eslint-config-canonical": "~
|
|
19
|
-
"eslint-plugin-vue": "~10.
|
|
20
|
+
"eslint-config-canonical": "~47.3.0",
|
|
21
|
+
"eslint-plugin-vue": "~10.6.0",
|
|
20
22
|
"eslint-plugin-vuejs-accessibility": "~2.4.0",
|
|
21
23
|
"globals": "~16.5.0",
|
|
22
24
|
"vue-eslint-parser": "~10.2.0"
|
|
@@ -25,7 +27,8 @@
|
|
|
25
27
|
"@semantic-release/changelog": "^6.0.1",
|
|
26
28
|
"@semantic-release/git": "^10.0.1",
|
|
27
29
|
"conventional-changelog-conventionalcommits": "^9.0.0",
|
|
28
|
-
"semantic-release": "^
|
|
29
|
-
"typescript": "^5.9.3"
|
|
30
|
+
"semantic-release": "^25.0.0",
|
|
31
|
+
"typescript": "^5.9.3",
|
|
32
|
+
"vitest": "^4.0.16"
|
|
30
33
|
}
|
|
31
34
|
}
|
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
24.11
|