@open-turo/eslint-config-typescript 16.0.7 → 17.0.0-pr-382.66.1.1
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/docs/breaking-changes/v17.md +3 -0
- package/index.cjs +5 -0
- package/pack/open-turo-eslint-config-typescript-17.0.0-pr-382.66.1.1.tgz +0 -0
- package/package.json +8 -7
- package/recommended.cjs +5 -0
- package/test/__snapshots__/test.spec.js.snap +19 -1
- package/pack/open-turo-eslint-config-typescript-16.0.7.tgz +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Breaking changes in v17
|
|
2
|
+
|
|
3
|
+
Adds `@typescript-eslint/consistent-type-assertions` configuration, which will raise errors in consumer repos. We have multiple years of relying on `as` casting as a TypeScript work-around (which is dangerous, compared to type-narrowing in runtime code) in our code, so this specific rule change will require a large amount of effort for compliance--even if adding `// eslint-disable` to all existing instances, or adding [eslint-seatbelt](https://www.notion.com/blog/how-we-evolved-our-code-notions-ratcheting-system-using-custom-eslint-rules)--and so we are marking it as a new major version.
|
package/index.cjs
CHANGED
|
@@ -115,6 +115,11 @@ const typescriptConfig = () =>
|
|
|
115
115
|
files: [FILES_TS, FILES_TSX],
|
|
116
116
|
languageOptions: typescriptLanguageOptions(),
|
|
117
117
|
rules: {
|
|
118
|
+
/** Forbids `as` casting (that excludes `as const`) to prevent unsafe type casts */
|
|
119
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
120
|
+
"error",
|
|
121
|
+
{ assertionStyle: "never" },
|
|
122
|
+
],
|
|
118
123
|
/**
|
|
119
124
|
* {@link https://typescript-eslint.io/rules/consistent-type-imports | TypeScript ESLint: consistent-type-imports docs}
|
|
120
125
|
*/
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
"description": "Turo eslint configuration for typescript",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@eslint/js": "9.
|
|
7
|
-
"typescript-eslint": "8.34.
|
|
8
|
-
"@typescript-eslint/eslint-plugin": "8.34.
|
|
9
|
-
"@typescript-eslint/parser": "8.34.
|
|
6
|
+
"@eslint/js": "9.28.0",
|
|
7
|
+
"typescript-eslint": "8.34.0",
|
|
8
|
+
"@typescript-eslint/eslint-plugin": "8.34.0",
|
|
9
|
+
"@typescript-eslint/parser": "8.34.0",
|
|
10
10
|
"eslint-config-prettier": "10.1.5",
|
|
11
11
|
"eslint-import-resolver-typescript": "4.4.3",
|
|
12
12
|
"eslint-plugin-import": "2.31.0",
|
|
13
|
-
"eslint-plugin-jest": "28.
|
|
13
|
+
"eslint-plugin-jest": "28.13.3",
|
|
14
14
|
"eslint-plugin-json": "4.0.1",
|
|
15
15
|
"eslint-plugin-n": "17.20.0",
|
|
16
16
|
"eslint-plugin-perfectionist": "4.14.0",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"eslint-plugin-unicorn": "56.0.1"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"eslint": "9.
|
|
22
|
+
"eslint": "9.28.0",
|
|
23
23
|
"jest": "30.0.0",
|
|
24
24
|
"prettier": "3.5.3"
|
|
25
25
|
},
|
|
@@ -54,5 +54,6 @@
|
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
56
|
"repository": "https://github.com/open-turo/eslint-config-typescript",
|
|
57
|
-
"version": "
|
|
57
|
+
"version": "17.0.0-pr-382.66.1.1",
|
|
58
|
+
"packageManager": "npm@11.4.2+sha512.f90c1ec8b207b625d6edb6693aef23dacb39c38e4217fe8c46a973f119cab392ac0de23fe3f07e583188dae9fd9108b3845ad6f525b598742bd060ebad60bff3"
|
|
58
59
|
}
|
package/recommended.cjs
CHANGED
|
@@ -48,6 +48,11 @@ module.exports = {
|
|
|
48
48
|
],
|
|
49
49
|
root: true,
|
|
50
50
|
rules: {
|
|
51
|
+
/** Forbids `as` casting (that excludes `as const`) to prevent unsafe type casts */
|
|
52
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
53
|
+
"error",
|
|
54
|
+
{ assertionStyle: "never" },
|
|
55
|
+
],
|
|
51
56
|
/**
|
|
52
57
|
* {@link https://typescript-eslint.io/rules/consistent-type-imports | TypeScript ESLint: consistent-type-imports docs}
|
|
53
58
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://
|
|
1
|
+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
3
|
exports[`validate config the flat config is correct for index.cjs 1`] = `
|
|
4
4
|
{
|
|
@@ -566,6 +566,12 @@ exports[`validate config the flat config is correct for index.cjs 1`] = `
|
|
|
566
566
|
"@typescript-eslint/comma-spacing": [
|
|
567
567
|
0,
|
|
568
568
|
],
|
|
569
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
570
|
+
2,
|
|
571
|
+
{
|
|
572
|
+
"assertionStyle": "never",
|
|
573
|
+
},
|
|
574
|
+
],
|
|
569
575
|
"@typescript-eslint/consistent-type-imports": [
|
|
570
576
|
2,
|
|
571
577
|
{
|
|
@@ -3535,6 +3541,12 @@ exports[`validate config the flat config is correct for index.mjs 1`] = `
|
|
|
3535
3541
|
"@typescript-eslint/comma-spacing": [
|
|
3536
3542
|
0,
|
|
3537
3543
|
],
|
|
3544
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
3545
|
+
2,
|
|
3546
|
+
{
|
|
3547
|
+
"assertionStyle": "never",
|
|
3548
|
+
},
|
|
3549
|
+
],
|
|
3538
3550
|
"@typescript-eslint/consistent-type-imports": [
|
|
3539
3551
|
2,
|
|
3540
3552
|
{
|
|
@@ -6507,6 +6519,12 @@ exports[`validate config the legacy recommended config is correct 1`] = `
|
|
|
6507
6519
|
"@typescript-eslint/comma-spacing": [
|
|
6508
6520
|
"off",
|
|
6509
6521
|
],
|
|
6522
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
6523
|
+
"error",
|
|
6524
|
+
{
|
|
6525
|
+
"assertionStyle": "never",
|
|
6526
|
+
},
|
|
6527
|
+
],
|
|
6510
6528
|
"@typescript-eslint/consistent-type-imports": [
|
|
6511
6529
|
"error",
|
|
6512
6530
|
{
|
|
Binary file
|