-
-
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
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
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
Oops, something went wrong.