Skip to content
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
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

66 changes: 0 additions & 66 deletions .eslintrc

This file was deleted.

4 changes: 0 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ updates:
prefix: chore(deps)
prefix-development: chore(deps-dev)
ignore:
# Blocked on this until we can bump our shared ESLint config to support ESLint 9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥹

- dependency-name: eslint
versions:
- '>= 8'
# There are ProxyAgent discrepancies between undici@6 and
# the Node.js fetch implementation (which uses undici@5).
# Until we use undici itself for fetch calls, we should
Expand Down
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["biomejs.biome"]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far this extension seems to work as well as the ESLint one.

}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
// explicitly disable ESLint to avoid conflicts with Biome
"eslint.enable": false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i added the changes in this file b/c i imagine there might be weird side effects when vscode is running eslint + biome simultaneously and i figured it's safer to be explicit here. we should probably do the same with prettier (i.e., explicitly disable the prettier extension and set the default formatter to biome) if/when we migrate off of that too.

"search.exclude": {
"**/dist-gha": true,
"CHANGELOG.md": true,
Expand Down
10 changes: 0 additions & 10 deletions __tests__/.eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion __tests__/bin.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { exec } from 'node:child_process';

import { describe, it, expect } from 'vitest';
import { describe, expect, it } from 'vitest';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import sorting like this is an out of the box thing.


describe('bin', () => {
it('should show our help screen', async () => {
Expand Down
10 changes: 5 additions & 5 deletions __tests__/commands/changelog/upload.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import fs from 'node:fs';

import prompts from 'prompts';
import { describe, afterEach, it, expect, beforeAll, beforeEach, vi } from 'vitest';
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';

import Command from '../../../src/commands/changelog/upload.js';
import { getAPIv1Mock, getAPIv2Mock, getAPIv2MockForGHA } from '../../helpers/get-api-mock.js';
import { githubActionsEnv } from '../../helpers/git-mock.js';
import { runCommand, type OclifOutput } from '../../helpers/oclif.js';
import { type OclifOutput, runCommand } from '../../helpers/oclif.js';

const key = 'rdme_123';
const authorization = `Bearer ${key}`;
Expand All @@ -27,11 +27,11 @@ describe(`rdme ${topic} upload`, () => {
parentPages: {},
});
vi.spyOn(fs, 'writeFileSync').mockImplementation((file, data) => {
// eslint-disable-next-line no-console
// biome-ignore lint/suspicious/noConsole: useful testing output
console.log(`=== BEGIN writeFileSync to file: ${file} ===`);
// eslint-disable-next-line no-console
// biome-ignore lint/suspicious/noConsole: useful testing output
console.log(data);
// eslint-disable-next-line no-console
// biome-ignore lint/suspicious/noConsole: useful testing output
console.log(`=== END writeFileSync to file: ${file} ===`);
});
});
Expand Down
8 changes: 5 additions & 3 deletions __tests__/commands/changelogs/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import type { PageObject } from '../../helpers/page.types.js';

import fs from 'node:fs';
import path from 'node:path';

import chalk from 'chalk';
import grayMatter from 'gray-matter';
import { describe, beforeAll, beforeEach, it, expect } from 'vitest';
import { beforeAll, beforeEach, describe, expect, it } from 'vitest';

import Command from '../../../src/commands/changelogs.js';
import { APIv1Error } from '../../../src/lib/apiError.js';
Expand Down Expand Up @@ -41,8 +43,8 @@ describe('rdme changelogs', () => {
});

describe('existing changelogs', () => {
let simpleDoc;
let anotherDoc;
let simpleDoc: PageObject;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It flagged that these didn't have an explicit type. I don't know where to put page.types.js but I didn't want to copy-paste this PageObject interface in a handful of files.

let anotherDoc: PageObject;

beforeEach(() => {
let fileContents = fs.readFileSync(path.join(fullFixturesDir, '/existing-docs/simple-doc.md'));
Expand Down
6 changes: 4 additions & 2 deletions __tests__/commands/changelogs/single.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import type { PageObject } from '../../helpers/page.types.js';

import fs from 'node:fs';
import path from 'node:path';

import chalk from 'chalk';
import grayMatter from 'gray-matter';
import { describe, beforeAll, beforeEach, it, expect } from 'vitest';
import { beforeAll, beforeEach, describe, expect, it } from 'vitest';

import Command from '../../../src/commands/changelogs.js';
import { APIv1Error } from '../../../src/lib/apiError.js';
Expand Down Expand Up @@ -156,7 +158,7 @@ describe('rdme changelogs (single)', () => {
});

describe('existing changelogs', () => {
let simpleDoc;
let simpleDoc: PageObject;

beforeEach(() => {
const fileContents = fs.readFileSync(path.join(fullFixturesDir, '/existing-docs/simple-doc.md'));
Expand Down
10 changes: 5 additions & 5 deletions __tests__/commands/custompages/upload.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import fs from 'node:fs';

import prompts from 'prompts';
import { describe, afterEach, it, expect, beforeAll, beforeEach, vi } from 'vitest';
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';

import CustomPagesCommand from '../../../src/commands/custompages/upload.js';
import { getAPIv1Mock, getAPIv2Mock, getAPIv2MockForGHA } from '../../helpers/get-api-mock.js';
import { githubActionsEnv } from '../../helpers/git-mock.js';
import { runCommand, type OclifOutput } from '../../helpers/oclif.js';
import { type OclifOutput, runCommand } from '../../helpers/oclif.js';

const key = 'rdme_123';
const authorization = `Bearer ${key}`;
Expand All @@ -24,11 +24,11 @@ describe('custompages upload', () => {
parentPages: {},
});
vi.spyOn(fs, 'writeFileSync').mockImplementation((file, data) => {
// eslint-disable-next-line no-console
// biome-ignore lint/suspicious/noConsole: useful testing output
console.log(`=== BEGIN writeFileSync to file: ${file} ===`);
// eslint-disable-next-line no-console
// biome-ignore lint/suspicious/noConsole: useful testing output
console.log(data);
// eslint-disable-next-line no-console
// biome-ignore lint/suspicious/noConsole: useful testing output
console.log(`=== END writeFileSync to file: ${file} ===`);
});
});
Expand Down
2 changes: 1 addition & 1 deletion __tests__/commands/docs/migrate.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { beforeAll, describe, expect, it } from 'vitest';

import Command from '../../../src/commands/docs/migrate.js';
import { runCommand, type OclifOutput } from '../../helpers/oclif.js';
import { type OclifOutput, runCommand } from '../../helpers/oclif.js';

describe('rdme docs migrate', () => {
let run: (args?: string[]) => OclifOutput;
Expand Down
4 changes: 2 additions & 2 deletions __tests__/commands/login.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import prompts from 'prompts';
import { describe, beforeAll, afterEach, it, expect } from 'vitest';
import { afterEach, beforeAll, describe, expect, it } from 'vitest';

import Command from '../../src/commands/login.js';
import configStore from '../../src/lib/configstore.js';
import { getAPIv1Mock } from '../helpers/get-api-mock.js';
import { runCommand, type OclifOutput } from '../helpers/oclif.js';
import { type OclifOutput, runCommand } from '../helpers/oclif.js';

const apiKey = 'abcdefg';
const email = 'user@example.com';
Expand Down
4 changes: 2 additions & 2 deletions __tests__/commands/logout.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, afterEach, beforeAll, it, expect } from 'vitest';
import { afterEach, beforeAll, describe, expect, it } from 'vitest';

import Command from '../../src/commands/logout.js';
import configStore from '../../src/lib/configstore.js';
import { runCommand, type OclifOutput } from '../helpers/oclif.js';
import { type OclifOutput, runCommand } from '../helpers/oclif.js';

describe('rdme logout', () => {
let run: (args?: string[]) => OclifOutput;
Expand Down
4 changes: 2 additions & 2 deletions __tests__/commands/openapi/convert.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import type { OASDocument } from 'oas/types';
import fs from 'node:fs';

import prompts from 'prompts';
import { describe, it, expect, vi, beforeAll, beforeEach, afterEach, type MockInstance } from 'vitest';
import { afterEach, beforeAll, beforeEach, describe, expect, it, type MockInstance, vi } from 'vitest';

import Command from '../../../src/commands/openapi/convert.js';
import { runCommand, type OclifOutput } from '../../helpers/oclif.js';
import { type OclifOutput, runCommand } from '../../helpers/oclif.js';

describe('rdme openapi convert', () => {
let fsWriteFileSyncSpy: MockInstance<typeof fs.writeFileSync>;
Expand Down
5 changes: 2 additions & 3 deletions __tests__/commands/openapi/inspect.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable @vitest/no-conditional-expect */
import { describe, it, expect, beforeAll } from 'vitest';
import { beforeAll, describe, expect, it } from 'vitest';

import Command from '../../../src/commands/openapi/inspect.js';
import { runCommand, type OclifOutput } from '../../helpers/oclif.js';
import { type OclifOutput, runCommand } from '../../helpers/oclif.js';

describe('rdme openapi inspect', () => {
let run: (args?: string[]) => OclifOutput;
Expand Down
4 changes: 2 additions & 2 deletions __tests__/commands/openapi/reduce.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import type { OASDocument } from 'oas/types';
import fs from 'node:fs';

import prompts from 'prompts';
import { describe, beforeAll, beforeEach, afterEach, it, expect, vi, type MockInstance } from 'vitest';
import { afterEach, beforeAll, beforeEach, describe, expect, it, type MockInstance, vi } from 'vitest';

import Command from '../../../src/commands/openapi/reduce.js';
import { runCommand, type OclifOutput } from '../../helpers/oclif.js';
import { type OclifOutput, runCommand } from '../../helpers/oclif.js';

describe('rdme openapi reduce', () => {
let fsWriteFileSyncSpy: MockInstance<typeof fs.writeFileSync>;
Expand Down
4 changes: 2 additions & 2 deletions __tests__/commands/openapi/resolve.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import fs from 'node:fs';

import prompts from 'prompts';
import { describe, beforeAll, beforeEach, afterEach, it, expect, vi, type MockInstance } from 'vitest';
import { afterEach, beforeAll, beforeEach, describe, expect, it, type MockInstance, vi } from 'vitest';

import Command from '../../../src/commands/openapi/resolve.js';
import { runCommand, type OclifOutput } from '../../helpers/oclif.js';
import { type OclifOutput, runCommand } from '../../helpers/oclif.js';

describe('openapi resolve', () => {
let fsWriteFileSyncSpy: MockInstance<typeof fs.writeFileSync>;
Expand Down
2 changes: 1 addition & 1 deletion __tests__/commands/openapi/upload.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Command from '../../../src/commands/openapi/upload.js';
import petstore from '../../__fixtures__/petstore-simple-weird-version.json' with { type: 'json' };
import { getAPIv2Mock, getAPIv2MockForGHA } from '../../helpers/get-api-mock.js';
import { githubActionsEnv } from '../../helpers/git-mock.js';
import { runCommand, type OclifOutput } from '../../helpers/oclif.js';
import { type OclifOutput, runCommand } from '../../helpers/oclif.js';

const key = 'rdme_123';
const branch = '1.0.0';
Expand Down
8 changes: 4 additions & 4 deletions __tests__/commands/openapi/validate.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import fs from 'node:fs';

import prompts from 'prompts';
import { describe, beforeAll, beforeEach, afterEach, it, expect, vi } from 'vitest';
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';

import Command from '../../../src/commands/openapi/validate.js';
import { gitMock } from '../../helpers/git-mock.js';
import { runCommand, runCommandWithHooks, type OclifOutput } from '../../helpers/oclif.js';
import { type OclifOutput, runCommand, runCommandWithHooks } from '../../helpers/oclif.js';

describe('rdme openapi validate', () => {
let run: (args?: string[]) => OclifOutput;
Expand Down Expand Up @@ -109,10 +109,10 @@ describe('rdme openapi validate', () => {
});

describe('GHA onboarding E2E tests', () => {
let yamlOutput;
let yamlOutput: string;

beforeEach(() => {
gitMock.before((fileName, data) => {
gitMock.before((fileName, data: string) => {
yamlOutput = data;
});
});
Expand Down
10 changes: 5 additions & 5 deletions __tests__/commands/pages/upload.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import fs from 'node:fs';

import nock from 'nock';
import prompts from 'prompts';
import { describe, afterEach, it, expect, beforeAll, beforeEach, vi } from 'vitest';
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';

import GuidesCommand from '../../../src/commands/docs/upload.js';
import ReferenceCommand from '../../../src/commands/reference/upload.js';
import { getAPIv1Mock, getAPIv2Mock, getAPIv2MockForGHA } from '../../helpers/get-api-mock.js';
import { githubActionsEnv } from '../../helpers/git-mock.js';
import { runCommand, type OclifOutput } from '../../helpers/oclif.js';
import { type OclifOutput, runCommand } from '../../helpers/oclif.js';

const key = 'rdme_123';
const authorization = `Bearer ${key}`;
Expand All @@ -29,11 +29,11 @@ describe.each([
parentPages: {},
});
vi.spyOn(fs, 'writeFileSync').mockImplementation((file, data) => {
// eslint-disable-next-line no-console
// biome-ignore lint/suspicious/noConsole: useful testing output
console.log(`=== BEGIN writeFileSync to file: ${file} ===`);
// eslint-disable-next-line no-console
// biome-ignore lint/suspicious/noConsole: useful testing output
console.log(data);
// eslint-disable-next-line no-console
// biome-ignore lint/suspicious/noConsole: useful testing output
console.log(`=== END writeFileSync to file: ${file} ===`);
});
});
Expand Down
4 changes: 2 additions & 2 deletions __tests__/commands/whoami.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, afterEach, it, expect, beforeAll } from 'vitest';
import { afterEach, beforeAll, describe, expect, it } from 'vitest';

import Command from '../../src/commands/whoami.js';
import configStore from '../../src/lib/configstore.js';
import { runCommand, type OclifOutput } from '../helpers/oclif.js';
import { type OclifOutput, runCommand } from '../helpers/oclif.js';

describe('rdme whoami', () => {
let run: (args?: string[]) => OclifOutput;
Expand Down
1 change: 0 additions & 1 deletion __tests__/helpers/get-api-mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import nock from 'nock';

import config from '../../src/lib/config.js';
import { getUserAgent } from '../../src/lib/readmeAPIFetch.js';

import { mockVersion } from './oclif.js';

/**
Expand Down
Loading
Loading