bun i -D @archoleat/eslint-flat-compatibility
import { fileURLToPath } from 'url';
import path from 'path';
import { defineFlatConfig } from 'eslint-define-config';
import { FlatCompat } from '@eslint/eslintrc';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
resolvePluginsRelativeTo: __dirname,
});
export default defineFlatConfig([
...compat.extends(
'airbnb-typescript/base',
'plugin:import/recommended',
'plugin:import/typescript',
),
// ...
import { config, env, extend, plugins } from '@archoleat/eslint-flat-compatibility';
import { defineFlatConfig } from 'eslint-define-config';
export default defineFlatConfig([
// Mimic extends
...extend(
'airbnb-typescript/base',
'plugin:import/recommended',
'plugin:import/typescript',
),
// Mimic env
// Types available
...env({
es2020: true,
node: true,
}),
// Mimic plugins
...plugins('airbnb', 'react'),
// Translate an entire config
// Types available
...config({
env: {
es2020: true,
node: true,
},
extends: ['airbnb/base'],
plugins: ['airbnb', 'unicorn'],
rules: {
semi: 'error',
},
}),
]);
Please read CONTRIBUTING to start contributing.
This project is licensed under the MIT license.