eslint-config-faithlife

10.0.0 • Public • Published

ESLint rules for Faithlife projects

Installing

yarn add --dev eslint-config-faithlife

Configuring

In your .eslintrc/.eslintrc.json, extend the "faithlife" config:

{
	"extends": ["faithlife"]
}

If you want to opt out of React-specific configuration, you can use base instead:

{
	"extends": ["faithlife/base"]
}

react-jest

If you use Jest and React Testing Library for testing your frontend, extend faithlife/react-jest as well.

{
	"extends": ["faithlife", "faithlife/react-jest"]
}

If you'd like to make sure faithlife/react-jest only applies the rules to your test files, you can use (replacing the files glob as needed):

module.exports = {
	extends: ['faithlife'],
	overrides: [
		Object.assign(
			{
				files: ['*.test.{ts,tsx,js,jsx}'],
			},
			require('eslint-config-faithlife/react-jest')
		),
	],
};

Behavior

This configuration will attempt to use an appropriate set of rules and parser options for your project.

  1. For TypeScript (.ts, and .tsx) files, the @typescript-eslint/parser parser will be used, and TypeScript-specific rules will be loaded.
  2. For JavaScript (.js, and .jsx) files, the default ESLint parser will be used.

Readme

Keywords

none

Package Sidebar

Install

npm i eslint-config-faithlife

Weekly Downloads

1,472

Version

10.0.0

License

MIT

Unpacked Size

12.3 kB

Total Files

7

Last publish

Collaborators

  • wdlowry
  • faithlife-admin
  • ddunkin
  • bryanrsmith