From e35b6c4ab0a6003cd2ea933bdc155d726110ff3a Mon Sep 17 00:00:00 2001 From: Adam Skoufis Date: Tue, 12 Nov 2024 13:52:42 +1100 Subject: [PATCH] Add type definition for config (#47) --- .changeset/config.json | 7 +++++-- .changeset/pretty-files-compete.md | 5 +++++ eslint.config.js | 2 +- index.d.ts | 2 ++ package.json | 6 +++++- pnpm-lock.yaml | 8 ++++++++ tsconfig.json | 7 +++++++ 7 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 .changeset/pretty-files-compete.md create mode 100644 index.d.ts create mode 100644 tsconfig.json diff --git a/.changeset/config.json b/.changeset/config.json index b8fea93..a66786e 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,5 +1,5 @@ { - "$schema": "https://unpkg.com/@changesets/config@1.5.0/schema.json", + "$schema": "https://unpkg.com/@changesets/config@3.0.3/schema.json", "changelog": [ "@changesets/changelog-github", { "repo": "seek-oss/browserslist-config-seek" } @@ -7,5 +7,8 @@ "commit": false, "linked": [], "access": "public", - "baseBranch": "master" + "baseBranch": "master", + "snapshot": { + "useCalculatedVersion": true + } } diff --git a/.changeset/pretty-files-compete.md b/.changeset/pretty-files-compete.md new file mode 100644 index 0000000..1c319bb --- /dev/null +++ b/.changeset/pretty-files-compete.md @@ -0,0 +1,5 @@ +--- +'browserslist-config-seek': minor +--- + +Add type definition for default export diff --git a/eslint.config.js b/eslint.config.js index 5dbeba0..a2967a5 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1 +1 @@ -module.exports = require('eslint-config-seek'); +module.exports = require('eslint-config-seek/base'); diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..0019130 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,2 @@ +declare const browserslistConfigSeek: string[]; +export default browserslistConfigSeek; diff --git a/package.json b/package.json index 00a4be5..76a5d91 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "3.1.0", "description": "Shareable Browserslist config for SEEK", "main": "index.js", + "types": "index.d.ts", "scripts": { "test": "node test.js", "format": "pnpm run '/format:.*/'", @@ -11,11 +12,13 @@ "lint": "pnpm run '/lint:.*/'", "lint:eslint": "eslint .", "lint:prettier": "prettier . --list-different", + "lint:tsc": "tsc", "release": "changeset publish", "version": "changeset version" }, "files": [ - "index.js" + "index.js", + "index.d.ts" ], "repository": { "type": "git", @@ -30,6 +33,7 @@ "devDependencies": { "@changesets/changelog-github": "^0.5.0", "@changesets/cli": "^2.27.1", + "@tsconfig/node20": "^20.1.4", "browserslist": "^4.23.0", "eslint": "^9.13.0", "eslint-config-seek": "^14.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e4ffa93..28c516a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,9 @@ importers: '@changesets/cli': specifier: ^2.27.1 version: 2.27.1 + '@tsconfig/node20': + specifier: ^20.1.4 + version: 20.1.4 browserslist: specifier: ^4.23.0 version: 4.23.0 @@ -182,6 +185,9 @@ packages: resolution: {integrity: sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==} engines: {node: '>=12.4.0'} + '@tsconfig/node20@20.1.4': + resolution: {integrity: sha512-sqgsT69YFeLWf5NtJ4Xq/xAF8p4ZQHlmGW74Nu2tD4+g5fAsposc4ZfaaPixVu4y01BEiDCWLRDCvDM5JOsRxg==} + '@types/estree@1.0.6': resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} @@ -1935,6 +1941,8 @@ snapshots: '@nolyfill/is-core-module@1.0.39': {} + '@tsconfig/node20@20.1.4': {} + '@types/estree@1.0.6': {} '@types/json-schema@7.0.15': {} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..8475501 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "@tsconfig/node20/tsconfig.json", + "compilerOptions": { + "noEmit": true + }, + "files": ["index.d.ts"] +}