UNPKG

@cprussin/eslint-config

Version:
96 lines (95 loc) 2.7 kB
/** * @packageDocumentation * * This package contains a set of strict base eslint configs for packages using * ESM. * * Note this package exports configs in the [new eslint flat config * format](https://eslint.org/docs/latest/use/configure/configuration-files-new). * * # Installing * * Use the package manager of your choice to install: * * - **npm**: `npm install --save-dev @cprussin/eslint-config` * - **pnpm**: `pnpm add -D @cprussin/eslint-config` * - **yarn**: `yarn add -D @cprussin/eslint-config` * * # Usage * * First, ensure you're using ESM (set `"type": "module"` in your * `package.json.`). Then, the most basic `eslint.config.js` could look like * this: * * ```js * export { base as default } from "@cprussin/eslint-config"; * ``` * * To override things, just concat the config you want together, for instance: * * ```js * import { base } from "@cprussin/eslint-config"; * * export default [ * ...base, * { * ignores: ["foo/bar/**"], * }, * ]; * ``` */ import type { FlatConfig } from "@typescript-eslint/utils/ts-eslint"; /** * This configuration is the base configuration for the others. It can be used * standalone in a project that doesn't need one of the extensions. It extends a * number of shared configs and sets some strict opinionated configs for the * following file types: * * - Typescript * - CJS * - ESM * - JSON * - Jest test files * * @example * ```js * // eslint.config.js * export { base as default } from "@cprussin/eslint-config"; * ``` */ export declare const base: FlatConfig.ConfigArray; /** * This configuration extends the {@link base} configuration and adds the * `react`, `react-hooks`, and `jsx-a11y` shared configs. It also adds configs * for jest dom tests using the `jest-dom` and `testing-library` shared configs * for test files. * * @example * ```js * // eslint.config.js * export { react as default } from "@cprussin/eslint-config"; * ``` */ export declare const react: FlatConfig.ConfigArray; /** * This configuration extends the {@link base} and {@link react} configurations * and adds the `next/core-web-vitals` config. * * @example * ```js * // eslint.config.js * export { nextjs as default } from "@cprussin/eslint-config"; * ``` */ export declare const nextjs: FlatConfig.ConfigArray; /** * This configuration sets up linting for tailwind styles. * * @param tailwindConfig - the path to the project's tailwind config file * @returns the eslint config */ export declare const tailwind: (tailwindConfig: string) => FlatConfig.ConfigArray; /** * This configuration sets up the storybook plugin. */ export declare const storybook: FlatConfig.ConfigArray;