Skip to content

tricinel/eslint-config-frontwerk-react

Repository files navigation

eslint-config-frontwerk-react

Node Version Npm version Npm downloads License

This package provides Frontwerk's JavaScript .eslintrc as an extensible shared ESLint config for React projects.

Usage

  1. Install the versions of the package, including its peerDependencies:
npm install --dev eslint-config-frontwerk-react eslint eslint-plugin-{import,jsx-a11y,react,react-hooks}

Or with yarn:

yarn add --dev eslint-config-frontwerk-react eslint eslint-plugin-{import,jsx-a11y,react,react-hooks}
  1. Extend your desired config file in your .eslintrc by adding "extends": "frontwerk-react" to your .eslintrc.

With TypeScript

If you want to use React with TypeScript, you will need to install the required TypeScript packages and add "extends": "frontwerk-react/typescript" to your .eslintrc.

You can use Frontwerk's TypeScript config for ESLint as well. See details for this here and add both frontwerk-typescript and frontwerk-react/typescript to your .eslintrc extends.

{
  "extends": [frontwerk-typescript", "frontwerk-react/typescript"],
  "parserOptions": {
     "project": "./tsconfig.json"
   },
}

Related

Contributing

  • Run tests with npm run test or yarn test.
  • Run the lint with npm run lint or yarn lint.

For details, check out the Contributing guide.

LICENSE

MIT