Skip to content

Commit

Permalink
chore: reformat; fix tsc
Browse files Browse the repository at this point in the history
  • Loading branch information
boneskull committed Jul 26, 2024
1 parent c0e925e commit 61418c2
Show file tree
Hide file tree
Showing 28 changed files with 730 additions and 166 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Once all feedback is addressed and the PR is approved, we'll ensure the branch i

#### Post-Merge Recognition

Once your PR is merged, if you haven't yet been added to the [_Contributors_ table in the README.md](../README.md#contributors) for its [type of contribution](https://allcontributors.org/docs/en/emoji-key "Allcontributors emoji key"), you should be soon.
Once your PR is merged, if you haven't yet been added to the [_Contributors_ table in the README.md](../README.md#contributors) for its [type of contribution](https://allcontributors.org/docs/en/emoji-key 'Allcontributors emoji key'), you should be soon.
Please do ping the maintainer who merged your PR if that doesn't happen within 24 hours - it was likely an oversight on our end!

## Emojis & Appreciation
Expand Down
17 changes: 10 additions & 7 deletions .github/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
After [forking the repo from GitHub](https://help.github.com/articles/fork-a-repo) and [installing npm](https://npm.io/installation):

```shell
git clone https://github.com/ < your-name-here > /impvol
git clone https://github.com/boneskull/impvol
cd impvol
npm install
```

> [!TIP]
> This repository includes a list of suggested VS Code extensions.
> It's a good idea to use [VS Code](https://code.visualstudio.com) and accept its suggestion to install them, as they'll help with development.
## Building

Run [**tsup**](https://tsup.egoist.dev) locally to build source files from `src/` into output files in `lib/`:
Run [**tshy**](https://npm.im/tshy) locally to build source files from `src/` into output files in `lib/`:

```shell
npm run build
Expand All @@ -22,18 +23,17 @@ npm run build
Add `--watch` to run the builder in a watch mode that continuously cleans and recreates `lib/` as you save files:

```shell
npm run build --watch
npm run build -- --watch
```

## Formatting

[Prettier](https://prettier.io) is used to format code.
It should be applied automatically when you save files in VS Code or make a Git commit.
[Prettier](https://prettier.io) is used to format code. It should be applied automatically when you save files in VS Code or make a Git commit.

To manually reformat all files, you can run:

```shell
npm run format --write
npm run format -- --write
```

## Linting
Expand All @@ -51,7 +51,7 @@ Read the individual documentation for each linter to understand how it can be co
For example, ESLint can be run with `--fix` to auto-fix some lint rule complaints:

```shell
npm run lint --fix
npm run lint -- --fix
```

Note that you'll likely need to run `npm run build` before `npm run lint` so that lint rules which check the file system can pick up on any built files.
Expand All @@ -71,3 +71,6 @@ Add `--watch` to keep the type checker running in a watch mode that updates the
```shell
npm run tsc --watch
```

> [!CAUTION]
> Do not attempt to run `tsc` directly; this will place output files in the wrong location and you'll have to clean them up manually!
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/01-bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ body:
type: textarea
description: Report a bug trying to run the code
labels:
- "type: bug"
- 'type: bug'
name: 🐛 Bug
title: "🐛 Bug: <short description of the bug>"
title: '🐛 Bug: <short description of the bug>'
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/02-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ body:
type: textarea
description: Report a typo or missing area of documentation
labels:
- "area: documentation"
- 'area: documentation'
name: 📝 Documentation
title: "📝 Documentation: <short description of the request>"
title: '📝 Documentation: <short description of the request>'
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/03-feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ body:
type: textarea
description: Request that a new feature be added or an existing feature improved
labels:
- "type: feature"
- 'type: feature'
name: 🚀 Feature
title: "🚀 Feature: <short description of the feature>"
title: '🚀 Feature: <short description of the feature>'
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/04-tooling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ body:
type: textarea
description: Report a bug or request an enhancement in repository tooling
labels:
- "area: tooling"
- 'area: tooling'
name: 🛠 Tooling
title: "🛠 Tooling: <short description of the change>"
title: '🛠 Tooling: <short description of the change>'
12 changes: 5 additions & 7 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ name: Prepare

runs:
steps:
- uses: pnpm/action-setup@v2
with:
version: 9
- uses: actions/setup-node@v4
with:
cache: pnpm
node-version: "20"
- run: pnpm install --frozen-lockfile
shell: bash
node-version: '20'
- name: Install dependencies
uses: bahmutov/npm-install@2509f13e8485d88340a789a3f7ca11aaac47c9fc # v1.8.36
with:
install-command: npm ci --foreground-scripts
using: composite
14 changes: 7 additions & 7 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"automerge": true,
"extends": ["config:best-practices", "replacements:all"],
"ignoreDeps": ["codecov/codecov-action"],
"internalChecksFilter": "strict",
"labels": ["dependencies"],
"minimumReleaseAge": "3 days"
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"automerge": true,
"extends": ["config:best-practices", "replacements:all"],
"ignoreDeps": ["codecov/codecov-action"],
"internalChecksFilter": "strict",
"labels": ["dependencies"],
"minimumReleaseAge": "3 days"
}
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm build
- run: node ./lib/index.js
- run: npm run build

name: Build

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-knip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm lint:knip
- run: npm run lint:knip

name: Lint Knip

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm lint:md
- run: npm run lint:md

name: Lint Markdown

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm lint:spelling
- run: npm run lint:spelling

name: Lint spelling

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm lint
- run: npm run lint

name: Lint

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-review-requested.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
steps:
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: "status: waiting for author"
labels: 'status: waiting for author'
- if: failure()
run: |
echo "Don't worry if the previous step failed."
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm format --list-different
- run: npm run format -- --list-different

name: Prettier

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tsc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm tsc
- run: npm run tsc

name: Type Check

Expand Down
12 changes: 9 additions & 3 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
{
"$schema": "http://json.schemastore.org/prettierrc",
"overrides": [{ "files": ".nvmrc", "options": { "parser": "yaml" } }],
"overrides": [{"files": ".nvmrc", "options": {"parser": "yaml"}}],
"plugins": [
"prettier-plugin-curly",
"prettier-plugin-sh",
"prettier-plugin-packagejson"
"prettier-plugin-organize-imports",
"prettier-plugin-pkg",
"prettier-plugin-jsdoc"
],
"useTabs": false,
"singleQuote": true
"singleQuote": true,
"bracketSpacing": false,
"endOfLine": "auto",
"jsdocCommentLineStrategy": "multiline",
"tsdoc": true
}
6 changes: 3 additions & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default tseslint.config(

'@typescript-eslint/consistent-type-exports': [
'error',
{ fixMixedExportsWithInlineTypeSpecifier: true },
{fixMixedExportsWithInlineTypeSpecifier: true},
],

'@typescript-eslint/switch-exhaustiveness-check': 'error',
Expand Down Expand Up @@ -106,7 +106,7 @@ export default tseslint.config(

'@stylistic/padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: '*', next: 'export' },
{blankLine: 'always', prev: '*', next: 'export'},
],

'@stylistic/lines-between-class-members': 'error',
Expand All @@ -124,7 +124,7 @@ export default tseslint.config(
extends: [tseslint.configs.disableTypeChecked],
files: ['**/*.md/*.ts'],
rules: {
'n/no-missing-import': ['error', { allowModules: ['impvol'] }],
'n/no-missing-import': ['error', {allowModules: ['impvol']}],
},
},
);
8 changes: 4 additions & 4 deletions knip.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://unpkg.com/knip@latest/schema.json",
"entry": ["src/index.ts!"],
"ignoreExportsUsedInFile": { "interface": true, "type": true },
"project": ["src/**/*.ts!"]
"$schema": "https://unpkg.com/knip@latest/schema.json",
"entry": ["src/index.ts!"],
"ignoreExportsUsedInFile": {"interface": true, "type": true},
"project": ["src/**/*.ts!"]
}
Loading

0 comments on commit 61418c2

Please sign in to comment.