diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index d9f7ae5..6c8a1a3 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,6 +1,6 @@
 repos:
 -   repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: v2.2.3
+    rev: v2.4.0
     hooks:
     -   id: trailing-whitespace
     -   id: end-of-file-fixer
@@ -11,30 +11,30 @@ repos:
     -   id: double-quote-string-fixer
     -   id: name-tests-test
 -   repo: https://gitlab.com/pycqa/flake8
-    rev: 3.7.7
+    rev: 3.7.9
     hooks:
     -   id: flake8
         additional_dependencies: [flake8-typing-imports==1.5.0]
 -   repo: https://github.com/pre-commit/mirrors-autopep8
-    rev: v1.4.4
+    rev: v1.5
     hooks:
     -   id: autopep8
 -   repo: https://github.com/asottile/reorder_python_imports
-    rev: v1.4.0
+    rev: v1.9.0
     hooks:
     -   id: reorder-python-imports
         args: [--py3-plus]
 -   repo: https://github.com/asottile/add-trailing-comma
-    rev: v1.0.0
+    rev: v1.5.0
     hooks:
     -   id: add-trailing-comma
         args: [--py36-plus]
 -   repo: https://github.com/asottile/pyupgrade
-    rev: v1.17.1
+    rev: v1.26.2
     hooks:
     -   id: pyupgrade
         args: [--py36-plus]
 -   repo: https://github.com/pre-commit/mirrors-mypy
-    rev: v0.701
+    rev: v0.761
     hooks:
     -   id: mypy
diff --git a/flake8_typing_imports.py b/flake8_typing_imports.py
index 6271ffb..3d00f8c 100644
--- a/flake8_typing_imports.py
+++ b/flake8_typing_imports.py
@@ -464,7 +464,7 @@ class Visitor(ast.NodeVisitor):
         )
 
     def visit_ImportFrom(self, node: ast.ImportFrom) -> None:
-        if node.module == 'typing' and self._level == 0:
+        if node.level == 0 and node.module == 'typing' and self._level == 0:
             for name in node.names:
                 self.imports[name.name].append((node.lineno, node.col_offset))
                 if not name.asname:

False positive with some.package.typing.SomeType
Types imported from a package path that ends with `.typing` (not just the top-level `typing`) result in false positives.

```
$ find
.
./x
./x/typing.py
./x/__init__.py

$ cat x/typing.py 
ExampleType = str

$ cat x/__init__.py 
from .typing import ExampleType


def foo(ex: ExampleType):
    pass

$ flake8 x
x/__init__.py:1:1: TYP001 guard import by `if False:  # TYPE_CHECKING`: ExampleType (not in 3.5.0, 3.5.1, 3.5.2, 3.5.3, 3.5.4, 3.5.5, 3.5.6, 3.5.7, 3.6.0, 3.6.1, 3.6.2, 3.6.3, 3.6.4, 3.6.5, 3.6.6, 3.6.7, 3.6.8, 3.6.9, 3.7.0, 3.7.1, 3.7.2, 3.7.3, 3.7.4)
```

If `ExampleType` here is imported from somewhere else, e.g. `x.blah`, no such problem.
diff --git a/tests/flake8_typing_imports_test.py b/tests/flake8_typing_imports_test.py
index 294dbcb..2902861 100644
--- a/tests/flake8_typing_imports_test.py
+++ b/tests/flake8_typing_imports_test.py
@@ -100,6 +100,11 @@ def test_guard_by_type_checking():
         assert ret == set()
 
 
+def test_relative_typing_module():
+    ret = results('from .typing import wat')
+    assert ret == set()
+
+
 def test_missing_overload_define():
     with version_ctx(Version(3, 5, 0)):
         ret = results('from typing import overload')

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest numpy>=1.16.0 pandas>=1.0.0
apt-get update apt-get install -y gcc
3.9
requirements-dev.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
cfgv==3.4.0
coverage==7.8.0
distlib==0.3.9
exceptiongroup==1.2.2
filelock==3.18.0
flake8==7.2.0
-e git+https://github.com/asottile/flake8-typing-imports.git@90a95c5fd7c32eb586b1b14df36d37c66ecf1bb2#egg=flake8_typing_imports
identify==2.6.9
iniconfig==2.1.0
mccabe==0.7.0
nodeenv==1.9.1
numpy==2.0.2
packaging==24.2
pandas==2.2.3
platformdirs==4.3.7
pluggy==1.5.0
pre_commit==4.2.0
pycodestyle==2.13.0
pyflakes==3.3.1
pytest==8.3.5
python-dateutil==2.9.0.post0
pytz==2025.2
PyYAML==6.0.2
six==1.17.0
tomli==2.2.1
tzdata==2025.2
virtualenv==20.29.3

name: flake8-typing-imports
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - cfgv==3.4.0
      - coverage==7.8.0
      - distlib==0.3.9
      - exceptiongroup==1.2.2
      - filelock==3.18.0
      - flake8==7.2.0
      - identify==2.6.9
      - iniconfig==2.1.0
      - mccabe==0.7.0
      - nodeenv==1.9.1
      - numpy==2.0.2
      - packaging==24.2
      - pandas==2.2.3
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - pre-commit==4.2.0
      - pycodestyle==2.13.0
      - pyflakes==3.3.1
      - pytest==8.3.5
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - pyyaml==6.0.2
      - six==1.17.0
      - tomli==2.2.1
      - tzdata==2025.2
      - virtualenv==20.29.3
prefix: /opt/conda/envs/flake8-typing-imports

tests/flake8_typing_imports_test.py::test_relative_typing_module
tests/flake8_typing_imports_test.py::test_option_parsing tests/flake8_typing_imports_test.py::test_union_pattern_or_match[Pattern] tests/flake8_typing_imports_test.py::test_union_pattern_or_match[typing.Pattern] tests/flake8_typing_imports_test.py::test_union_pattern_or_match[Match] tests/flake8_typing_imports_test.py::test_union_pattern_or_match[typing.Match] tests/flake8_typing_imports_test.py::test_union_pattern_or_match[Match
tests/flake8_typing_imports_test.py::test_option_parsing_python_requires_setup_cfg tests/flake8_typing_imports_test.py::test_option_parsing_python_requires_more_complicated tests/flake8_typing_imports_test.py::test_option_parsing_minimum_version tests/flake8_typing_imports_test.py::test_option_parsing_error_unknown tests/flake8_typing_imports_test.py::test_missing_guard tests/flake8_typing_imports_test.py::test_missing_guard_3_5_1 tests/flake8_typing_imports_test.py::test_guard_by_False tests/flake8_typing_imports_test.py::test_guard_by_assignment tests/flake8_typing_imports_test.py::test_guard_by_type_checking tests/flake8_typing_imports_test.py::test_missing_overload_define tests/flake8_typing_imports_test.py::test_union_pattern_or_match_noop[neither tests/flake8_typing_imports_test.py::test_union_pattern_or_match_noop[single tests/flake8_typing_imports_test.py::test_union_pattern_or_match_noop[quoted
flake8_typing_imports.py .pre-commit-config.yaml
flake8_typing_imports.py .pre-commit-config.yaml