pnpm add --save-dev @edgeandnode/eslint-config
// .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"),
},
},
],
};
-
@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
- 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.