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

chore: remove eslint, use biome instead #2006

Merged
merged 14 commits into from
Sep 5, 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm --version
- name: Get Development Dependencies
run: npm i
- name: Build and Run Tests in Each Package
working-directory: packages/${{ matrix.package }}
run: |
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
}
}
1 change: 0 additions & 1 deletion lint-configs/.eslintignore

This file was deleted.

337 changes: 0 additions & 337 deletions lint-configs/.eslintrc.js

This file was deleted.

21 changes: 0 additions & 21 deletions lint-configs/tsconfig.eslint.json

This file was deleted.

7 changes: 0 additions & 7 deletions package.json

This file was deleted.

1 change: 0 additions & 1 deletion packages/cli-hooks/.eslintignore

This file was deleted.

188 changes: 0 additions & 188 deletions packages/cli-hooks/.eslintrc.cjs

This file was deleted.

4 changes: 4 additions & 0 deletions packages/cli-hooks/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"extends": ["../../biome.json"]
}
9 changes: 3 additions & 6 deletions packages/cli-hooks/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"module": "es2022",
"moduleResolution": "node",
"esModuleInterop" : true,
"esModuleInterop": true,
"checkJs": true,

"strict": true,
Expand All @@ -14,14 +14,11 @@
"baseUrl": ".",
"paths": {
"*": ["./types/*"]
},
}
},
"include": [
"src/**/*"
],
"include": ["src/**/*"],
"jsdoc": {
"out": "support/jsdoc",
"access": "public"
}
}

14 changes: 4 additions & 10 deletions packages/cli-hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
"description": "Node implementation of the contract between the Slack CLI and Bolt for JavaScript",
"author": "Slack Technologies, LLC",
"license": "MIT",
"keywords": [
"slack",
"cli",
"hooks"
],
"keywords": ["slack", "cli", "hooks"],
"type": "module",
"main": "src/get-hooks.js",
"files": [
Expand Down Expand Up @@ -38,8 +34,8 @@
"prebuild": "shx rm -rf ./coverage",
"build": "shx chmod +x src/*.js",
"prelint": "tsc --noemit --module es2022 --maxNodeModuleJsDepth 0 --project ./jsconfig.json",
"lint": "eslint --ext .js src",
"pretest": "npm run lint -- --fix",
"lint": "npx @biomejs/biome check --write .",
"pretest": "npm run lint",
"test": "c8 mocha src/*.spec.js"
},
"bin": {
Expand All @@ -54,15 +50,13 @@
"semver": "^7.5.4"
},
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@types/minimist": "^1.2.5",
"@types/mocha": "^10.0.6",
"@types/node": "^22.5.2",
"@types/semver": "^7.5.6",
"@types/sinon": "^17.0.3",
"c8": "^10.1.2",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-jsdoc": "^50.2.2",
"eslint-plugin-node": "^11.1.0",
"mocha": "^10.2.0",
"shx": "^0.3.4",
"sinon": "^18.0.0",
Expand Down
31 changes: 18 additions & 13 deletions packages/cli-hooks/src/check-update.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env node

import childProcess from 'node:child_process';
import fs from 'node:fs';
import { fileURLToPath } from 'node:url';
import util from 'node:util';
import { clean, gt, major } from 'semver';
import { fileURLToPath } from 'url';
import childProcess from 'child_process';
import fs from 'fs';
import util from 'util';

import { getProtocol } from './protocols.js';

Expand Down Expand Up @@ -122,16 +122,20 @@ async function gatherDependencyFile(cwd) {
const inaccessibleFiles = [];
try {
const packageJSONFile = await getJSON(`${cwd}/${packageJSONFileName}`);
if ('devDependencies' in packageJSONFile &&
typeof packageJSONFile.devDependencies === 'object' &&
packageJSONFile.devDependencies !== null &&
Object.values(packageJSONFile.devDependencies).every((value) => (typeof value === 'string'))) {
if (
'devDependencies' in packageJSONFile &&
typeof packageJSONFile.devDependencies === 'object' &&
packageJSONFile.devDependencies !== null &&
Object.values(packageJSONFile.devDependencies).every((value) => typeof value === 'string')
) {
Object.assign(projectDependencies.dependencies, packageJSONFile.devDependencies);
}
if ('dependencies' in packageJSONFile &&
typeof packageJSONFile.dependencies === 'object' &&
packageJSONFile.dependencies !== null &&
Object.values(packageJSONFile.dependencies).every((value) => (typeof value === 'string'))) {
if (
'dependencies' in packageJSONFile &&
typeof packageJSONFile.dependencies === 'object' &&
packageJSONFile.dependencies !== null &&
Object.values(packageJSONFile.dependencies).every((value) => typeof value === 'string')
) {
Object.assign(projectDependencies.dependencies, packageJSONFile.dependencies);
}
} catch (err) {
Expand Down Expand Up @@ -213,7 +217,8 @@ async function fetchLatestPackageVersion(packageName) {
function getReleaseNotesUrl(packageName, latestVersion) {
if (packageName === SLACK_BOLT_SDK) {
return `https://github.com/slackapi/bolt-js/releases/tag/@slack/bolt@${latestVersion}`;
} if (packageName === SLACK_CLI_HOOKS) {
}
if (packageName === SLACK_CLI_HOOKS) {
return `https://github.com/slackapi/node-slack-sdk/releases/tag/@slack/cli-hooks@${latestVersion}`;
}
return undefined;
Expand Down
Loading