0.0.8 • Published 3 months ago

@andrskr/eslint-config v0.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

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:

  1. @rushstack/eslint-patch: A patch that improves how ESLint loads plugins when working in a monorepo with a reusable toolchain.

  2. @typescript-eslint/eslint-plugin: An ESLint plugin which provides lint rules for TypeScript codebases.

  3. @typescript-eslint/parser: An ESLint parser which leverages TypeScript ESTree to allow for ESLint to lint TypeScript source code.

  4. eslint-config-airbnb: Package provides Airbnb's .eslintrc as an extensible shared config.

  5. eslint-config-airbnb-typescript: Enhances Airbnb's ESLint config with TypeScript support.

  6. eslint-config-prettier: Turns off all rules that are unnecessary or might conflict with Prettier.

  7. eslint-plugin-jsdoc: JSDoc specific linting rules for ESLint.

  8. eslint-plugin-jsonc: ESLint plugin for JSON(C|5)? files.

  9. eslint-plugin-jsx-a11y: Static AST checker for a11y rules on JSX elements.

  10. eslint-plugin-markdown: Lint JavaScript code blocks in Markdown documents.

  11. eslint-plugin-promise: Enforce best practices for JavaScript promises.

  12. eslint-plugin-react: React-specific linting rules for ESLint.

  13. eslint-plugin-react-hooks: This ESLint plugin enforces the Rules of Hooks.

  14. eslint-plugin-react-refresh: Validate that your components can safely be updated with fast refresh.

  15. eslint-plugin-sonarjs: SonarJS rules for ESLint.

  16. eslint-plugin-tailwindcss: ESLint plugin for Tailwind CSS usage.

  17. eslint-plugin-testing-library: EESLint plugin to follow best practices and anticipate common mistakes when writing tests with Testing Library.

  18. eslint-plugin-unicorn: Various awesome ESLint rules.

  19. eslint-plugin-vitest: ESLint rules for Vitest.

  20. eslint-plugin-yml: ESLint plugin provides linting rules for YAML.

  21. jsonc-eslint-parser: JSON, JSONC and JSON5 parser for use with ESLint plugins.

  22. yaml-eslint-parser: A YAML parser that produces output compatible with ESLint.