Skip to main content

Getting started

Install eslint-plugin-secretlint, add one flat-config preset, and run ESLint over the files where you want Secretlint findings in the normal ESLint output.

Installโ€‹

npm install --save-dev eslint-plugin-secretlint

The plugin delegates scanning to Secretlint. Keep Secretlint rule packages and scanning policy in Secretlint config, then use this plugin for ESLint integration and config-file guardrails.

import secretlint from "eslint-plugin-secretlint";

export default [
{
files: ["**/*.{md,mdx,txt,json,yaml,yml}"],
...secretlint.configs.recommended,
},
];

Use a deliberate files list. Secret scanning can be expensive and noisy if you point it at generated output, lockfiles, or vendored assets.

Add config-file checksโ€‹

import secretlint from "eslint-plugin-secretlint";

export default [
{
files: ["**/*.{md,mdx,txt,json,yaml,yml}"],
...secretlint.configs.recommended,
},
{
files: [".secretlintrc.{json,yaml,yml,js,cjs,mjs}"],
...secretlint.configs.configuration,
},
];

The configuration preset checks Secretlint config shape and rule references. Native secret detection still belongs to Secretlint.

Choose a narrower presetโ€‹

Next, read the Secretlint bridge guide and the config-authoring guide.