JSPM

mega-linter-runner

5.3.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 24965
  • Score
    100M100P100Q143460F
  • License MIT

Local runner for MegaLinter

Package Exports

  • mega-linter-runner/lib
  • mega-linter-runner/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mega-linter-runner) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

MegaLinter Runner

Version Downloads/week Downloads/total GitHub stars

Docker Pulls MegaLinter codecov Secured with Trivy GitHub Sponsors PRs Welcome Tweet

MegaLinter analyzes 37 languages, 15 formats, 16 tooling formats , copy-pastes and spell in your repository sources, generate reports in several formats, and can even apply formatting and auto-fixes with auto-generated commit or PR, to ensure all your projects are clean, whatever IDE/toolbox are used by their developers !

See MegaLinter Online Documentation Web Site

This package allows to run MegaLinter locally before running it in your CD/CI workflow, or simply to locally apply reformatting and fixes without having to install up to date linters for your files

Screenshot

Installation

Pre-requisites

You need to have NodeJS and Docker installed on your computer to run MegaLinter locally with MegaLinter Runner

Global installation

npm install mega-linter-runner -g

Local installation

npm install mega-linter-runner --save-dev

No installation

You can run mega-linter-runner without installation by using npx

Example:

npx mega-linter-runner -r beta -e 'ENABLE=MARKDOWN,YAML' -e 'SHOW_ELAPSED_TIME=true'

Usage

mega-linter-runner [OPTIONS]

The options are only related to mega-linter-runner. For MegaLinter options, please use a .mega-linter.yml configuration file

Option Description Default
-p
--path
Directory containing the files to lint current directory
--flavor Set this parameter to use a MegaLinter flavor all
-d
--image
You can override the used docker image, including if it is on another docker registry
-e
--env
Environment variables for MegaLinter, following format 'ENV_VAR_NAME=VALUE'
Warning: Quotes are mandatory
--fix Automatically apply formatting and fixes in your files
-r
--release
Allows to override MegaLinter version used v5
-h
--help
Show mega-linter-runner help
-v
--version
Show mega-linter-runner version
-i
--install
Generate MegaLinter configuration files

You can also use npx mega-linter-runner if you do not want to install the package

Examples

mega-linter-runner
mega-linter-runner -p myFolder --fix
mega-linter-runner -r beta -e 'ENABLE=MARKDOWN,YAML' -e 'SHOW_ELAPSED_TIME=true'

Configuration

You can define generate a ready to use .mega-linter.yml configuration file by running npx mega-linter-runner --install at the root of your repository

Runner Install

Linters

Languages

Language Linter Configuration key Format/Fix
BASH bash-exec BASH_EXEC
shellcheck BASH_SHELLCHECK
shfmt BASH_SHFMT ✔️
C cpplint C_CPPLINT
CLOJURE clj-kondo CLOJURE_CLJ_KONDO
COFFEE coffeelint COFFEE_COFFEELINT
C++ (CPP) cpplint CPP_CPPLINT
C# (CSHARP) dotnet-format CSHARP_DOTNET_FORMAT ✔️
DART dartanalyzer DART_DARTANALYZER
GO golangci-lint GO_GOLANGCI_LINT
revive GO_REVIVE
GROOVY npm-groovy-lint GROOVY_NPM_GROOVY_LINT ✔️
JAVA checkstyle JAVA_CHECKSTYLE
JAVASCRIPT eslint JAVASCRIPT_ES ✔️
standard JAVASCRIPT_STANDARD ✔️
prettier JAVASCRIPT_PRETTIER ✔️
JSX eslint JSX_ESLINT ✔️
KOTLIN ktlint KOTLIN_KTLINT ✔️
LUA luacheck LUA_LUACHECK
PERL perlcritic PERL_PERLCRITIC
PHP php PHP_BUILTIN
phpcs PHP_PHPCS
phpstan PHP_PHPSTAN
psalm PHP_PSALM
phplint PHP_PHPLINT
POWERSHELL powershell POWERSHELL_POWERSHELL
PYTHON pylint PYTHON_PYLINT
black PYTHON_BLACK ✔️
flake8 PYTHON_FLAKE8
isort PYTHON_ISORT ✔️
bandit PYTHON_BANDIT
mypy PYTHON_MYPY
R lintr R_LINTR
RAKU raku RAKU_RAKU
RUBY rubocop RUBY_RUBOCOP ✔️
RUST clippy RUST_CLIPPY
SALESFORCE sfdx-scanner-apex SALESFORCE_SFDX_SCANNER_APEX
sfdx-scanner-aura SALESFORCE_SFDX_SCANNER_AURA
sfdx-scanner-lwc SALESFORCE_SFDX_SCANNER_LWC
SCALA scalafix SCALA_SCALAFIX
SQL sql-lint SQL_SQL_LINT
sqlfluff SQL_SQLFLUFF
tsqllint SQL_TSQLLINT
SWIFT swiftlint SWIFT_SWIFTLINT ✔️
TSX eslint TSX_ESLINT ✔️
TYPESCRIPT eslint TYPESCRIPT_ES ✔️
standard TYPESCRIPT_STANDARD ✔️
prettier TYPESCRIPT_PRETTIER ✔️
Visual Basic .NET (VBDOTNET) dotnet-format VBDOTNET_DOTNET_FORMAT ✔️

Formats

Format Linter Configuration key Format/Fix
CSS stylelint CSS_STYLELINT ✔️
scss-lint CSS_SCSS_LINT
ENV dotenv-linter ENV_DOTENV_LINTER ✔️
GRAPHQL graphql-schema-linter GRAPHQL_GRAPHQL_SCHEMA_LINTER
HTML htmlhint HTML_HTMLHINT
JSON jsonlint JSON_JSONLINT
eslint-plugin-jsonc JSON_ESLINT_PLUGIN_JSONC ✔️
v8r JSON_V8R
prettier JSON_PRETTIER ✔️
LATEX chktex LATEX_CHKTEX
MARKDOWN markdownlint MARKDOWN_MARKDOWNLINT ✔️
remark-lint MARKDOWN_REMARK_LINT ✔️
markdown-link-check MARKDOWN_MARKDOWN_LINK_CHECK
markdown-table-formatter MARKDOWN_MARKDOWN_TABLE_FORMATTER ✔️
PROTOBUF protolint PROTOBUF_PROTOLINT ✔️
RST rst-lint RST_RST_LINT
rstcheck RST_RSTCHECK
rstfmt RST_RSTFMT ✔️
XML xmllint XML_XMLLINT
YAML prettier YAML_PRETTIER ✔️
yamllint YAML_YAMLLINT
v8r YAML_V8R

Tooling formats

Tooling format Linter Configuration key Format/Fix
ACTION actionlint ACTION_ACTIONLINT
ANSIBLE ansible-lint ANSIBLE_ANSIBLE_LINT
ARM arm-ttk ARM_ARM_TTK
CLOUDFORMATION cfn-lint CLOUDFORMATION_CFN_LINT
DOCKERFILE dockerfilelint DOCKERFILE_DOCKERFILELINT
hadolint DOCKERFILE_HADOLINT
EDITORCONFIG editorconfig-checker EDITORCONFIG_EDITORCONFIG_CHECKER
GHERKIN gherkin-lint GHERKIN_GHERKIN_LINT
KUBERNETES kubeval KUBERNETES_KUBEVAL
OPENAPI spectral OPENAPI_SPECTRAL
PUPPET puppet-lint PUPPET_PUPPET_LINT ✔️
SNAKEMAKE snakemake SNAKEMAKE_LINT
snakefmt SNAKEMAKE_SNAKEFMT ✔️
TEKTON tekton-lint TEKTON_TEKTON_LINT
TERRAFORM tflint TERRAFORM_TFLINT
terrascan TERRAFORM_TERRASCAN
terragrunt TERRAFORM_TERRAGRUNT ✔️
terraform-fmt TERRAFORM_TERRAFORM_FMT ✔️
checkov TERRAFORM_CHECKOV
kics TERRAFORM_KICS

Other

Code quality checker Linter Configuration key Format/Fix
COPYPASTE jscpd COPYPASTE_JSCPD
CREDENTIALS secretlint CREDENTIALS_SECRETLINT
GIT git_diff GIT_GIT_DIFF
SPELL misspell SPELL_MISSPELL ✔️
cspell SPELL_CSPELL