ts-standard
TypeScript Standard Style is the TypeScript edition of the popular JavaScript Standard Style that brings zero-configuration linting and formatting to TypeScript projects. It extends the proven JavaScript Standard rules with TypeScript-specific enhancements and type-aware analysis.
Key Features:
- Zero Configuration: No setup files or configuration required - install and run immediately
 - TypeScript-Aware: Built-in understanding of TypeScript syntax, types, interfaces, and modern features
 - Automatic Fixing: Built-in 
--fixoption automatically corrects most style violations and type issues - Standard Rules: Maintains the same proven style rules as JavaScript Standard (2-space indent, single quotes, no semicolons)
 - Type Safety: Enforces TypeScript best practices and type safety patterns
 - Fast Performance: Quick analysis suitable for large TypeScript codebases
 - Wide Adoption: Used by TypeScript projects that prefer the Standard style approach over ESLint configurations
 - Consistent Output: Deterministic formatting across different development environments and team members
 
ts-standard documentation
- Version in MegaLinter: 12.0.2
 - Visit Official Web Site
 - See How to configure ts-standard rules
 - See How to disable ts-standard rules in files
 - See Index of problems detected by ts-standard
 
Configuration in MegaLinter
- Enable ts-standard by adding 
TYPESCRIPT_STANDARDin ENABLE_LINTERS variable - Disable ts-standard by adding 
TYPESCRIPT_STANDARDin DISABLE_LINTERS variable 
- Enable autofixes by adding 
TYPESCRIPT_STANDARDin APPLY_FIXES variable 
| Variable | Description | Default value | 
|---|---|---|
| TYPESCRIPT_STANDARD | For ts-standard to be active, TYPESCRIPT_STANDARD must be ts-standard | 
ts-standard | 
| TYPESCRIPT_STANDARD_ARGUMENTS | User custom arguments to add in linter CLI call Ex: -s --foo "bar" | 
|
| TYPESCRIPT_STANDARD_COMMAND_REMOVE_ARGUMENTS | User custom arguments to remove from command line before calling the linter Ex: -s --foo "bar" | 
|
| TYPESCRIPT_STANDARD_FILTER_REGEX_INCLUDE | Custom regex including filter Ex: (src\|lib) | 
Include every file | 
| TYPESCRIPT_STANDARD_FILTER_REGEX_EXCLUDE | Custom regex excluding filter Ex: (test\|examples) | 
Exclude no file | 
| TYPESCRIPT_STANDARD_CLI_LINT_MODE | Override default CLI lint mode - file: Calls the linter for each file- list_of_files: Call the linter with the list of files as argument- project: Call the linter from the root of the project | 
list_of_files | 
| TYPESCRIPT_STANDARD_FILE_EXTENSIONS | Allowed file extensions. "*" matches any extension, "" matches empty extension. Empty list excludes all filesEx: [".py", ""] | 
[".ts"] | 
| TYPESCRIPT_STANDARD_FILE_NAMES_REGEX | File name regex filters. Regular expression list for filtering files by their base names using regex full match. Empty list includes all files Ex: ["Dockerfile(-.+)?", "Jenkinsfile"] | 
Include every file | 
| TYPESCRIPT_STANDARD_PRE_COMMANDS | List of bash commands to run before the linter | None | 
| TYPESCRIPT_STANDARD_POST_COMMANDS | List of bash commands to run after the linter | None | 
| TYPESCRIPT_STANDARD_UNSECURED_ENV_VARIABLES | List of env variables explicitly not filtered before calling TYPESCRIPT_STANDARD and its pre/post commands | None | 
| TYPESCRIPT_STANDARD_DISABLE_ERRORS | Run linter but consider errors as warnings | false | 
| TYPESCRIPT_STANDARD_DISABLE_ERRORS_IF_LESS_THAN | Maximum number of errors allowed | 0 | 
| TYPESCRIPT_STANDARD_CLI_EXECUTABLE | Override CLI executable | ['ts-standard'] | 
IDE Integration
Use ts-standard in your favorite IDE to catch errors before MegaLinter !
MegaLinter Flavors
This linter is available in the following flavors
| Flavor | Description | Embedded linters | Info | |
|---|---|---|---|---|
![]()  | 
all | Default MegaLinter Flavor | 127 | |
| cupcake | MegaLinter for the most commonly used languages | 87 | ||
| dotnetweb | Optimized for C, C++, C# or VB based projects with JS/TS | 72 | ||
| javascript | Optimized for JAVASCRIPT or TYPESCRIPT based projects | 58 | 
Behind the scenes
How are identified applicable files
- File extensions: 
.ts 
How the linting is performed
- ts-standard is called once with the list of files as arguments (
list_of_filesCLI lint mode) 
Example calls
ts-standard myfile.ts
ts-standard --fix myfile.ts
Help content
ts-standard - Standard for TypeScript! (https://github.com/standard/ts-standard)
Usage:
  ts-standard <flags> [FILES...]
  If FILES is omitted, all JavaScript/TypeScript source files (*.js, *.jsx, *.mjs, *.cjs, *.ts, *.tsx)
  in the current working directory are checked, recursively.
  Certain paths (node_modules/, coverage/, vendor/, *.min.js, and
  files/folders that begin with '.' like .git/) are automatically ignored.
  Paths in a project's root .gitignore file are also automatically ignored.
Flags:
      --fix       Automatically fix problems
  -p, --project   Specify ts-config location (default: ./tsconfig.eslint.json or ./tsconfig.json)
      --version   Show current version
  -h, --help      Show usage information
Flags (advanced):
      --stdin     Read file text from stdin
      --ext       Specify JavaScript/TypeScript file extensions
      --global    Declare global variable
      --plugin    Use custom eslint plugin
      --env       Use custom eslint environment
      --parser    Use custom ts/js parser (default: @typescript-eslint/parser)
Installation on mega-linter Docker image
- Dockerfile commands :
 
# Parent descriptor install
# renovate: datasource=npm depName=typescript
ARG NPM_TYPESCRIPT_VERSION=5.9.3
# Linter install
# renovate: datasource=npm depName=ts-standard
ARG NPM_TS_STANDARD_VERSION=12.0.2
- NPM packages (node.js):
 
  