-
-
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: use TypeScript for source config files (#46)
Resolves #33 Switch to TypeScript to have a better code base for the future.
- Loading branch information
Showing
24 changed files
with
187 additions
and
85 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@mheob/eslint-config': patch | ||
'@mheob/prettier-config': patch | ||
--- | ||
|
||
Switch to typescript as source files |
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,37 @@ | ||
name: Check | ||
|
||
on: | ||
pull_request: | ||
paths: ["packages/**"] | ||
branches: [main] | ||
push: | ||
paths: ["packages/**"] | ||
branches: [main] | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PNPM | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 7 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: "pnpm" | ||
|
||
- name: Install Dependencies | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Build files | ||
run: pnpm run build | ||
|
||
- name: Lint files | ||
run: pnpm run lint |
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 |
---|---|---|
|
@@ -8,10 +8,11 @@ node_modules | |
# testing | ||
coverage | ||
|
||
# next.js | ||
# builds | ||
.next/ | ||
out/ | ||
out | ||
build | ||
dist | ||
|
||
# misc | ||
.DS_Store | ||
|
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 |
---|---|---|
|
@@ -9,3 +9,9 @@ coverage | |
|
||
# turbo | ||
.turbo | ||
|
||
# builds | ||
.next/ | ||
out | ||
build | ||
dist |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -10,22 +10,19 @@ | |
"bugs": "https://github.com/mheob/config/issues", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/mheob/config.git" | ||
"url": "https://github.com/mheob/config" | ||
}, | ||
"license": "MIT", | ||
"author": "Alexander Böhm <[email protected]>", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"index.js", | ||
"index.d.ts", | ||
"base.js", | ||
"next.js", | ||
"react.js", | ||
"dist", | ||
"LICENSE", | ||
"README.md" | ||
], | ||
"scripts": { | ||
"build": "tsc", | ||
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist", | ||
"lint": "eslint **/*.cjs --fix", | ||
"sort-package-json": "pnpm dlx sort-package-json" | ||
|
@@ -40,6 +37,8 @@ | |
"eslint-plugin-unicorn": "^43.0.2" | ||
}, | ||
"devDependencies": { | ||
"@mheob/tsconfig": "workspace:*", | ||
"@types/eslint": "^8.4.6", | ||
"eslint": "^8.23.1", | ||
"prettier": "^2.7.1", | ||
"typescript": "^4.8.3" | ||
|
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 @@ | ||
export = require('./base'); |
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,7 @@ | ||
import type { Linter } from 'eslint'; | ||
|
||
const config: Linter.Config = { | ||
extends: ['./react', 'next/core-web-vitals'], | ||
}; | ||
|
||
export = config; |
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": "@mheob/tsconfig/commonjs.json", | ||
"compilerOptions": { | ||
"declaration": true, | ||
"outDir": "dist", | ||
"rootDir": "src" | ||
}, | ||
"include": ["src/**/*"] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -10,21 +10,20 @@ | |
"bugs": "https://github.com/mheob/config/issues", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/mheob/config.git" | ||
"url": "https://github.com/mheob/config" | ||
}, | ||
"license": "MIT", | ||
"author": "Alexander Böhm <[email protected]>", | ||
"main": "index.cjs", | ||
"types": "index.d.ts", | ||
"main": "dist/index.js", | ||
"files": [ | ||
"index.cjs", | ||
"index.d.ts", | ||
"dist", | ||
"LICENSE", | ||
"README.md" | ||
], | ||
"scripts": { | ||
"build": "tsc", | ||
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist", | ||
"lint": "eslint **/*.cjs --fix", | ||
"lint": "eslint **/*.ts --fix", | ||
"sort-package-json": "pnpm dlx sort-package-json" | ||
}, | ||
"dependencies": { | ||
|
@@ -33,6 +32,8 @@ | |
}, | ||
"devDependencies": { | ||
"@mheob/eslint-config": "workspace:*", | ||
"@mheob/tsconfig": "workspace:*", | ||
"@types/prettier": "^2.7.0", | ||
"eslint": "^8.23.1", | ||
"prettier": "^2.7.1" | ||
}, | ||
|
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,46 @@ | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
import sortImports from '@trivago/prettier-plugin-sort-imports'; | ||
import type { Config as DefaultConfig } from 'prettier'; | ||
|
||
interface Config extends DefaultConfig { | ||
importOrder?: string[]; | ||
importOrderCaseInsensitive?: boolean; | ||
importOrderParserPlugins?: string[]; | ||
importOrderSeparation?: boolean; | ||
importOrderGroupNamespaceSpecifiers?: boolean; | ||
importOrderSortSpecifiers?: boolean; | ||
} | ||
|
||
const options: Config = { | ||
plugins: [sortImports], | ||
arrowParens: 'always', | ||
endOfLine: 'lf', | ||
printWidth: 100, | ||
proseWrap: 'always', | ||
importOrder: ['^node:', '<THIRD_PARTY_MODULES>', '^[./]'], | ||
importOrderSeparation: true, | ||
importOrderSortSpecifiers: true, | ||
singleQuote: true, | ||
semi: true, | ||
trailingComma: 'all', | ||
useTabs: true, | ||
|
||
overrides: [ | ||
{ | ||
files: '*.{yaml,yml}', | ||
options: { | ||
printWidth: 130, | ||
singleQuote: false, | ||
}, | ||
}, | ||
{ | ||
files: '*.md', | ||
options: { | ||
printWidth: 130, | ||
}, | ||
}, | ||
], | ||
}; | ||
|
||
export = options; |
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": "@mheob/tsconfig/commonjs.json", | ||
"compilerOptions": { | ||
"declaration": true, | ||
"outDir": "dist", | ||
"rootDir": "src" | ||
}, | ||
"include": ["src/**/*"] | ||
} |
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
"bugs": "https://github.com/mheob/config/issues", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/mheob/config.git" | ||
"url": "https://github.com/mheob/config" | ||
}, | ||
"license": "MIT", | ||
"author": "Alexander Böhm <[email protected]>", | ||
|
Oops, something went wrong.