Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit 6701c14

Browse files
authored
Add types for prettier (#15)
1 parent 5c355b3 commit 6701c14

File tree

4 files changed

+71
-0
lines changed

4 files changed

+71
-0
lines changed

pnpm-lock.yaml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

types/prettier/index.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import type { PrettierRuleOptions } from './rules/prettier';
2+
3+
declare module 'eslint-define-config' {
4+
export interface CustomExtends {
5+
'plugin:prettier/recommended': void;
6+
}
7+
8+
export interface CustomPlugins {
9+
prettier: void;
10+
}
11+
12+
export interface CustomRuleOptions {
13+
/**
14+
* undefined
15+
*
16+
* @see [prettier](https://github.com/prettier/eslint-plugin-prettier#options)
17+
*/
18+
'prettier/prettier': PrettierRuleOptions;
19+
}
20+
}

types/prettier/package.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "@eslint-types/prettier",
3+
"version": "5.0.1",
4+
"description": "TypeScript definitions for eslint-define-config",
5+
"homepage": "https://github.com/eslint-types/define-config-plugin-types/tree/main/types/prettier",
6+
"license": "MIT",
7+
"contributors": [
8+
{
9+
"name": "Christopher Quadflieg",
10+
"url": "https://github.com/Shinigami92",
11+
"githubUsername": "Shinigami92"
12+
}
13+
],
14+
"main": "",
15+
"types": "index.d.ts",
16+
"repository": {
17+
"type": "git",
18+
"url": "https://github.com/eslint-types/define-config-plugin-types.git",
19+
"directory": "types/prettier"
20+
},
21+
"scripts": {},
22+
"dependencies": {},
23+
"devDependencies": {
24+
"eslint-plugin-prettier": "5.0.1"
25+
},
26+
"exports": {
27+
".": {
28+
"types": "./index.d.ts"
29+
},
30+
"./package.json": "./package.json"
31+
}
32+
}

types/prettier/rules/prettier.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export interface Schema0 {
2+
[k: string]: unknown;
3+
}
4+
5+
export interface Schema1 {
6+
usePrettierrc?: boolean;
7+
fileInfoOptions?: {
8+
[k: string]: unknown;
9+
};
10+
[k: string]: unknown;
11+
}
12+
13+
export type PrettierRuleOptions = [Schema0?, Schema1?];

0 commit comments

Comments
 (0)