Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@archoleat/eslint-flat-compatibility

archoleat628MITdeprecated1.2.1TypeScript support: included

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

Function for compatibility with ESLint flat config

archoleat-eslint-flat-compatibility, archoleat, compatibility, config, eslint-config, eslint-flat-compatibility, eslint-flat-config, eslint, flat, plugin

readme

ESLint Flat Compatibility

NPM Version NPM Downloads ESM Provenance CodeQL Specs Commitlint Editorconfig Prettier ESLint Remark

Table of Contents

Installation

bun i -D @archoleat/eslint-flat-compatibility

Usage

Before

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',
  ),
// ...

After

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
  ...env({
    es2020: true,
    node: true,
  }),

  // Mimic plugins
  ...plugins('airbnb', 'react'),

  // Translate an entire config
  ...config({
    env: {
      es2020: true,
      node: true,
    },
    extends: ['airbnb/base'],
    plugins: ['airbnb', 'unicorn'],
    rules: {
      semi: 'error',
    },
  }),
]);

Contributing

Please read CONTRIBUTING to start contributing.

License

This project is licensed under the MIT license.

changelog

Changelog

1.2.1 (2024-10-25)

Code Refactoring

1.2.0 (2024-10-10)

Features

Code Refactoring

  • move build script to release.yaml (#76) (1b4d119)

1.1.9 (2024-09-22)

Code Refactoring

Documentation

1.1.8 (2024-08-30)

Bug Fixes

Code Refactoring

Documentation

1.1.7 (2024-08-17)

Code Refactoring

1.1.6 (2024-04-09)

Code Refactoring

1.1.5 (2024-04-08)

Code Refactoring

1.1.4 (2024-04-08)

Code Refactoring

Documentation

1.1.3 (2024-04-04)

Code Refactoring

1.1.2 (2024-04-04)

Code Refactoring

1.1.1 (2024-04-03)

Code Refactoring

1.1.0 (2024-04-03)

Features

  • add methods for env, config, plugins and extends (#8) (e7e9084)

Code Refactoring

Documentation

  • readme: rewrite blockquote (#6) (c4f5023)
  • readme: rewrite blockquote (27b9324)

1.0.0 (2024-04-02)

Code Refactoring