@echristian/eslint-config v0.0.43
@echristian/eslint-config
A modern and opinionated ESLint configuration with TypeScript and JSX support.
Installation
Using npm:
npm install -D @echristian/eslint-config eslint
Using yarn:
yarn add -D @echristian/eslint-config eslint
Using pnpm:
pnpm add -D @echristian/eslint-config eslint
Usage
Create an eslint.config.js
file in your project root:
import eslintConfig from "@echristian/eslint-config";
export default eslintConfig({
// Configuration options here
});
Configuration Options
The configuration function accepts an options object with the following structure:
interface ESLintConfigOptions {
// Glob patterns to ignore
ignores?: Array<string>
// TypeScript configuration
typescript?: {
enabled: boolean // defaults to true
options?: {
typeChecked?: boolean // defaults to true
}
}
// React Hooks configuration
reactHooks?: {
enabled: boolean // defaults to false
}
// Package.json rules configuration
packageJson?: {
options?: {
public?: boolean // defaults to true
}
}
}
Default configuration:
const defaults = {
ignores: [],
typescript: {
enabled: true,
options: {
typeChecked: true,
},
},
reactHooks: {
enabled: false,
},
packageJson: {
options: {
public: true,
},
},
}
Example Configurations
Basic TypeScript Project
import eslintConfig from "@echristian/eslint-config";
export default eslintConfig({
ignores: ["dist/"],
});
TypeScript Project without Type Checking
import eslintConfig from "@echristian/eslint-config";
export default eslintConfig({
typescript: {
enabled: true,
options: {
typeChecked: false,
},
},
});
React Project with Hooks
import eslintConfig from "@echristian/eslint-config";
export default eslintConfig({
reactHooks: {
enabled: true
}
});
Private Package Configuration
import eslintConfig from "@echristian/eslint-config";
export default eslintConfig({
packageJson: {
options: {
public: false
}
}
});
Dependencies
This config includes the following major dependencies:
@eslint/js
: Core ESLint rules@eslint/json
: JSON supporttypescript-eslint
: TypeScript support@stylistic/eslint-plugin
: Style-related ruleseslint-plugin-unused-imports
: Unused imports managementeslint-plugin-perfectionist
: Additional best practiceseslint-plugin-prettier
: Prettier integrationeslint-plugin-regexp
: Regular expression lintingeslint-plugin-de-morgan
: Logical expression optimizationeslint-plugin-package-json
: Package.json validationeslint-plugin-react-hooks
: React Hooks linting rules
License
MIT - See LICENSE for more information.
4 months ago
5 months ago
5 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago