-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Improve TS configs and add library types
- Loading branch information
Showing
10 changed files
with
128 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Peerigon's Prettier config | ||
|
||
## Install | ||
|
||
```sh | ||
npm install prettier@3 --save-dev | ||
``` | ||
|
||
Add a `prettier.config.js` to your project: | ||
|
||
``` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## Reasoning | ||
|
||
### `noUncheckedIndexedAccess` | ||
|
||
- Mention tiny-invariant | ||
|
||
### `noPropertyAccessFromIndexSignature` | ||
|
||
### `exactOptionalPropertyTypes` | ||
|
||
### `verbatimModuleSyntax` | ||
|
||
### `allowImportingTsExtensions` | ||
|
||
### `rewriteRelativeImportExtensions` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,26 +21,74 @@ | |
"author": "Peerigon GmbH <[email protected]>", | ||
"type": "module", | ||
"exports": { | ||
"./eslint/presets/javascript-browser": "./eslint/presets/javascript-browser.js", | ||
"./eslint/presets/javascript-node": "./eslint/presets/javascript-node.js", | ||
"./eslint/presets/javascript": "./eslint/presets/javascript.js", | ||
"./eslint/presets/typescript-node": "./eslint/presets/typescript-node.js", | ||
"./eslint/presets/typescript-react": "./eslint/presets/typescript-react.js", | ||
"./eslint/presets/typescript": "./eslint/presets/typescript.js", | ||
"./eslint/styles/jsx-no-literals": "./eslint/styles/jsx-no-literals.js", | ||
"./eslint/styles/no-default-export": "./eslint/styles/no-default-export.js", | ||
"./eslint/styles/no-null": "./eslint/styles/no-null.js", | ||
"./eslint/styles/prefer-array-shorthand": "./eslint/styles/prefer-array-shorthand.js", | ||
"./eslint/styles/prefer-interface": "./eslint/styles/prefer-interface.js", | ||
"./prettier": "./prettier/base.js", | ||
"./semantic-release": "./semantic-release/base.js", | ||
"./typescript": "./typescript/base.json", | ||
"./typescript/lib": "./typescript/lib.json" | ||
"./eslint/presets/javascript-browser": { | ||
"types": "./types/eslint/presets/javascript-browser.d.ts", | ||
"default": "./eslint/presets/javascript-browser.js" | ||
}, | ||
"./eslint/presets/javascript-node": { | ||
"types": "./types/eslint/presets/javascript-node.d.ts", | ||
"default": "./eslint/presets/javascript-node.js" | ||
}, | ||
"./eslint/presets/javascript": { | ||
"types": "./types/eslint/presets/javascript.d.ts", | ||
"default": "./eslint/presets/javascript.js" | ||
}, | ||
"./eslint/presets/typescript-node": { | ||
"types": "./types/eslint/presets/typescript-node.d.ts", | ||
"default": "./eslint/presets/typescript-node.js" | ||
}, | ||
"./eslint/presets/typescript-react": { | ||
"types": "./types/eslint/presets/typescript-react.d.ts", | ||
"default": "./eslint/presets/typescript-react.js" | ||
}, | ||
"./eslint/presets/typescript": { | ||
"types": "./types/eslint/presets/typescript.d.ts", | ||
"default": "./eslint/presets/typescript.js" | ||
}, | ||
"./eslint/styles/jsx-no-literals": { | ||
"types": "./types/eslint/styles/jsx-no-literals.d.ts", | ||
"default": "./eslint/styles/jsx-no-literals.js" | ||
}, | ||
"./eslint/styles/no-default-export": { | ||
"types": "./types/eslint/styles/no-default-export.d.ts", | ||
"default": "./eslint/styles/no-default-export.js" | ||
}, | ||
"./eslint/styles/no-null": { | ||
"types": "./types/eslint/styles/no-null.d.ts", | ||
"default": "./eslint/styles/no-null.js" | ||
}, | ||
"./eslint/styles/prefer-array-shorthand": { | ||
"types": "./types/eslint/styles/prefer-array-shorthand.d.ts", | ||
"default": "./eslint/styles/prefer-array-shorthand.js" | ||
}, | ||
"./eslint/styles/prefer-interface": { | ||
"types": "./types/eslint/styles/prefer-interface.d.ts", | ||
"default": "./eslint/styles/prefer-interface.js" | ||
}, | ||
"./prettier": { | ||
"types": "./types/prettier/base.d.ts", | ||
"default": "./prettier/base.js" | ||
}, | ||
"./semantic-release": { | ||
"types": "./types/semantic-release/base.d.ts", | ||
"default": "./semantic-release/base.js" | ||
}, | ||
"./typescript": { | ||
"default": "./typescript/base.json" | ||
}, | ||
"./typescript/lib": { | ||
"default": "./typescript/lib.json" | ||
}, | ||
"./typescript/js-lib": { | ||
"default": "./typescript/js-lib.json" | ||
} | ||
}, | ||
"files": [ | ||
"docs", | ||
"eslint", | ||
"prettier", | ||
"semantic-release", | ||
"types", | ||
"typescript", | ||
"CHANGELOG.md", | ||
"README.md" | ||
|
@@ -55,8 +103,11 @@ | |
"test:styles:no-null": "cd eslint/styles/no-null.test; eslint --max-warnings 0 .", | ||
"test:styles:prefer-array-shorthand": "cd eslint/styles/prefer-array-shorthand.test; eslint --max-warnings 0 .", | ||
"test:styles:prefer-interface": "cd eslint/styles/prefer-interface.test; eslint --max-warnings 0 .", | ||
"test:types": "tsc", | ||
"test:types": "tsc --noEmit", | ||
"test:prettier": "prettier --check .", | ||
"build": "run-s build:*", | ||
"build:types": "tsc", | ||
"prepublishOnly": "npm run build", | ||
"prepare": "husky", | ||
"release": "semantic-release" | ||
}, | ||
|
@@ -107,6 +158,7 @@ | |
}, | ||
"peerDependencies": { | ||
"eslint": "^9.0.0", | ||
"prettier": "^3.3.3", | ||
"typescript": "^5.6.3" | ||
}, | ||
"publishConfig": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "./lib.json", | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"emitDeclarationOnly": true, | ||
"outDir": "${configDir}/types" | ||
}, | ||
"$schema": "https://json.schemastore.org/tsconfig" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
{ | ||
"extends": "./typescript.json", | ||
"extends": "./base.json", | ||
"compilerOptions": { | ||
"sourceMap": true, | ||
"declaration": true | ||
} | ||
"declaration": true, | ||
"declarationMap": true, | ||
"outDir": "${configDir}/dist", | ||
"sourceMap": true | ||
}, | ||
"$schema": "https://json.schemastore.org/tsconfig" | ||
} |