Skip to content

Commit ac1de47

Browse files
chore: #15 linting and formatting workflows (#17)
1 parent 74dc01d commit ac1de47

18 files changed

Lines changed: 1034 additions & 150 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
- name: Installing project dependencies
2020
run: |
2121
npm ci
22-
# - name: Format
23-
# run: |
24-
# npm run format:check
25-
# - name: Lint
26-
# run: |
27-
# npm run lint
22+
- name: Format Check
23+
run: |
24+
npm run format:check
25+
- name: Lint
26+
run: |
27+
npm run lint
2828
- name: Check Types
2929
run: |
30-
npm run check
30+
npm run check

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

.oxlintrc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"categories": {
4+
"correctness": "error"
5+
},
6+
"rules": {
7+
"eslint/no-unused-vars": "error"
8+
}
9+
}

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,12 @@ To start the production server, run:
2828
2929
```sh
3030
$ npm run serve
31-
```
31+
```
32+
33+
---
34+
35+
Additionally, before committing the following commands will run as part of Husky pre-commit hooks, but you can also run them manually:
36+
37+
- `npm run lint` - Runs OXLint for JS / TS linting
38+
- `npm run format` - Runs OXFmt for code formatting
39+
- `npm run check` - Run TSGO for type-checking

greenwood.config.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { greenwoodPluginImportRaw } from '@greenwood/plugin-import-raw';
2-
import { greenwoodPluginCssModules } from '@greenwood/plugin-css-modules';
3-
import { greenwoodPluginImportJsx } from '@greenwood/plugin-import-jsx';
4-
import { replBundlerResourcePlugin } from './repl-bundler-plugin.ts';
1+
import { greenwoodPluginImportRaw } from "@greenwood/plugin-import-raw";
2+
import { greenwoodPluginCssModules } from "@greenwood/plugin-css-modules";
3+
import { greenwoodPluginImportJsx } from "@greenwood/plugin-import-jsx";
4+
import { replBundlerResourcePlugin } from "./repl-bundler-plugin.ts";
55
import type { Config } from "@greenwood/cli";
66

77
const config: Config = {
@@ -10,8 +10,8 @@ const config: Config = {
1010
greenwoodPluginCssModules(),
1111
greenwoodPluginImportRaw(),
1212
greenwoodPluginImportJsx(),
13-
replBundlerResourcePlugin()
14-
]
13+
replBundlerResourcePlugin(),
14+
],
1515
};
1616

1717
export default config;

lint-staged.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
"*.js": ["npm run lint --"],
3+
"*.ts": ["npm run lint --", "npm run check --"],
4+
"*.*": ["npm run format --"],
5+
};

netlify.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[build]
2-
publish = "public/"
3-
command = "npm run build"
2+
publish = "public/"
3+
command = "npm run build"
44

55
[build.processing]
6-
skip_processing = true
6+
skip_processing = true
77

88
[build.environment]
9-
NODE_VERSION = "24.4.0"
9+
NODE_VERSION = "24.4.0"

0 commit comments

Comments
 (0)