Skip to content

Commit

Permalink
feat: add typescript definitions (#32)
Browse files Browse the repository at this point in the history
Resolves #28 

Add typescript definition files.
  • Loading branch information
mheob authored Sep 4, 2022
1 parent 718c5e2 commit 70cbb2c
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changeset/warm-poets-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@mheob/eslint-config': minor
'@mheob/prettier-config': minor
---

Add typescript definitions
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @type {import('eslint').ESLint.ConfigData} */
module.exports = {
root: true,
extends: ['@mheob/eslint-config'],
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"format": "prettier --write \"**/*.{cjs,js,jsx,ts,tsx,md}\"",
"lint": "turbo run lint",
"release": "changeset publish",
"sort-package-json": "pnpm dlx sort-package-json && turbo run sort-package-json",
"version-packages": "changeset version"
},
"simple-git-hooks": {
Expand All @@ -27,7 +28,7 @@
"lint-staged": {
"*.{cjs,js,jsx,ts,tsx}": "eslint --fix",
"!(pnpm-)*.{cjs,js,jsx,ts,tsx,json,md,mdx,yml,yaml}": "pnpm exec prettier --write",
"package.json": "pnpm dlx sort-package-json"
"**/package.json": "pnpm dlx sort-package-json"
},
"devDependencies": {
"@changesets/cli": "^2.24.4",
Expand Down
4 changes: 4 additions & 0 deletions packages/eslint-config/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/** @type {import('eslint').ESLint.ConfigData} */
module.exports = {
extends: ['./base.js'],
env: { node: true },
rules: {
'unicorn/prefer-module': 'off',
},
};
4 changes: 4 additions & 0 deletions packages/eslint-config/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import type { ESLint } from 'ESLint';

declare const config: ESLint.ConfigData;
export default config;
5 changes: 4 additions & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
"license": "MIT",
"author": "Alexander Böhm <tools@boehm.work>",
"main": "index.js",
"types": "index.d.ts",
"files": [
"index.js",
"index.d.ts",
"base.js",
"next.js",
"react.js",
Expand All @@ -25,7 +27,8 @@
],
"scripts": {
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
"lint": "TIMING=1 eslint **/*.cjs --fix"
"lint": "TIMING=1 eslint **/*.cjs --fix",
"sort-package-json": "pnpm dlx sort-package-json"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^5.36.1",
Expand Down
4 changes: 4 additions & 0 deletions packages/prettier-config/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import type { Config } from 'prettier';

declare const config: Config;
export default config;
5 changes: 4 additions & 1 deletion packages/prettier-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@
"license": "MIT",
"author": "Alexander Böhm <tools@boehm.work>",
"main": "index.cjs",
"types": "index.d.ts",
"files": [
"index.cjs",
"index.d.ts",
"LICENSE",
"README.md"
],
"scripts": {
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
"lint": "TIMING=1 eslint **/*.cjs --fix"
"lint": "TIMING=1 eslint **/*.cjs --fix",
"sort-package-json": "pnpm dlx sort-package-json"
},
"dependencies": {
"@trivago/prettier-plugin-sort-imports": "^3.3.0",
Expand Down
3 changes: 3 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
},
"lint": {
"outputs": []
},
"sort-package-json": {
"outputs": []
}
}
}

0 comments on commit 70cbb2c

Please sign in to comment.