---
source: crates/ruff_linter/src/rules/flake8_type_checking/mod.rs
---
TC008 [*] Remove quotes from type alias
  --> TC008_typing_execution_context.py:13:20
   |
11 |     Bar: TypeAlias = Foo[int]
12 |
13 |     a: TypeAlias = 'int'  # TC008
   |                    ^^^^^
14 |     b: TypeAlias = 'Dict'  # TC008
15 |     c: TypeAlias = 'Foo'   # TC008
   |
help: Remove quotes
   |
12 |
   -     a: TypeAlias = 'int'  # TC008
13 +     a: TypeAlias = int  # TC008
14 |     b: TypeAlias = 'Dict'  # TC008
   |

TC008 [*] Remove quotes from type alias
  --> TC008_typing_execution_context.py:14:20
   |
13 |     a: TypeAlias = 'int'  # TC008
14 |     b: TypeAlias = 'Dict'  # TC008
   |                    ^^^^^^
15 |     c: TypeAlias = 'Foo'   # TC008
16 |     d: TypeAlias = 'Foo[str]'  # TC008
   |
help: Remove quotes
   |
13 |     a: TypeAlias = 'int'  # TC008
   -     b: TypeAlias = 'Dict'  # TC008
14 +     b: TypeAlias = Dict  # TC008
15 |     c: TypeAlias = 'Foo'   # TC008
   |

TC008 [*] Remove quotes from type alias
  --> TC008_typing_execution_context.py:15:20
   |
13 |     a: TypeAlias = 'int'  # TC008
14 |     b: TypeAlias = 'Dict'  # TC008
15 |     c: TypeAlias = 'Foo'   # TC008
   |                    ^^^^^
16 |     d: TypeAlias = 'Foo[str]'  # TC008
17 |     e: TypeAlias = 'Foo.bar'  # TC008
   |
help: Remove quotes
   |
14 |     b: TypeAlias = 'Dict'  # TC008
   -     c: TypeAlias = 'Foo'   # TC008
15 +     c: TypeAlias = Foo   # TC008
16 |     d: TypeAlias = 'Foo[str]'  # TC008
   |

TC008 [*] Remove quotes from type alias
  --> TC008_typing_execution_context.py:16:20
   |
14 |     b: TypeAlias = 'Dict'  # TC008
15 |     c: TypeAlias = 'Foo'   # TC008
16 |     d: TypeAlias = 'Foo[str]'  # TC008
   |                    ^^^^^^^^^^
17 |     e: TypeAlias = 'Foo.bar'  # TC008
18 |     f: TypeAlias = 'Foo | None'  # TC008
   |
help: Remove quotes
   |
15 |     c: TypeAlias = 'Foo'   # TC008
   -     d: TypeAlias = 'Foo[str]'  # TC008
16 +     d: TypeAlias = Foo[str]  # TC008
17 |     e: TypeAlias = 'Foo.bar'  # TC008
   |

TC008 [*] Remove quotes from type alias
  --> TC008_typing_execution_context.py:17:20
   |
15 |     c: TypeAlias = 'Foo'   # TC008
16 |     d: TypeAlias = 'Foo[str]'  # TC008
17 |     e: TypeAlias = 'Foo.bar'  # TC008
   |                    ^^^^^^^^^
18 |     f: TypeAlias = 'Foo | None'  # TC008
19 |     g: TypeAlias = 'OptStr'   # TC008
   |
help: Remove quotes
   |
16 |     d: TypeAlias = 'Foo[str]'  # TC008
   -     e: TypeAlias = 'Foo.bar'  # TC008
17 +     e: TypeAlias = Foo.bar  # TC008
18 |     f: TypeAlias = 'Foo | None'  # TC008
   |

TC008 [*] Remove quotes from type alias
  --> TC008_typing_execution_context.py:18:20
   |
16 |     d: TypeAlias = 'Foo[str]'  # TC008
17 |     e: TypeAlias = 'Foo.bar'  # TC008
18 |     f: TypeAlias = 'Foo | None'  # TC008
   |                    ^^^^^^^^^^^^
19 |     g: TypeAlias = 'OptStr'   # TC008
20 |     h: TypeAlias = 'Bar'   # TC008
   |
help: Remove quotes
   |
17 |     e: TypeAlias = 'Foo.bar'  # TC008
   -     f: TypeAlias = 'Foo | None'  # TC008
18 +     f: TypeAlias = Foo | None  # TC008
19 |     g: TypeAlias = 'OptStr'   # TC008
   |

TC008 [*] Remove quotes from type alias
  --> TC008_typing_execution_context.py:19:20
   |
17 |     e: TypeAlias = 'Foo.bar'  # TC008
18 |     f: TypeAlias = 'Foo | None'  # TC008
19 |     g: TypeAlias = 'OptStr'   # TC008
   |                    ^^^^^^^^
20 |     h: TypeAlias = 'Bar'   # TC008
21 |     i: TypeAlias = Foo['str']   # TC008
   |
help: Remove quotes
   |
18 |     f: TypeAlias = 'Foo | None'  # TC008
   -     g: TypeAlias = 'OptStr'   # TC008
19 +     g: TypeAlias = OptStr   # TC008
20 |     h: TypeAlias = 'Bar'   # TC008
   |

TC008 [*] Remove quotes from type alias
  --> TC008_typing_execution_context.py:20:20
   |
18 |     f: TypeAlias = 'Foo | None'  # TC008
19 |     g: TypeAlias = 'OptStr'   # TC008
20 |     h: TypeAlias = 'Bar'   # TC008
   |                    ^^^^^
21 |     i: TypeAlias = Foo['str']   # TC008
22 |     j: TypeAlias = 'Baz'   # OK (this would be treated as use before define)
   |
help: Remove quotes
   |
19 |     g: TypeAlias = 'OptStr'   # TC008
   -     h: TypeAlias = 'Bar'   # TC008
20 +     h: TypeAlias = Bar   # TC008
21 |     i: TypeAlias = Foo['str']   # TC008
   |

TC008 [*] Remove quotes from type alias
  --> TC008_typing_execution_context.py:21:24
   |
19 |     g: TypeAlias = 'OptStr'   # TC008
20 |     h: TypeAlias = 'Bar'   # TC008
21 |     i: TypeAlias = Foo['str']   # TC008
   |                        ^^^^^
22 |     j: TypeAlias = 'Baz'   # OK (this would be treated as use before define)
23 |     k: TypeAlias = 'k | None'  # False negative in type checking block
   |
help: Remove quotes
   |
20 |     h: TypeAlias = 'Bar'   # TC008
   -     i: TypeAlias = Foo['str']   # TC008
21 +     i: TypeAlias = Foo[str]   # TC008
22 |     j: TypeAlias = 'Baz'   # OK (this would be treated as use before define)
   |

TC008 [*] Remove quotes from type alias
  --> TC008_typing_execution_context.py:24:20
   |
22 |     j: TypeAlias = 'Baz'   # OK (this would be treated as use before define)
23 |     k: TypeAlias = 'k | None'  # False negative in type checking block
24 |     l: TypeAlias = 'int' | None  # TC008 (because TC010 is not enabled)
   |                    ^^^^^
25 |     m: TypeAlias = ('int'  # TC008
26 |         | None)
   |
help: Remove quotes
   |
23 |     k: TypeAlias = 'k | None'  # False negative in type checking block
   -     l: TypeAlias = 'int' | None  # TC008 (because TC010 is not enabled)
24 +     l: TypeAlias = int | None  # TC008 (because TC010 is not enabled)
25 |     m: TypeAlias = ('int'  # TC008
   |

TC008 [*] Remove quotes from type alias
  --> TC008_typing_execution_context.py:25:21
   |
23 |     k: TypeAlias = 'k | None'  # False negative in type checking block
24 |     l: TypeAlias = 'int' | None  # TC008 (because TC010 is not enabled)
25 |     m: TypeAlias = ('int'  # TC008
   |                     ^^^^^
26 |         | None)
27 |     n: TypeAlias = ('int'  # TC008 (fix removes comment currently)
   |
help: Remove quotes
   |
24 |     l: TypeAlias = 'int' | None  # TC008 (because TC010 is not enabled)
   -     m: TypeAlias = ('int'  # TC008
25 +     m: TypeAlias = (int  # TC008
26 |         | None)
   |

TC008 [*] Remove quotes from type alias
  --> TC008_typing_execution_context.py:27:21
   |
25 |       m: TypeAlias = ('int'  # TC008
26 |           | None)
27 |       n: TypeAlias = ('int'  # TC008 (fix removes comment currently)
   |  _____________________^
28 | |         ' | None')
   | |_________________^
   |
help: Remove quotes
   |
26 |         | None)
   -     n: TypeAlias = ('int'  # TC008 (fix removes comment currently)
   -         ' | None')
27 +     n: TypeAlias = (int | None)
28 |
   |
note: This is an unsafe fix and may change runtime behavior
