lint: move actual eslint rules to oxlint and some eslint (#6462)

* lint: move actual eslint rules to oxlint and some eslint

* Update ESLint configuration to remove test file patterns from linting

* Add review status configuration to .coderabbit.yaml

* Remove oxlint plugin from ESLint configuration and package dependencies
This commit is contained in:
Matiss Janis Aboltins
2025-12-20 23:00:35 +00:00
committed by GitHub
parent 1a6b53aa28
commit 1fe1bad2f8
6 changed files with 26 additions and 57 deletions

View File

@@ -1,3 +1,5 @@
issue_enrichment:
auto_enrich:
enabled: false
reviews:
review_status: false

View File

@@ -1,6 +1,7 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["react", "typescript", "import", "jsx-a11y"],
"jsPlugins": ["./packages/eslint-plugin-actual/lib/index.js"],
"env": {
"browser": true,
"jest": true,
@@ -18,8 +19,12 @@
"jsx-a11y/prefer-tag-over-role": "off",
"jsx-a11y/tabindex-no-positive": "off",
// Keep these rules
"no-var": "warn",
// Actual rules
"actual/typography": "warn",
"actual/no-untranslated-strings": "error",
"actual/prefer-trans-over-t": "error",
"actual/prefer-if-statement": "warn",
"actual/prefer-logger-over-console": "error",
// JSX A11y rules
"jsx-a11y/no-autofocus": [
@@ -173,6 +178,7 @@
"eslint/no-invalid-regexp": "warn",
"eslint/no-iterator": "warn",
"eslint/no-label-var": "warn",
"eslint/no-var": "warn",
"eslint/no-labels": [
"warn",
{
@@ -198,6 +204,8 @@
"eslint/no-global-assign": "warn",
"eslint/no-lone-blocks": "warn",
"eslint/no-unused-labels": "warn",
"eslint/no-object-constructor": "warn",
"eslint/no-new-native-nonconstructor": "warn",
"eslint/no-redeclare": "warn",
"eslint/no-useless-computed-key": "warn",
"eslint/no-useless-concat": "warn",
@@ -383,6 +391,13 @@
"react/exhaustive-deps": "off"
}
},
{
"files": ["**/*.test.{js,ts,jsx,tsx}", "packages/docs/**/*"],
"rules": {
"actual/no-untranslated-strings": "off",
"actual/prefer-logger-over-console": "off"
}
},
{
"files": [
"packages/api/migrations/*",

View File

@@ -1,12 +1,9 @@
import oxlint from 'eslint-plugin-oxlint';
import pluginPerfectionist from 'eslint-plugin-perfectionist';
import pluginTypescriptPaths from 'eslint-plugin-typescript-paths';
import { defineConfig } from 'eslint/config';
import globals from 'globals';
import pluginTypescript from 'typescript-eslint';
import pluginActual from './packages/eslint-plugin-actual/lib/index.js';
export default defineConfig(
{
ignores: [
@@ -75,26 +72,9 @@ export default defineConfig(
pluginTypescript.configs.base,
{
plugins: {
actual: pluginActual,
perfectionist: pluginPerfectionist,
},
rules: {
'actual/typography': 'warn',
'actual/no-untranslated-strings': 'error',
'actual/prefer-trans-over-t': 'error',
},
},
{
files: ['**/*.{js,ts,jsx,tsx,mjs,mts}'],
rules: {
// http://eslint.org/docs/rules/
'no-dupe-args': 'warn',
'no-new-object': 'warn',
'no-new-symbol': 'warn',
'no-octal': 'warn',
'no-octal-escape': 'warn',
strict: ['warn', 'never'],
'no-restricted-properties': [
'error',
{
@@ -142,9 +122,6 @@ export default defineConfig(
},
],
'actual/prefer-if-statement': 'warn',
'actual/prefer-logger-over-console': 'error',
'object-shorthand': ['warn', 'properties'],
'no-restricted-syntax': [
@@ -163,7 +140,6 @@ export default defineConfig(
},
],
// Rules disabled during TS migration
'prefer-const': 'warn',
},
},
@@ -180,29 +156,10 @@ export default defineConfig(
'typescript-paths/absolute-import': ['error', { enableAlias: false }],
},
},
{
files: [
'eslint.config.mjs',
'**/*.test.js',
'**/*.test.ts',
'**/*.test.jsx',
'**/*.test.tsx',
'**/*.spec.js',
],
rules: {
'actual/no-untranslated-strings': 'off',
'actual/prefer-logger-over-console': 'off',
},
},
{
files: ['packages/docs/**/*'],
rules: {
'actual/no-untranslated-strings': 'off',
'no-restricted-syntax': 'off',
},
},
// Disable ESLint rules that are already covered by oxlint
// This must be at the end to override previous rule configurations
...oxlint.configs['flat/recommended'],
);

View File

@@ -66,7 +66,6 @@
"cross-env": "^10.1.0",
"eslint": "^9.39.2",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-oxlint": "^1.32.0",
"eslint-plugin-perfectionist": "^4.15.1",
"eslint-plugin-typescript-paths": "^0.0.33",
"globals": "^16.5.0",

View File

@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [MatissJanis]
---
lint: move actual eslint rules to oxlint and some eslint

View File

@@ -10054,7 +10054,6 @@ __metadata:
cross-env: "npm:^10.1.0"
eslint: "npm:^9.39.2"
eslint-import-resolver-typescript: "npm:^4.4.4"
eslint-plugin-oxlint: "npm:^1.32.0"
eslint-plugin-perfectionist: "npm:^4.15.1"
eslint-plugin-typescript-paths: "npm:^0.0.33"
globals: "npm:^16.5.0"
@@ -14710,15 +14709,6 @@ __metadata:
languageName: node
linkType: hard
"eslint-plugin-oxlint@npm:^1.32.0":
version: 1.32.0
resolution: "eslint-plugin-oxlint@npm:1.32.0"
dependencies:
jsonc-parser: "npm:^3.3.1"
checksum: 10/0c82c8fdb2201c71825f4e6c796801b72795fa567a3a9e927e36bf197ed55d2cd2a72373c726f56a49d5c6c1eb3a1dffe25ce0f2ea492e13bef6a6de73db07ff
languageName: node
linkType: hard
"eslint-plugin-perfectionist@npm:^4.15.1":
version: 4.15.1
resolution: "eslint-plugin-perfectionist@npm:4.15.1"
@@ -18341,7 +18331,7 @@ __metadata:
languageName: node
linkType: hard
"jsonc-parser@npm:^3.2.0, jsonc-parser@npm:^3.3.1":
"jsonc-parser@npm:^3.2.0":
version: 3.3.1
resolution: "jsonc-parser@npm:3.3.1"
checksum: 10/9b0dc391f20b47378f843ef1e877e73ec652a5bdc3c5fa1f36af0f119a55091d147a86c1ee86a232296f55c929bba174538c2bf0312610e0817a22de131cc3f4