Skip to content

Commit

Permalink
test: remove eslint, use biome. (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
filmaj authored Oct 1, 2024
1 parent 91368c4 commit 0997f7e
Show file tree
Hide file tree
Showing 9 changed files with 1,434 additions and 2,953 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

35 changes: 0 additions & 35 deletions .eslintrc.json

This file was deleted.

5 changes: 0 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ updates:
labels:
- "npm"
- "dependencies"
groups:
linter:
patterns:
- "eslint*"
- "@typescript-eslint*"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/eslint.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Linting with ESLint
name: Build and Lint

on:
push:
Expand All @@ -11,14 +11,12 @@ jobs:
timeout-minutes: 5
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install modules
run: npm install
- name: Run ESLint
run: npm run lint
- run: npm install
- run: npm test
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ npm install
npm start
```

### Linting
### Testing

Run ESLint for code formatting and linting:
Run the TypeScript compilation, code formatting and linting:

```zsh
npm run lint
npm test
```

## Using Steps in Workflow Builder
Expand Down
6 changes: 5 additions & 1 deletion app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { App, BlockAction, LogLevel } from '@slack/bolt';
import { App, type BlockAction, LogLevel } from '@slack/bolt';
import { config } from 'dotenv';

config();
Expand Down Expand Up @@ -51,15 +51,19 @@ app.action<BlockAction>('sample_button', async ({ body, client, complete, fail }
// Functions should be marked as successfully completed using `complete` or
// as having failed using `fail`, else they'll remain in an 'In progress' state.
// Learn more at https://api.slack.com/automation/interactive-messages
// biome-ignore lint/style/noNonNullAssertion: we know this button comes from a function, so `fail` is available.
await complete!({ outputs: { user_id: user.id } });

await client.chat.update({
// biome-ignore lint/style/noNonNullAssertion: we know this button was posted to a channel, so `channel` is available.
channel: channel!.id,
// biome-ignore lint/style/noNonNullAssertion: we know this button was posted to a channel, so `message` is available.
ts: message!.ts,
text: 'Function completed successfully!',
});
} catch (error) {
console.error(error);
// biome-ignore lint/style/noNonNullAssertion: we know this button comes from a function, so `fail` is available.
fail!({ error: `Failed to handle a function request: ${error}` });
}
});
Expand Down
32 changes: 32 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"formatter": {
"enabled": true,
"formatWithErrors": false,
"ignore": [],
"attributePosition": "auto",
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 120,
"lineEnding": "lf"
},
"javascript": {
"formatter": {
"quoteStyle": "single"
}
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"organizeImports": {
"enabled": true
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
}
}
Loading

0 comments on commit 0997f7e

Please sign in to comment.