@pagopa/eslint-config
v6.2.2
Published
Keywords
Readme
@pagopa/eslint-config
This package provides PagoPA's eslint.config.js as an extensible shared config.
It supports both ESLint 9 and ESLint 10.
Usage
Install
@pagopa/eslint-configtogether with its peer dependencies.The required peers are
eslint,@eslint/js(matching the same major aseslint), andprettier.For ESLint 10:
pnpm add -D eslint@^10 @eslint/js@^10 @pagopa/eslint-config pnpm add -D -E prettierFor ESLint 9:
pnpm add -D eslint@^9 @eslint/js@^9 @pagopa/eslint-config pnpm add -D -E prettierCreate a file names
eslint.config.jsat the root of your workspace with the following content[!TIP]
If your workspace uses CommonJS, name this fileeslint.config.mjsimport pagopa from "@pagopa/eslint-config"; export default pagopa;Add
lintandlint:checkscripts in yourpackage.json{ "scripts": { "lint": "eslint --fix src", "lint:check": "eslint src" } }
Test-runner support
The default entry point ships rules for Vitest. A separate
@pagopa/eslint-config/jest subpath provides the equivalent rules for
Jest, which is the default test runner for React Native apps.
Jest
Install eslint-plugin-jest alongside the regular peer dependencies:
pnpm add -D eslint-plugin-jestThen import the /jest subpath:
import pagopa from "@pagopa/eslint-config/jest";
export default pagopa;