npm.io
3.1.0 • Published 6 months ago

types-eslintrc

Licence
MIT
Version
3.1.0
Deps
2
Size
29 kB
Vulns
0
Weekly
0
Stars
3

types-eslintrc

NPM TypeScript

Type checking for .eslintrc.json.

Installation

NPM
npm install types-eslintrc
Yarn
yarn add types-eslintrc
PNPM
pnpm add types-eslintrc
Bun
bun add types-eslintrc

This package uses zod to type check ESLint configs.

Usage

Types
import {
  ESLintConfig,
  isESLintConfig,
  parseESLintConfig
} from "types-eslintrc";

const myConfig = {
  // ...
};

if(isESLintConfig(myConfig)) {
  // myConfig is now typed as ESLintConfig
}

const myConfig = parseESLintConfig(myConfig);
// If myConfig is valid, it will return as ESLintConfig. Otherwise, it will return undefined.

Dependenciesdependencies

  • types-json: Type checking for JSON values
  • zod: TypeScript-first schema declaration and validation library with static type inference

License license

MIT - MIT License

Keywords