lint: move last remaining native eslint rules to oxlint (create new alternatives) (#6468)

* lint: clean up unnecessary config and disables

* fix: update package import path in browser preload script

* lint: create custom ESLint rules for rules not in oxlint

- Add object-shorthand-properties rule (replaces object-shorthand)
- Add prefer-const rule (replaces prefer-const)
- Add no-anchor-tag rule (replaces no-restricted-syntax for <a> tags)
- Add no-react-default-import rule (replaces no-restricted-syntax for React.*)

These custom rules are needed because oxlint doesn't support these rules yet.
All rules are properly tested and integrated into the ESLint config.

* refactor: enhance prefer-const rule to track variable reassignments by scope

- Introduced a mapping of scopes to reassigned variable names, improving the accuracy of the prefer-const rule.
- Added helper functions to determine variable scopes and reassignment status.
- Updated logic to check variable reassignments during declaration analysis.
- Adjusted test cases to reflect changes in variable handling.
This commit is contained in:
Matiss Janis Aboltins
2026-01-05 10:00:44 +01:00
committed by GitHub
parent 88fbfe7078
commit f1faf45659
17 changed files with 1162 additions and 57 deletions

View File

@@ -25,6 +25,10 @@
"actual/prefer-trans-over-t": "error",
"actual/prefer-if-statement": "warn",
"actual/prefer-logger-over-console": "error",
"actual/object-shorthand-properties": "warn",
"actual/prefer-const": "warn",
"actual/no-anchor-tag": "warn",
"actual/no-react-default-import": "warn",
// JSX A11y rules
"jsx-a11y/no-autofocus": [
@@ -410,6 +414,12 @@
"import/no-default-export": "off"
}
},
{
"files": ["packages/docs/**/*"],
"rules": {
"actual/no-anchor-tag": "off"
}
},
// TODO: enable these
{
"files": [