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
2 changes: 1 addition & 1 deletion .claude/skills/suggest/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Skip categories where things look fine. Don't invent problems.

**Runtime / tooling** (Bun-specific entries apply if used) — `node:*` APIs where Bun-native equivalents exist, `npm`/`yarn` artifacts in scripts, dependencies Bun now handles natively

**Linting** — `eslint.config.js` rules that are stale, redundant, or missing for the code in `scripts/`, `src/`, and `test/`
**Linting** — `.oxlintrc.json` rules that are stale, redundant, or missing for the code in `scripts/`, `src/`, and `test/`

**Packaging** — `package.json` `exports` conditions, `files`, and `types` that don't match what the build in `dist/` actually produces (ESM, CJS, IIFE, declarations)

Expand Down
104 changes: 47 additions & 57 deletions eslint.config.js → .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
import globals from 'globals';
import js from '@eslint/js';
import ts from 'typescript-eslint';

const rules = {
rules: {
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["eslint", "typescript"],
"categories": {
"correctness": "error"
},
"env": {
"browser": true
},
"rules": {
"accessor-pairs": "error",
"array-callback-return": "warn",
"arrow-spacing": "warn",
"block-scoped-var": "error",
"block-spacing": ["warn", "always"],
"brace-style": ["warn", "1tbs", { "allowSingleLine": true }],
"complexity": ["warn", 50],
"curly": ["warn", "multi-line"],
"default-case-last": "error",
"default-param-last": "error",
"dot-notation": "error",
"eqeqeq": ["error", "smart"],
"func-call-spacing": ["warn", "never"],
"grouped-accessor-pairs": "error",
"indent": ["off", 2],
"keyword-spacing": "error",
"linebreak-style": ["error", "unix"],
"no-await-in-loop": "off",
"no-caller": "error",
"no-catch-shadow": "error",
"no-console": "warn",
"no-constructor-return": "error",
"no-div-regex": "error",
Expand All @@ -33,47 +28,38 @@ const rules = {
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"no-floating-decimal": "error",
"no-global-assign": "error",
"no-implied-eval": "error",
"no-invalid-this": "error",
"no-iterator": "error",
"no-labels": "error",
"no-label-var": "error",
"no-lone-blocks": "error",
"no-loop-func": "error",
"no-loss-of-precision": "error",
"no-multi-str": "error",
"no-native-reassign": "error",
"no-new": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
"no-octal": "error",
"no-octal-escape": "error",
"no-process-env": "error",
"no-promise-executor-return": "error",
"no-proto": "error",
"no-prototype-builtins": "off",
"no-restricted-properties": "error",
"no-return-assign": "off",
"no-return-await": "error",
"no-script-url": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-shadow": "off",
"no-shadow-restricted-names": "error",
"no-template-curly-in-string": "warn",
"no-throw-literal": "error",
"no-trailing-spaces": "warn",
"no-undef": "error",
"no-undef-init": "warn",
"no-unexpected-multiline": "error",
"no-unneeded-ternary": "error",
"no-unmodified-loop-condition": "error",
"no-unreachable": "warn",
"no-unreachable-loop": "warn",
"no-unused-expressions": "error",
"no-unused-vars": "off", // typescript-eslint will check it
"no-unused-vars": ["warn", { "vars": "all", "args": "none", "caughtErrors": "none", "destructuredArrayIgnorePattern": "^_" }],
"no-use-before-define": ["off", "nofunc"],
"no-useless-backreference": "warn",
"no-useless-call": "warn",
Expand All @@ -84,46 +70,50 @@ const rules = {
"no-useless-rename": "warn",
"no-void": "error",
"no-warning-comments": "warn",
"no-whitespace-before-property": "warn",
"no-with": "error",
"radix": ["error", "always"],
"require-atomic-updates": "error",
"require-await": "error",
"semi": ["error", "always"],
"semi-spacing": "error",
"space-unary-ops": "error",
"wrap-regex": "off",

"@typescript-eslint/array-type": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-inferrable-types": ["warn", { "ignoreParameters": true }],
"@typescript-eslint/no-unused-vars": ["warn", { "vars": "all", "args": "none", "caughtErrors": "none", "destructuredArrayIgnorePattern": "^_" }]
}
};

export default [
js.configs.recommended,
...ts.configs.recommended,
...ts.configs.stylistic,
rules,
{
files: [ '**/*.{js,ts}' ],
languageOptions: {
globals: {
...globals.browser
}
}
// Rules from the ESLint and typescript-eslint recommended and stylistic sets
// that aren't in oxlint's "correctness" category
"no-array-constructor": "error",
"no-case-declarations": "error",
"no-empty": "error",
"no-fallthrough": "error",
"no-redeclare": "error",
"no-regex-spaces": "error",
"no-useless-assignment": "error",
"preserve-caught-error": "error",
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/ban-ts-comment": "error",
"@typescript-eslint/ban-tslint-comment": "error",
"@typescript-eslint/class-literal-property-style": "error",
"@typescript-eslint/consistent-generic-constructors": "error",
"@typescript-eslint/consistent-indexed-object-style": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/no-confusing-non-null-assertion": "error",
"@typescript-eslint/no-empty-object-type": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-unnecessary-type-constraint": "error",
"@typescript-eslint/no-unsafe-function-type": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error"
},
{
files: [ 'scripts/*', 'test/*' ],
languageOptions: {
globals: {
Bun: false
"overrides": [
{
"files": ["scripts/*", "test/*"],
"globals": {
"Bun": "readonly"
},
"rules": {
"no-console": "off"
}
},
rules: {
"no-console": "off"
}
}
];
]
}
Loading
Loading