Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit 94d338d

Browse files
authored
Merge pull request #27 from wardellbagby/wardell/improve-dx
2 parents 4656275 + a7ff4c8 commit 94d338d

File tree

19 files changed

+12201
-4848
lines changed

19 files changed

+12201
-4848
lines changed

.eslintrc.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
module.exports = {
2+
plugins: ["@typescript-eslint", "prettier"],
3+
ignorePatterns: ["dist/**/*", "**/node_modules/**"],
4+
extends: ["standard-with-typescript", "prettier"],
5+
parser: "@typescript-eslint/parser",
6+
parserOptions: {
7+
tsconfigRootDir: __dirname,
8+
project: true,
9+
},
10+
rules: {
11+
"prettier/prettier": "error",
12+
"@typescript-eslint/naming-convention": "off",
13+
"@typescript-eslint/restrict-template-expressions": "off",
14+
"@typescript-eslint/strict-boolean-expressions": "off",
15+
},
16+
overrides: [
17+
{
18+
files: "**/*.js",
19+
parserOptions: {
20+
project: null,
21+
},
22+
},
23+
{
24+
files: "**/*.spec.ts",
25+
rules: {
26+
"@typescript-eslint/no-dynamic-delete": "off",
27+
"@typescript-eslint/no-var-requires": "off",
28+
},
29+
},
30+
],
31+
root: true,
32+
};

.github/workflows/bundle-check.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: "Bundle Check"
2+
on:
3+
pull_request:
4+
branches:
5+
- "master"
6+
jobs:
7+
check:
8+
name: "Bundle Check"
9+
runs-on: "ubuntu-22.04"
10+
steps:
11+
- name: "Checkout the current branch"
12+
uses: "actions/checkout@v3"
13+
- name: "Setup Node"
14+
uses: "actions/setup-node@v3"
15+
with:
16+
node-version: 18
17+
- name: "Install Node modules"
18+
run: "npm ci"
19+
- name: "Generate new bundle"
20+
run: "npm run package"
21+
- name: "Verify new bundle matches existing"
22+
run: "git diff --exit-code --name-only dist/"
23+
- name: "Show message instructing how to commit new bundle"
24+
if: failure()
25+
run: echo "::error title=Bundle has changed::The bundle has changed since the last commit and the new changes must be committed as part of this PR. Please run 'npm run package' and commit the results to your PR alongside your existing changes."

.github/workflows/lint.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 'Lint'
2+
on:
3+
pull_request:
4+
branches:
5+
- 'master'
6+
jobs:
7+
lint:
8+
name: 'Lint'
9+
runs-on: 'ubuntu-22.04'
10+
steps:
11+
- name: 'Checkout the current branch'
12+
uses: 'actions/checkout@v3'
13+
- name: 'Setup Node'
14+
uses: 'actions/setup-node@v3'
15+
with:
16+
node-version: 18
17+
- name: 'Install Node modules'
18+
run: 'npm ci'
19+
- name: 'Run lint'
20+
run: 'npm run lint'

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,22 @@ npm run package
3838

3939
and committing the resulting changes that will be in the `dist/` folder.
4040

41+
### Formatting and linting
42+
43+
This project uses [ESLint](https://eslint.org/) for linting and [Prettier](https://prettier.io/) for source code formatting. You can run the lint checks by running:
44+
45+
```shell
46+
npm run lint
47+
```
48+
49+
If you have lint errors that are automatically fixable, you can fix those by running:
50+
51+
```shell
52+
npm run lint:fix
53+
```
54+
4155
## Releasing
56+
4257
Releases are done by creating a new tag and pushing that tag to the repo. A new
4358
release can be made via the following:
4459

dist/LICENSE

Lines changed: 0 additions & 635 deletions
This file was deleted.

dist/index.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)