Skip to content

Commit 097a1d5

Browse files
authored
chore: Remove eslint-plugin-prettier (#1386)
1 parent 98e358a commit 097a1d5

12 files changed

Lines changed: 486 additions & 698 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@ jobs:
3232
- name: Build TypeScript
3333
run: npm run build
3434

35-
- name: Run tests
35+
- name: Run lint, format, spellcheck
3636
run: |
3737
npm run lint
38-
npm run test:unit -- --coverage
38+
npm run format
39+
npm run spellcheck
40+
41+
- name: Run tests
42+
run: npm run test:unit -- --coverage
3943

4044
- name: Codecov
4145
uses: codecov/codecov-action@v4

.github/workflows/release-please.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
# > By default, Release Please uses the built-in GITHUB_TOKEN secret.
2323
# > However, all resources created by release-please (release tag or release pull request) will not trigger future GitHub actions workflows,
24-
# > and workflows normally triggered by release.created events will also not run.
24+
# > and workflows normally triggered by release.created events will also not run.
2525
# https://github.com/googleapis/release-please-action?tab=readme-ov-file#other-actions-on-release-please-prs
2626
token: ${{ secrets.GH_PAT }}
2727
release-type: node
@@ -32,7 +32,7 @@ jobs:
3232
- uses: actions/setup-node@v4
3333
with:
3434
node-version: "24.9.0"
35-
registry-url: 'https://registry.npmjs.org'
35+
registry-url: "https://registry.npmjs.org"
3636
if: ${{ steps.release.outputs.release_created }}
3737

3838
- run: npm install -g npm@latest
@@ -43,4 +43,3 @@ jobs:
4343

4444
- run: npm publish
4545
if: ${{ steps.release.outputs.release_created }}
46-

.vscode/extensions.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
{
2-
"recommendations": [
3-
"esbenp.prettier-vscode",
4-
"dbaeumer.vscode-eslint"
5-
]
2+
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
63
}

CHANGELOG.md

Lines changed: 431 additions & 573 deletions
Large diffs are not rendered by default.

CLAUDE.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Masto.js is a universal Mastodon API client for JavaScript/TypeScript that works
99
## Development Commands
1010

1111
### Building
12+
1213
```bash
1314
npm run build # Build both ESM and CJS outputs
1415
npm run build:esm # Build ESM only
@@ -18,6 +19,7 @@ npm run build:cjs # Build CJS only
1819
The build process uses `tsconfig-to-dual-package` to generate dual ESM/CJS outputs from separate TypeScript configs.
1920

2021
### Testing
22+
2123
```bash
2224
npm test # Run all tests (unit + e2e)
2325
npm run test:unit # Run unit tests only (uses Vitest)
@@ -27,18 +29,21 @@ npm run test:e2e # Run e2e tests only (requires Mastodon instance)
2729
**Important**: E2E tests require a local Mastodon instance running at `http://localhost:3000` with admin credentials (`admin@localhost` / `mastodonadmin`). The test setup automatically creates OAuth apps and tokens, caching them in `node_modules/.cache/masto/`.
2830

2931
### Linting
32+
3033
```bash
3134
npm run lint # Run all linters
3235
npm run lint:eslint # Run ESLint only
3336
npm run lint:spellcheck # Run spellcheck only
3437
```
3538

3639
### Documentation
40+
3741
```bash
3842
npm run docs:build # Generate TypeDoc documentation
3943
```
4044

4145
### Running Single Tests
46+
4247
```bash
4348
npx vitest --project unit src/path/to/file.spec.ts
4449
npx vitest --project e2e tests/path/to/file.spec.ts
@@ -97,11 +102,13 @@ When you call `masto.v1.statuses.create({ status: "Hello" })`:
97102
## Testing Strategy
98103

99104
### Unit Tests (`src/**/*.spec.ts`)
105+
100106
- Located alongside source files
101107
- Test individual functions and edge cases
102108
- Used for exception handling and logic that's hard to test E2E
103109

104110
### E2E Tests (`tests/**/*.spec.ts`)
111+
105112
- Primary testing approach
106113
- Use real Mastodon server at `localhost:3000`
107114
- Leverage `sessions` global for test account management:
@@ -115,7 +122,7 @@ await session.rest.v1.statuses.create({ status: "test" });
115122
await using alice = await sessions.acquire();
116123
await using bob = await sessions.acquire();
117124
await alice.rest.v1.statuses.create({
118-
status: `Hello @${bob.account.acct}`
125+
status: `Hello @${bob.account.acct}`,
119126
});
120127
```
121128

@@ -171,11 +178,12 @@ Keep bundle size minimal - this is a key project goal tracked via size-limit in
171178
### Debugging Proxy Behavior
172179

173180
Set the `log` option when creating clients:
181+
174182
```typescript
175183
const masto = createRestAPIClient({
176184
url: "https://mastodon.social",
177185
accessToken: "...",
178-
log: "debug" // "debug" | "info" | "warn" | "error"
186+
log: "debug", // "debug" | "info" | "warn" | "error"
179187
});
180188
```
181189

CODE_OF_CONDUCT.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
1414
Examples of behavior that contributes to creating a positive environment
1515
include:
1616

17-
* Using welcoming and inclusive language
18-
* Being respectful of differing viewpoints and experiences
19-
* Gracefully accepting constructive criticism
20-
* Focusing on what is best for the community
21-
* Showing empathy towards other community members
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
2222

2323
Examples of unacceptable behavior by participants include:
2424

25-
* The use of sexualized language or imagery and unwelcome sexual attention or
26-
advances
27-
* Trolling, insulting/derogatory comments, and personal or political attacks
28-
* Public or private harassment
29-
* Publishing others' private information, such as a physical or electronic
30-
address, without explicit permission
31-
* Other conduct which could reasonably be considered inappropriate in a
32-
professional setting
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
3333

3434
## Our Responsibilities
3535

cspell.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
{
22
"version": "0.2",
33
"language": "en,en-GB",
4-
"ignorePaths": [
5-
"**/node_modules/**",
6-
"**/dist/**"
7-
],
4+
"ignorePaths": ["**/node_modules/**", "**/dist/**"],
85
"words": [
96
"AGPL",
107
"asynckit",
@@ -21,6 +18,7 @@
2118
"gifv",
2219
"Gmail",
2320
"hostsupdater",
21+
"isomorphic",
2422
"idempotency",
2523
"Igarashi",
2624
"KeyBase",
@@ -49,8 +47,10 @@
4947
"unbookmark",
5048
"undici",
5149
"unendorse",
50+
"unendorses",
5251
"unfavourite",
5352
"unfeature",
53+
"unfeatures",
5454
"unfetch",
5555
"unfollow",
5656
"unprocessable",

eslint.config.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
/* eslint-disable import/no-named-as-default-member */
12
import eslint from "@eslint/js";
3+
import { defineConfig, globalIgnores } from "eslint/config";
4+
import eslintConfigPrettier from "eslint-config-prettier/flat";
25
import importPlugin from "eslint-plugin-import";
3-
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
46
import simpleImportSort from "eslint-plugin-simple-import-sort";
57
import eslintPluginUnicorn from "eslint-plugin-unicorn";
68
import globals from "globals";
@@ -9,17 +11,13 @@ import tseslint from "typescript-eslint";
911
import allowNullInOptionalParameter from "./eslint/allow-null-in-optional-parameter.js";
1012
import namingConvention from "./eslint/naming-convention.js";
1113

12-
export default tseslint.config(
14+
export default defineConfig(
1315
eslint.configs.recommended,
14-
// eslint-disable-next-line import/no-named-as-default-member
15-
...tseslint.configs.strict,
16+
tseslint.configs.strict,
1617
importPlugin.flatConfigs.recommended,
1718
importPlugin.flatConfigs.typescript,
1819
eslintPluginUnicorn.configs.recommended,
19-
eslintPluginPrettierRecommended,
20-
{
21-
ignores: ["dist/**/*", "docs/**/*", "coverage/**/*", "playground/**/*"],
22-
},
20+
eslintConfigPrettier,
2321
{
2422
settings: {
2523
"import/resolver": {
@@ -45,7 +43,7 @@ export default tseslint.config(
4543
"unicorn/no-array-reduce": "off",
4644
"no-restricted-imports": [
4745
"error",
48-
{ paths: [{ name: "ws", message: "Use `isomophic-ws` instead." }] },
46+
{ paths: [{ name: "ws", message: "Use `isomorphic-ws` instead." }] },
4947
],
5048
},
5149
},
@@ -107,4 +105,5 @@ export default tseslint.config(
107105
"unicorn/no-process-exit": "off",
108106
},
109107
},
108+
globalIgnores(["dist/**/*", "docs/**/*", "coverage/**/*", "playground/**/*"]),
110109
);

package-lock.json

Lines changed: 0 additions & 79 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
"test:typecheck": "tsc --project tsconfig.test.json",
4141
"test:unit": "vitest --project unit",
4242
"test:e2e": "vitest --project e2e",
43-
"lint": "npm-run-all lint:*",
44-
"lint:eslint": "eslint --report-unused-disable-directives --cache",
45-
"lint:spellcheck": "cspell --quiet '{src,test,test-utils}/**/*.{ts,tsx,js,json,md}'",
43+
"lint": "eslint --report-unused-disable-directives --cache",
44+
"spellcheck": "cspell --quiet --gitignore './**/*.{ts,js}'",
45+
"format": "prettier './**/*.{ts,js}' --check",
4646
"build": "npm-run-all build:* && tsconfig-to-dual-package tsconfig.esm.json tsconfig.cjs.json",
4747
"build:esm": "tsc --project tsconfig.esm.json",
4848
"build:cjs": "tsc --project tsconfig.cjs.json",
@@ -71,7 +71,6 @@
7171
"eslint-config-prettier": "^10.1.8",
7272
"eslint-import-resolver-typescript": "^4.4.4",
7373
"eslint-plugin-import": "^2.31.0",
74-
"eslint-plugin-prettier": "^5.5.4",
7574
"eslint-plugin-simple-import-sort": "^12.1.1",
7675
"eslint-plugin-unicorn": "^61.0.2",
7776
"get-port": "^7.1.0",

0 commit comments

Comments
 (0)