@cffnpwr/eslint-config
v1.1.3
Published
Common ESLint configuration for cffnpwr
Readme
@cffnpwr/eslint-config
A shared ESLint configuration for cffnpwr.
How to Install
npm
npm install -D @cffnpwr/eslint-configor
npx jsr add -D @cffnpwr/eslint-configyarn
yarn add -D @cffnpwr/eslint-configor
yarn dlx jsr add -D @cffnpwr/eslint-configpnpm
pnpm add -D @cffnpwr/eslint-configor
pnpm dlx jsr add -D @cffnpwr/eslint-configBun
bun add -D @cffnpwr/eslint-configor
bunx jsr add -D @cffnpwr/eslint-configDeno
deno add -D npm:@cffnpwr/eslint-configor
deno add -D jsr:@cffnpwr/eslint-configHow to Use
Create an eslint.config.ts file and configure it as follows.
This shared configuration does not provide files, so you need to configure them individually.
You also need to install @typescript-eslint/parser separately from this shared configuration.
Other required packages must be installed additionally.
import cffnpwrConfig from "@cffnpwr/eslint-config";
import tsEslintParser from "@typescript-eslint/parser";
import { defineConfig } from "eslint/config";
import globals from "globals";
const files = ["**/*.{js,ts}"];
export default defineConfig([
{
files,
languageOptions: {
globals: {
...globals.node,
},
parser: tsEslintParser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files,
extends: cffnpwrConfig(), // TypeScript recommended rules + TypeScript/JSX style rules
},
]);Optional Rules
React and Tailwind CSS rules can be optionally added. Here are configuration examples:
// Enable React
cffnpwrConfig({ react: true });
// Enable Tailwind CSS
cffnpwrConfig({ tailwind: true });
// Enable React + Tailwind CSS
cffnpwrConfig({ react: true, tailwind: true });