eslint-config-no-autofix
v1.0.1
Published
An ESLint config that imports eslint-plugin-no-autofix.
Downloads
9
Maintainers
Readme
eslint-config-no-autofix
An ESLint config that imports eslint-plugin-no-autofix
, without turning on any other rules or settings. Specifically, all it does is this:
module.exports = {
plugins: ["no-autofix"],
};
Why?
eslint-plugin-no-autofix
does not yet support the ESLint flat config. We can work around this by using the FlatCompat
utility. But that can only be used on configs, not on plugins. Thus, we need to arbitrarily compose a config that contains only the plugin.
Usage
import { FlatCompat } from "@eslint/eslintrc";
import tseslint from "typescript-eslint";
const compat = new FlatCompat({
baseDirectory: import.meta.dirname,
});
export default tseslint.config(
...compat.extends("eslint-config-no-autofix"),
// Add your other configuration here.
);
(Using the tseslint.config
helper function is optional, but composing flat configs with the helper function is considered best practice.)