diff --git a/README.md b/README.md index 49506d9..6bccaa2 100644 --- a/README.md +++ b/README.md @@ -59,17 +59,16 @@ This config intentionally omits all formatting/style rules (spacing, semicolons, ## Rules not covered by oxlint -The following rules from `eslint-config-universe` do not have oxlint equivalents. If you need them, you'll need to keep ESLint running alongside oxlint for these specific rules, or accept the gap. +The following rules from `eslint-config-universe` do not have `oxlint-config-universe` coverage. If you need them, you'll need to keep ESLint running alongside oxlint for these specific rules, or accept the gap. ### Core ESLint rules -| Rule | Notes | -| ----------------- | ---------------------------------------------------------------- | -| `no-dupe-args` | Not implemented in oxlint | -| `no-implied-eval` | Only available as `typescript/no-implied-eval`, not for plain JS | -| `no-new-symbol` | oxlint has `no-new-native-nonconstructor` as a successor | -| `no-octal` | Not implemented | -| `no-octal-escape` | Not implemented | +| Rule | Notes | +| ----------------- | --------------------------------------------------------------------------------------- | +| `no-dupe-args` | Not implemented in oxlint | +| `no-implied-eval` | Only available with type-aware, present in `oxlint-config-universe/typescript-analysis` | +| `no-octal` | Not implemented | +| `no-octal-escape` | Not implemented | ### Import rules @@ -91,18 +90,6 @@ Recommended oxfmt config to match eslint-config-universe import/order configurat } ``` -### TypeScript rules - -These ESLint rules have TypeScript-specific overrides that don't exist in oxlint. The base ESLint versions are included in core and may work adequately for TypeScript files, but lack TypeScript-aware handling (e.g., understanding type-only imports): - -| Rule | Notes | -| ------------------------------------------- | ----------------------------------------- | -| `@typescript-eslint/no-dupe-class-members` | Core `no-dupe-class-members` is included | -| `@typescript-eslint/no-redeclare` | Core `no-redeclare` is included | -| `@typescript-eslint/no-unused-expressions` | Core `no-unused-expressions` is included | -| `@typescript-eslint/no-unused-vars` | Core `no-unused-vars` is included | -| `@typescript-eslint/no-useless-constructor` | Core `no-useless-constructor` is included | - ### React rules | Rule | Notes | diff --git a/package.json b/package.json index fbb846b..28cc101 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "oxlint-config-universe", - "version": "0.0.1", + "version": "0.0.2", "description": "Shared oxlint configs for internal Expo projects.", "keywords": [ "expo", diff --git a/shared/core.js b/shared/core.js index e63dfef..ba9d566 100644 --- a/shared/core.js +++ b/shared/core.js @@ -58,6 +58,7 @@ export default defineConfig({ 'no-multi-assign': 'warn', 'no-new': 'warn', 'no-new-func': 'warn', + 'no-new-native-nonconstructor': 'warn', 'no-object-constructor': 'warn', 'no-obj-calls': 'warn', 'no-proto': 'warn', diff --git a/shared/typescript-analysis.js b/shared/typescript-analysis.js index 17addae..face932 100644 --- a/shared/typescript-analysis.js +++ b/shared/typescript-analysis.js @@ -19,6 +19,7 @@ export default defineConfig({ 'typescript/no-confusing-void-expression': 'warn', 'typescript/no-extra-non-null-assertion': 'warn', 'typescript/no-floating-promises': 'warn', + 'typescript/no-implied-eval': 'warn', 'typescript/no-for-in-array': 'error', 'typescript/no-misused-promises': ['error', { checksVoidReturn: false }], 'typescript/no-unnecessary-type-assertion': 'warn', diff --git a/shared/typescript.js b/shared/typescript.js index 7371684..ea4d909 100644 --- a/shared/typescript.js +++ b/shared/typescript.js @@ -6,6 +6,20 @@ import { defineConfig } from 'oxlint'; export default defineConfig({ plugins: ['typescript'], rules: { + 'typescript/no-dupe-class-members': 'warn', + 'typescript/no-redeclare': 'warn', + 'typescript/no-unused-expressions': ['warn', { allowShortCircuit: true, enforceForJSX: true }], + 'typescript/no-unused-vars': [ + 'warn', + { + vars: 'all', + args: 'none', + ignoreRestSiblings: true, + caughtErrors: 'all', + caughtErrorsIgnorePattern: '^_', + }, + ], + 'typescript/no-useless-constructor': 'warn', 'typescript/array-type': ['warn', { default: 'array' }], 'typescript/no-empty-object-type': ['warn', { allowInterfaces: 'with-single-extends' }], 'typescript/no-wrapper-object-types': 'warn',