Skip to content

Commit

Permalink
Merge pull request #1910 from mightyiam/no-unsafe-type-assertions
Browse files Browse the repository at this point in the history
feat: @typescript-eslint/no-unsafe-type-assertion
  • Loading branch information
mightyiam authored Nov 19, 2024
2 parents 57e6299 + f24848b commit da6ffc8
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 200 deletions.
205 changes: 9 additions & 196 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@
"TypeScript"
],
"dependencies": {
"@typescript-eslint/utils": "^8.12.0",
"@typescript-eslint/utils": "^8.15.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-n": "^17.0.0",
"eslint-plugin-promise": "^7.0.0",
"typescript-eslint": "^8.12.0"
"typescript-eslint": "^8.15.0"
},
"peerDependencies": {
"eslint": "^9.0.0",
Expand Down Expand Up @@ -95,6 +95,6 @@
"semver": "7.6.3",
"type-fest": "4.27.0",
"typescript": "5.6.3",
"typescript-eslint_bottom": "npm:typescript-eslint@8.12.0"
"typescript-eslint_bottom": "npm:typescript-eslint@8.15.0"
}
}
1 change: 1 addition & 0 deletions src/plugin-usage/typescript-eslint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ const usage: PluginUsage = {
'no-unsafe-function-type': ['error'],
'no-unsafe-member-access': ['error'],
'no-unsafe-return': ['error'],
'no-unsafe-type-assertion': ['error'],
'no-unsafe-unary-minus': ['error'],
'no-unused-expressions': [
'error',
Expand Down
1 change: 1 addition & 0 deletions src/test/_expected-exported-value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ export const expectedTseslintRules: Record<
'@typescript-eslint/no-unsafe-function-type': ['error'],
'@typescript-eslint/no-unsafe-member-access': ['error'],
'@typescript-eslint/no-unsafe-return': ['error'],
'@typescript-eslint/no-unsafe-type-assertion': ['error'],
'@typescript-eslint/no-unsafe-unary-minus': ['error'],
'@typescript-eslint/no-unused-expressions': [
'error',
Expand Down
1 change: 0 additions & 1 deletion src/test/_rules_to_consider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ export const rulesToConsider: Record<string, string[]> = {
'promise/valid-params',
],
'@typescript-eslint': [
'@typescript-eslint/no-unsafe-type-assertion',
'@typescript-eslint/related-getter-setter-pairs',
'@typescript-eslint/require-await',
'@typescript-eslint/use-unknown-in-catch-callback-variable',
Expand Down
1 change: 1 addition & 0 deletions src/test/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const knownRules = new Map([

const deprecatedKnownRules = [...knownRules.entries()]
.filter(([_name, rule_]) => {
if (typeof rule_ !== 'object' || rule_ === null) throw new Error()
const rule = rule_ as { meta?: { deprecated?: boolean } }
const { meta } = rule
if (meta === undefined) return false
Expand Down

0 comments on commit da6ffc8

Please sign in to comment.