mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-10-28 08:26:01 +08:00
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
113 lines
2.4 KiB
YAML
113 lines
2.4 KiB
YAML
# yaml-language-server: $schema=https://golangci-lint.run/jsonschema/golangci.jsonschema.json
|
|
|
|
version: '2'
|
|
|
|
run:
|
|
allow-parallel-runners: true
|
|
|
|
linters:
|
|
default: none
|
|
enable:
|
|
# Enabled
|
|
- asasalint
|
|
- bidichk
|
|
- bodyclose
|
|
- canonicalheader
|
|
- copyloopvar
|
|
- customlint
|
|
- depguard
|
|
- durationcheck
|
|
- errcheck
|
|
- errchkjson
|
|
- errname
|
|
- errorlint
|
|
- fatcontext
|
|
- forbidigo
|
|
- gocheckcompilerdirectives
|
|
- goprintffuncname
|
|
- govet
|
|
- grouper
|
|
- inamedparam
|
|
- ineffassign
|
|
- intrange
|
|
- makezero
|
|
- mirror
|
|
- misspell
|
|
- modernize
|
|
- musttag
|
|
- nakedret
|
|
- nolintlint
|
|
- paralleltest
|
|
- perfsprint
|
|
- predeclared
|
|
- reassign
|
|
- testableexamples
|
|
- tparallel
|
|
- unconvert
|
|
- usestdlibvars
|
|
- usetesting
|
|
|
|
# Need to add headers
|
|
# - goheader
|
|
|
|
# Check
|
|
# - exhaustive
|
|
# - gocritic
|
|
# - gosec
|
|
# - revive
|
|
# - staticcheck
|
|
# - testifylint
|
|
# - unparam
|
|
# - unused
|
|
|
|
settings:
|
|
custom:
|
|
customlint:
|
|
type: module
|
|
|
|
depguard:
|
|
rules:
|
|
main:
|
|
files:
|
|
- '**/tsc/**/*.go'
|
|
deny:
|
|
- pkg: 'encoding/json$'
|
|
desc: 'Use "github.com/microsoft/TypeScript/tsc/internal/json" instead.'
|
|
- pkg: 'encoding/json/v2'
|
|
desc: 'Use "github.com/microsoft/TypeScript/tsc/internal/json" instead.'
|
|
- pkg: 'encoding/json/jsontext'
|
|
desc: 'Use "github.com/microsoft/TypeScript/tsc/internal/json" instead.'
|
|
|
|
forbidigo:
|
|
analyze-types: true
|
|
forbid:
|
|
- pattern: '.*'
|
|
msg: tspath should likely be used instead
|
|
pkg: ^(path|path/filepath)$
|
|
- pattern: '.*'
|
|
msg: a host implementation should likely be used instead
|
|
pkg: ^os(/|$)
|
|
- pattern: 'GOOS'
|
|
msg: a host implementation should likely be used instead
|
|
pkg: ^runtime$
|
|
|
|
exclusions:
|
|
rules:
|
|
- path: internal/fourslash/tests/
|
|
linters:
|
|
- misspell
|
|
- path: 'internal/(repo|testutil|testrunner|vfs|pprof|execute/tsctests|bundled|fswatch|nativepath|osutil)|cmd/tsc'
|
|
text: should likely be used instead
|
|
- path: '(.+)_test\.go$'
|
|
text: should likely be used instead
|
|
- path: 'tools'
|
|
text: should likely be used instead
|
|
|
|
presets:
|
|
- comments
|
|
- std-error-handling
|
|
|
|
issues:
|
|
max-issues-per-linter: 0
|
|
max-same-issues: 0
|