Open jjangga0214 opened 2 years ago
Two years later and the README
doesn't have any references to flat config support.
Some more searching and I stumbled across the compatibility helpers that allow this project to be used with flat config.
Example:
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintConfigPrettier from "eslint-config-prettier";
import { FlatCompat } from "@eslint/eslintrc";
import path from "path";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname
});
export default tseslint.config(
eslint.configs.recommended,
...compat.extends("airbnb-base"),
...compat.extends("airbnb-typescript/base"),
...tseslint.configs.recommendedTypeChecked,
eslintConfigPrettier,
{
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: ['**/*.{js,jsx,cjs,mjs}'],
extends: [tseslint.configs.disableTypeChecked],
}
);
My setup based on this one works. 🙏
I'll make a PR to add this documentation. Thanks for bringing it up, @samuelneff!
Eslint announced a new config spec. https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new
According to eslint's official blog, though backward compatibility was taken care of, not all shareable configs continue to work with the new config system.
Are
eslint-config-airbnb-typescript
andeslint-config-airbnb-typescript/base
compatible with the new config?Thanks.