TypeScript-first ESLint config designed to complement @standard-config/oxlint. Focuses primarily on stylistic and React-related rules not available in Oxlint.
npm install --save-dev @standard-config/eslintpnpm add --save-dev @standard-config/eslintCreate your eslint.config.ts:
import { defineConfig } from '@standard-config/eslint';
export default defineConfig();The React-related rules included with Standard Config are off by default. You can enable them by setting react: true at the root of your config.
import { defineConfig } from '@standard-config/eslint';
export default defineConfig({
react: true,
});Standard Config comes with a set of utilities that can translate this config to Oxlint, eliminating the need to run ESLint. This relies on Oxlint’s experimental JS Plugins support.
In your oxlint.config.ts:
import { getOxlintConfigs } from '@standard-config/eslint/utilities';
import { defineConfig } from '@standard-config/oxlint';
const { oxlintConfigBase, oxlintConfigConfigFiles } = getOxlintConfigs({
// Optional, as above
react: true,
});
// Merge `oxlintConfigBase` at the root of your config, as it defines
// all supported third-party rules from this config, including
// the resolved `jsPlugins`
export default defineConfig(oxlintConfigBase, {
react: true,
rules: {
// Example override
'react-js/function-component-definition': 'off',
},
overrides: [
{
// `oxlintConfigConfigFiles` is an optional override entry
// intended for config files other than `**/*.config.ts`
// (those are already covered by `oxlintConfigBase`)
files: ['config/**/*.ts'],
...oxlintConfigConfigFiles,
},
],
});MIT © Dom Porada