Skip to content
Open
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
5 changes: 5 additions & 0 deletions .changeset/beige-rats-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rnx-kit/oxlint-config": major
---

Shareable oxlint configurations
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
- packages/babel-preset-metro-react-native/**/*
- packages/metro-*/**/*
- packages/typescript-service/**/*
"feature: oxlint":
- changed-files:
- any-glob-to-any-file:
- packages/oxlint-*/**/*
"feature: sdk":
- changed-files:
- any-glob-to-any-file:
Expand Down
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,5 @@ catalog:
eslint: ^9.0.0
jest: ^29.2.1
oxfmt: ^0.35.0
oxlint: ^1.50.0
typescript: ^5.0.0

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@rnx-kit/eslint-config": "*",
"@rnx-kit/scripts": "*",
"@rnx-kit/tsconfig": "*",
"@types/node": "^24.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type BatteryStatus = {
level: number;
};

// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
// oxlint-disable-next-line typescript/consistent-type-definitions
export interface Spec extends TurboModule {
getStatus(): Promise<BatteryStatus>;
}
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion incubator/@react-native-webapis/web-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@rnx-kit/eslint-config": "*",
"@rnx-kit/scripts": "*",
"@rnx-kit/tsconfig": "*",
"react": "19.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { TurboModule } from "react-native";
import { TurboModuleRegistry } from "react-native";

// https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
// oxlint-disable-next-line typescript/consistent-type-definitions
export interface Spec extends TurboModule {
length: () => number;
key(index: number): string | null;
Expand Down
4 changes: 0 additions & 4 deletions incubator/build-plugin-firebase/eslint.config.js

This file was deleted.

1 change: 0 additions & 1 deletion incubator/build-plugin-firebase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
},
"devDependencies": {
"@rnx-kit/build": "*",
"@rnx-kit/eslint-config": "*",
"@rnx-kit/scripts": "*",
"@rnx-kit/tsconfig": "*"
},
Expand Down
4 changes: 0 additions & 4 deletions incubator/build/eslint.config.js

This file was deleted.

1 change: 0 additions & 1 deletion incubator/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
"yargs": "^16.0.0"
},
"devDependencies": {
"@rnx-kit/eslint-config": "*",
"@rnx-kit/scripts": "*",
"@rnx-kit/tsconfig": "*",
"@types/node": "^24.0.0",
Expand Down
13 changes: 12 additions & 1 deletion incubator/fork-sync/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import config from "@rnx-kit/eslint-config";

// eslint-disable-next-line no-restricted-exports
export default [
...config,
{
Expand All @@ -9,4 +8,16 @@ export default [
"@typescript-eslint/consistent-type-definitions": "off",
},
},
{
files: ["eslint.config.js", "oxlint.config.ts"],
rules: {
"no-restricted-exports": "off",
},
},
{
files: ["test/proc.test.ts", "test/tty-ui.test.ts"],
rules: {
"no-control-regex": "off",
},
},
];
25 changes: 25 additions & 0 deletions incubator/fork-sync/oxlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import config from "@rnx-kit/oxlint-config/private";
import { defineConfig } from "oxlint";

export default defineConfig({
extends: [config],
rules: {
// fork-sync uses interfaces extensively; allow both interface and type
"typescript/consistent-type-definitions": "off",
"no-new-array": "off",
},
overrides: [
{
files: ["eslint.config.js", "oxlint.config.ts"],
rules: {
"import/no-default-export": "off",
},
},
{
files: ["test/proc.test.ts", "test/tty-ui.test.ts"],
rules: {
"no-control-regex": "off",
},
},
],
});
1 change: 1 addition & 0 deletions incubator/fork-sync/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
},
"devDependencies": {
"@rnx-kit/eslint-config": "*",
Copy link
Member

Choose a reason for hiding this comment

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

If we keep the eslint config, then we should keep the ESLint exclusions too.
Currently if I run the ESLint for the fork-sync it will fail because the important suppressions are removed.
IMHO, we either should do the complete conversion, or keep the old suppressions if we want to support both.

Copy link
Member Author

Choose a reason for hiding this comment

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

fork-sync is the only package where I've left in the ESLint support for now. I wasn't sure whether you're still relying on it. The old suppressions should've been kept in. I simply missed them.

"@rnx-kit/oxlint-config": "*",
"@rnx-kit/scripts": "*",
"@rnx-kit/tsconfig": "*",
"@types/node": "^24.0.0"
Expand Down
1 change: 0 additions & 1 deletion incubator/fork-sync/test/proc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {

/** Strip ANSI escape codes from string (colors, etc.) */
function stripAnsi(str: string): string {
// eslint-disable-next-line no-control-regex
return str.replace(/\x1B\[[0-9;]*m/g, "");
}

Expand Down
1 change: 0 additions & 1 deletion incubator/fork-sync/test/tty-ui.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import type { ProgressLine, ProgressState } from "../src/modules/tty-ui.ts";
import * as ui from "../src/modules/tty-ui.ts";

// Helper to strip ANSI escape codes for test assertions
// eslint-disable-next-line no-control-regex
const stripAnsi = (s: string) => s.replace(/\x1b\[[0-9;]*m/g, "");

// =============================================================================
Expand Down
1 change: 0 additions & 1 deletion incubator/lint-lockfile/eslint.config.js

This file was deleted.

1 change: 0 additions & 1 deletion incubator/lint-lockfile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"js-yaml": "^4.1.1"
},
"devDependencies": {
"@rnx-kit/eslint-config": "*",
"@rnx-kit/scripts": "*",
"@rnx-kit/tsconfig": "*",
"@types/js-yaml": "^4.0.5"
Expand Down
1 change: 0 additions & 1 deletion incubator/polyfills/eslint.config.js

This file was deleted.

1 change: 0 additions & 1 deletion incubator/polyfills/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"@rnx-kit/tools-node": "^3.0.3"
},
"devDependencies": {
"@rnx-kit/eslint-config": "*",
"@rnx-kit/scripts": "*",
"@rnx-kit/tsconfig": "*",
"@types/babel__core": "^7.0.0",
Expand Down
3 changes: 0 additions & 3 deletions incubator/reporter/eslint.config.js

This file was deleted.

1 change: 0 additions & 1 deletion incubator/reporter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"test": "rnx-kit-scripts test"
},
"devDependencies": {
"@rnx-kit/eslint-config": "*",
"@rnx-kit/scripts": "*",
"@rnx-kit/tsconfig": "*"
},
Expand Down
2 changes: 1 addition & 1 deletion incubator/reporter/test/levels.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe("levels", () => {

// Attempting to modify should not change the array
assert.throws(() => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line typescript/no-explicit-any
(ALL_LOG_LEVELS as any).push("new-level");
});

Expand Down
6 changes: 3 additions & 3 deletions incubator/reporter/test/output.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ describe("output", () => {

it("should handle invalid log level gracefully", () => {
// Use an invalid log level and verify it defaults to first level
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line typescript/no-explicit-any
const output = createOutput("invalid" as any);

// Should only have error function (first level)
Expand Down Expand Up @@ -405,7 +405,7 @@ describe("output", () => {

describe("edge cases", () => {
it("should handle undefined log level gracefully", () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line typescript/no-explicit-any
const output = createOutput(undefined as any);

// Should default to default log level behavior
Expand All @@ -416,7 +416,7 @@ describe("output", () => {
});

it("should handle null output functions", () => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line typescript/no-explicit-any
const output = createOutput("log", null as any, null as any);

// Should fall back to console outputs
Expand Down
2 changes: 1 addition & 1 deletion incubator/reporter/test/session.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ describe("session", () => {
const session = createSession(options, undefined, mockCreateReporter);

// Use the internal behavior - when finish is called without explicit result, it's undefined
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line typescript/no-explicit-any
const result = (session as any).finish();

assert.strictEqual(result, undefined);
Expand Down
8 changes: 4 additions & 4 deletions incubator/reporter/test/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
serialize,
} from "../src/utils.ts";

// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line typescript/no-explicit-any
type TestAny = any;

describe("utils", () => {
Expand Down Expand Up @@ -96,7 +96,7 @@ describe("utils", () => {
describe("resolveFunction", () => {
it("should handle synchronous functions that succeed", () => {
const syncFn = () => "sync result";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line typescript/no-explicit-any
let finalResult: any;

const result = resolveFunction(syncFn, (res): string => {
Expand All @@ -116,10 +116,10 @@ describe("utils", () => {
const syncFn = (): never => {
throw new Error("sync error");
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line typescript/no-explicit-any
let finalResult: any;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
// oxlint-disable-next-line typescript/no-explicit-any
const result = resolveFunction(syncFn, (res): any => {
finalResult = res;
if ("error" in res) {
Expand Down
4 changes: 2 additions & 2 deletions incubator/rn-changelog-generator/src/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function filterRevertCommits(commits: Commit[]) {
})
.filter((item) => {
const text = item.commit.message.split("\n")[0].toLowerCase();
// eslint-disable-next-line @rnx-kit/no-foreach-with-captured-variables
// oxlint-disable-next-line @rnx-kit/no-foreach-with-captured-variables
revertCommits.forEach((revertCommit) => {
if (levenshtein.get(text, revertCommit) < 0.5 * revertCommit.length) {
revertCommits = revertCommits.filter(function (e) {
Expand Down Expand Up @@ -311,7 +311,7 @@ export function getChangelogDesc(
const acc = deepmerge(CHANGES_TEMPLATE, {});
const commitsWithoutExactChangelogTemplate: string[] = [];

// eslint-disable-next-line @rnx-kit/no-foreach-with-captured-variables
// oxlint-disable-next-line @rnx-kit/no-foreach-with-captured-variables
commits.forEach((item) => {
const {
changeCategory,
Expand Down
2 changes: 1 addition & 1 deletion incubator/rn-changelog-generator/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (require.main === module) {
.help("help").argv;
}

// eslint-disable-next-line no-restricted-exports
// oxlint-disable-next-line no-default-export
export default {
validate: validateChangelog,
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import validateChangelog from "../../src/utils/validateChangelog";
import { validateChangelog } from "../../src/utils/validateChangelog";

const missing = `
This is a changelog that is missing the formatted changelog.
Expand Down
1 change: 0 additions & 1 deletion incubator/tools-typescript/eslint.config.js

This file was deleted.

1 change: 0 additions & 1 deletion incubator/tools-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"@rnx-kit/typescript-service": "^2.0.0"
},
"devDependencies": {
"@rnx-kit/eslint-config": "*",
"@rnx-kit/jest-preset": "*",
"@rnx-kit/scripts": "*",
"@rnx-kit/tsconfig": "*",
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion incubator/yarn-plugin-dynamic-extensions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"test": "rnx-kit-scripts test"
},
"devDependencies": {
"@rnx-kit/eslint-config": "*",
"@rnx-kit/scripts": "*",
"@rnx-kit/tsconfig": "*",
"@yarnpkg/core": "^4.0.0",
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion incubator/yarn-plugin-external-workspaces/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"test": "rnx-kit-scripts test"
},
"devDependencies": {
"@rnx-kit/eslint-config": "*",
"@rnx-kit/scripts": "*",
"@rnx-kit/tsconfig": "*",
"@types/node": "^24.0.0",
Expand Down
2 changes: 1 addition & 1 deletion incubator/yarn-plugin-external-workspaces/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ const plugin: Plugin = {
commands: [OutputWorkspaces],
};

// eslint-disable-next-line no-restricted-exports
// oxlint-disable-next-line no-default-export
export default plugin;
1 change: 0 additions & 1 deletion incubator/yarn-plugin-install-to/eslint.config.js

This file was deleted.

1 change: 0 additions & 1 deletion incubator/yarn-plugin-install-to/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"test": "rnx-kit-scripts test"
},
"devDependencies": {
"@rnx-kit/eslint-config": "*",
"@rnx-kit/scripts": "*",
"@rnx-kit/tsconfig": "*",
"@types/node": "^24.0.0",
Expand Down
2 changes: 1 addition & 1 deletion incubator/yarn-plugin-install-to/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ const plugin: Plugin = {
commands: [InstallTo],
};

// eslint-disable-next-line no-restricted-exports
// oxlint-disable-next-line no-default-export
export default plugin;
1 change: 1 addition & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"{workspaceRoot}/packages/eslint-config/*",
"{workspaceRoot}/packages/eslint-plugin/*",
"{workspaceRoot}/packages/jest-preset/*",
"{workspaceRoot}/packages/oxlint-config/*",
"{workspaceRoot}/packages/tsconfig/*",
"{workspaceRoot}/yarn.lock"
],
Expand Down
Loading
Loading