Pylance Strict 모드 설정
VS Code Pylance Strict 모드로 타입 체크 강화
Pylance Strict 모드 설정으로 VS Code에서 파이썬 타입 체크를 빡세게 할 수 있어.
설정 방법:
1. Cmd+Shift+P (macOS) 또는 Ctrl+Shift+P (Windows/Linux) 눌러서 커맨드 팔레트 열기.
2. "Preferences: Open Settings (JSON)" 검색해서 선택.
JSON 설정:
{
"python.analysis.typeCheckingMode": "strict",
"python.analysis.autoImportCompletions": true,
"python.analysis.exclude": ["**/node_modules", "env/**"]
}
주요 설정:
* python.analysis.typeCheckingMode: 타입 체크 레벨을 strict로 설정해서 엄격하게 검사함. off, basic, standard도 있음.
* python.analysis.exclude: node_modules나 env 같은 특정 파일/폴더는 타입 체크에서 제외할 때 씀.
* python.analysis.autoImportCompletions: 자동 임포트 기능을 활성화할지 결정함.
여기서 배울 것
- Pylance Strict 모드 설정으로 타입 체크 강화
- VS Code 설정 JSON 파일 편집 방법
- Pylance의 주요 타입 체크 설정 옵션 이해
- 특정 파일/폴더를 타입 체크에서 제외하는 방법
원본 파일 보기 (.claude/skills/tn-pylance-strict/SKILL.md)
---
name: Pylance Strict Mode 설정
description: This skill should be used when the user asks to configure Pylance for strict type checking in VS Code, or to adjust Pylance settings such as `exclude` paths or `autoImportCompletions`.
version: 1.0.0
source: /home/son/prj/resume/backup_notes_260317/notion/Tech Note/pylance strict 2f4d7efd824b80039222e53e5ab3b42d.md
---
# pylance strict
Cmd+Shift+P
**"Preferences: Open Settings (JSON)"**
```json
{
"python.analysis.typeCheckingMode": "strict",
"python.analysis.autoImportCompletions": true,
"python.analysis.exclude": ["**/node_modules", "env/**"]
}
```
- `python.analysis.typeCheckingMode` - Type checking level (`off`, `basic`, `standard`, `strict`)
- `python.analysis.exclude` - Ignore files/folders (e.g., .venv, `build`)
- `python.analysis.diagnosticMode` - Analyze all files or only open files
- `python.analysis.extraPaths` - Add custom import directories