Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: remove eslint, use biome. #127

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
}
}
2 changes: 1 addition & 1 deletion listeners/actions/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { App } from '@slack/bolt';
import type { App } from '@slack/bolt';
import sampleActionCallback from './sample-action';

const register = (app: App) => {
Expand Down
11 changes: 8 additions & 3 deletions listeners/actions/sample-action.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { AllMiddlewareArgs, BlockAction, SlackActionMiddlewareArgs } from '@slack/bolt';
import type { AllMiddlewareArgs, BlockAction, SlackActionMiddlewareArgs } from '@slack/bolt';

const sampleActionCallback = async ({ ack, client, body }:
AllMiddlewareArgs & SlackActionMiddlewareArgs<BlockAction>) => {
const sampleActionCallback = async ({
ack,
client,
body,
}: AllMiddlewareArgs & SlackActionMiddlewareArgs<BlockAction>) => {
try {
await ack();
await client.views.update({
// biome-ignore lint/style/noNonNullAssertion: view may be undefined, depending on the source of this action(did it come from an action within a conversation message or a modal?). take care!
view_id: body.view!.id,
// biome-ignore lint/style/noNonNullAssertion: view may be undefined, depending on the source of this action(did it come from an action within a conversation message or a modal?). take care!
hash: body.view!.hash,
view: {
type: 'modal',
Expand Down
2 changes: 1 addition & 1 deletion listeners/commands/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { App } from '@slack/bolt';
import type { App } from '@slack/bolt';
import sampleCommandCallback from './sample-command';

const register = (app: App) => {
Expand Down
5 changes: 2 additions & 3 deletions listeners/commands/sample-command.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { AllMiddlewareArgs, SlackCommandMiddlewareArgs } from '@slack/bolt';
import type { AllMiddlewareArgs, SlackCommandMiddlewareArgs } from '@slack/bolt';

const sampleCommandCallback = async ({ ack, respond }:
AllMiddlewareArgs & SlackCommandMiddlewareArgs) => {
const sampleCommandCallback = async ({ ack, respond }: AllMiddlewareArgs & SlackCommandMiddlewareArgs) => {
try {
await ack();
await respond('Responding to the sample command!');
Expand Down
7 changes: 5 additions & 2 deletions listeners/events/app-home-opened.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { AllMiddlewareArgs, SlackEventMiddlewareArgs } from '@slack/bolt';
import type { AllMiddlewareArgs, SlackEventMiddlewareArgs } from '@slack/bolt';

const appHomeOpenedCallback = async ({ client, event }: AllMiddlewareArgs & SlackEventMiddlewareArgs<'app_home_opened'>) => {
const appHomeOpenedCallback = async ({
client,
event,
}: AllMiddlewareArgs & SlackEventMiddlewareArgs<'app_home_opened'>) => {
// Ignore the `app_home_opened` event for anything but the Home tab
if (event.tab !== 'home') return;

Expand Down
2 changes: 1 addition & 1 deletion listeners/events/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { App } from '@slack/bolt';
import type { App } from '@slack/bolt';
import appHomeOpenedCallback from './app-home-opened';

const register = (app: App) => {
Expand Down
2 changes: 1 addition & 1 deletion listeners/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { App } from '@slack/bolt';
import type { App } from '@slack/bolt';
import actions from './actions';
import commands from './commands';
import events from './events';
Expand Down
2 changes: 1 addition & 1 deletion listeners/messages/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { App } from '@slack/bolt';
import type { App } from '@slack/bolt';
import sampleMessageCallback from './sample-message';

const register = (app: App) => {
Expand Down
2 changes: 1 addition & 1 deletion listeners/messages/sample-message.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AllMiddlewareArgs, SlackEventMiddlewareArgs } from '@slack/bolt';
import type { AllMiddlewareArgs, SlackEventMiddlewareArgs } from '@slack/bolt';

const sampleMessageCallback = async ({ context, say }: AllMiddlewareArgs & SlackEventMiddlewareArgs<'message'>) => {
try {
Expand Down
2 changes: 1 addition & 1 deletion listeners/shortcuts/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { App } from '@slack/bolt';
import type { App } from '@slack/bolt';
import sampleShortcutCallback from './sample-shortcut';

const register = (app: App) => {
Expand Down
5 changes: 2 additions & 3 deletions listeners/shortcuts/sample-shortcut.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { AllMiddlewareArgs, SlackShortcutMiddlewareArgs } from '@slack/bolt';
import type { AllMiddlewareArgs, SlackShortcutMiddlewareArgs } from '@slack/bolt';

const sampleShortcutCallback = async ({ shortcut, ack, client }:
AllMiddlewareArgs & SlackShortcutMiddlewareArgs) => {
const sampleShortcutCallback = async ({ shortcut, ack, client }: AllMiddlewareArgs & SlackShortcutMiddlewareArgs) => {
try {
const { trigger_id } = shortcut;

Expand Down
2 changes: 1 addition & 1 deletion listeners/views/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { App } from '@slack/bolt';
import type { App } from '@slack/bolt';
import sampleViewCallback from './sample-view';

const register = (app: App) => {
Expand Down
5 changes: 2 additions & 3 deletions listeners/views/sample-view.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { AllMiddlewareArgs, SlackViewMiddlewareArgs } from '@slack/bolt';
import type { AllMiddlewareArgs, SlackViewMiddlewareArgs } from '@slack/bolt';

const sampleViewCallback = async ({ ack, view, body, client }:
AllMiddlewareArgs & SlackViewMiddlewareArgs) => {
const sampleViewCallback = async ({ ack, view, body, client }: AllMiddlewareArgs & SlackViewMiddlewareArgs) => {
await ack();

try {
Expand Down
Loading