包详细信息

types-eslintrc

bconnorwhite47kMIT2.0.0

Type checking for .eslintrc.json

eslint, eslintrc, config, json

自述文件

types-eslintrc

NPM TypeScript Coverage Status


Type checking for ESLint configs.


If I should maintain this repo, please ⭐️ GitHub stars

DM me on Twitter if you have questions or suggestions. Twitter


This package uses zod to type check ESLint configs.

Installation

yarn add types-eslintrc
npm install types-eslintrc
pnpm add types-eslintrc

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 objects
  • zod: TypeScript-first schema declaration and validation library with static type inference


Dev Dependencies

  • autorepo: Autorepo abstracts away your dev dependencies, providing a single command to run all of your scripts.


License license

MIT - MIT License


Related Projects

更新日志

2.0.0 (2023-01-11)

1.0.3 (2020-10-07)

1.0.2 (2020-09-19)

1.0.1 (2020-09-19)