Skip to content

edgeandnode/eslint-config

Repository files navigation

@edgeandnode/eslint-config

Installation

Install the package

pnpm add --save-dev @edgeandnode/eslint-config

Use the preset in your .eslintrc.js file.

// .eslintrc.js
module.exports = {
  parser: "@typescript-eslint/parser",
  extends: ["@edgeandnode", "@edgeandnode/eslint-config/next"],
  plugins: ["testing-library"],
  rules: {
    "testing-library/no-unnecessary-act": ["error", { isStrict: true }],
  },
  overrides: [
    {
      files: ["*.ts", "*.tsx"],
      parserOptions: {
        project: require.resolve("./tsconfig.json"),
      },
    },
  ],
};

Presets

  • @edgeandnode/eslint-config — base profile built with eslint-plugin-jsx-a11y, eslint-plugin-react, eslint-plugin-react-hooks, eslint-plugin-simple-import-sort, eslint-plugin-sonarjs, and eslint-plugin-simple-import-sort

  • @edgeandnode/eslint-config/next — profile for Next.js built with @next/eslint-config-next

Development

  • Mark changes from "default" rules present in common presets with @changed.
  • Describe the background for a rule or it's disabling with a comment marked with @motivation.
  • Use rules that affect semantics — detect bugs and "no morning coffee" mistakes.
  • Avoid obtrusive code-style rules.

About

ESLint configuration used in Edge & Node products

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published