Skip to content

Commit cba5737

Browse files
zanminkianJounQin
andauthored
feat: add declaration file (#280)
Co-authored-by: JounQin <[email protected]>
1 parent 9297b8e commit cba5737

File tree

8 files changed

+31
-3
lines changed

8 files changed

+31
-3
lines changed

.changeset/moody-teachers-build.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-config-prettier": patch
3+
---
4+
5+
feat: add declaration file

.eslintrc.base.js

+6
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ module.exports = {
114114
files: ["test-lint/@stylistic__ts.ts"],
115115
extends: ["plugin:@stylistic/ts/all-extends"],
116116
},
117+
{
118+
files: ["**/*.d.ts"],
119+
rules: {
120+
strict: "off",
121+
},
122+
},
117123
],
118124
settings: {
119125
react: {

.github/workflows/release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
commit: "chore: release eslint-config-prettier"
3333
title: "chore: release eslint-config-prettier"
3434
publish: npm run release
35+
version: npm run version
3536
env:
3637
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3738
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

eslint.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,10 @@ module.exports = [
3434
},
3535
})
3636
),
37+
{
38+
files: ["**/*.d.ts"],
39+
rules: {
40+
strict: "off",
41+
},
42+
},
3743
];

index.d.ts

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
type Config = {
2+
rules: Record<string, 0 | "off">;
3+
};
4+
5+
declare const config: Config;
6+
7+
export = config;

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"repository": "prettier/eslint-config-prettier",
88
"bin": "build/bin/cli.js",
99
"main": "build/index.js",
10+
"types": "build/index.d.ts",
1011
"type": "commonjs",
1112
"files": [
1213
"build"
@@ -36,7 +37,8 @@
3637
"test:with-env": "npm run test:eslint && npm run test:jest && npm run test:cli-sanity && npm run test:cli-sanity-warning",
3738
"test": "npm run test:prettier && ESLINT_CONFIG_PRETTIER_NO_DEPRECATED=true npm run test:with-env && ESLINT_USE_FLAT_CONFIG=false npm run test:with-env && npm run build",
3839
"build": "node scripts/build.js",
39-
"release": "npm run build && clean-pkg-json && changeset publish"
40+
"release": "npm run build && clean-pkg-json && changeset publish",
41+
"version": "changeset version && npm i"
4042
},
4143
"devDependencies": {
4244
"@babel/eslint-parser": "7.23.3",

scripts/build.js

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const BUILD = path.join(DIR, "build");
88

99
const FILES_TO_COPY = [
1010
{ src: "index.js" },
11+
{ src: "index.d.ts" },
1112
{ src: "prettier.js" },
1213
...fs
1314
.readdirSync(path.join(DIR, "bin"))

0 commit comments

Comments
 (0)