This package exposes the ESLint configuration used for LANDR projects.
- Uses a typescript parser that allows for the linting of both JS and TS files (therefore typescript is a installed as a peer dependency for this config).
- Uses both eslint-config-prettier and eslint-plugin-prettier to display prettier formatting issues as ESLint errors and fix them with the ESLint
--fix
command. Prettier rules will be taken from a.prettierrc.js
file found in your root project directory or if none is found, it will use default prettier settings. The prettier configuration used at LANDR isprettier-config-landr
.
Install eslint-config-landr
and all of it's peer dependencies as dev dependencies of your project. This can be done with the following command:
yarn eslint eslint-config-landr --dev
Add landr
as a value to the extends
array of your .eslintrc.js
config file.
module.exports = {
extends: ['landr'],
};
To use a framework specific config, just use 'landr/${framework}'
in the extends
array. Every framework specific config already extends the landr
config.
React
yarn add -D eslint-config-landr
// .eslintrc.js
module.exports = {
extends: ['landr/react'],
};
Test
yarn add -D eslint-config-landr
// .eslintrc.js
module.exports = {
extends: ['landr/test'],
};