@andrskr/eslint-config v0.0.8
ESLint Setup
These are my settings for ESLint.
You might like them - or you might not. Don't worry; you can always change them to match your coding preferences.
Usage
Install the package using pnpm
(or npm
, or yarn
):
pnpm add -D @andrskr/eslint-config
To use a shareable config, include the config name in the extends
field of a configuration file. For the value, use your module name. For example:
{
"extends": "@andrskr/eslint-config"
}
If you're using TypeScript:
module.exports = {
extends: '@andrskr/eslint-config',
overrides: [
{
files: ['*.ts', '*.tsx'],
parserOptions: {
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
},
],
};
Check out the eslint
documentation for more info on configurations and how to use sharable config.
Plugins
The following plugins/configurations are included in the ESLint configuration:
@rushstack/eslint-patch: A patch that improves how ESLint loads plugins when working in a monorepo with a reusable toolchain.
@typescript-eslint/eslint-plugin: An ESLint plugin which provides lint rules for TypeScript codebases.
@typescript-eslint/parser: An ESLint parser which leverages TypeScript ESTree to allow for ESLint to lint TypeScript source code.
eslint-config-airbnb: Package provides Airbnb's .eslintrc as an extensible shared config.
eslint-config-airbnb-typescript: Enhances Airbnb's ESLint config with TypeScript support.
eslint-config-prettier: Turns off all rules that are unnecessary or might conflict with Prettier.
eslint-plugin-jsdoc: JSDoc specific linting rules for ESLint.
eslint-plugin-jsonc: ESLint plugin for JSON(C|5)? files.
eslint-plugin-jsx-a11y: Static AST checker for a11y rules on JSX elements.
eslint-plugin-markdown: Lint JavaScript code blocks in Markdown documents.
eslint-plugin-promise: Enforce best practices for JavaScript promises.
eslint-plugin-react: React-specific linting rules for ESLint.
eslint-plugin-react-hooks: This ESLint plugin enforces the Rules of Hooks.
eslint-plugin-react-refresh: Validate that your components can safely be updated with fast refresh.
eslint-plugin-sonarjs: SonarJS rules for ESLint.
eslint-plugin-tailwindcss: ESLint plugin for Tailwind CSS usage.
eslint-plugin-testing-library: EESLint plugin to follow best practices and anticipate common mistakes when writing tests with Testing Library.
eslint-plugin-unicorn: Various awesome ESLint rules.
eslint-plugin-vitest: ESLint rules for Vitest.
eslint-plugin-yml: ESLint plugin provides linting rules for YAML.
jsonc-eslint-parser: JSON, JSONC and JSON5 parser for use with ESLint plugins.
yaml-eslint-parser: A YAML parser that produces output compatible with ESLint.