Add our ESLint configuration and the Prettier plugin to your project:
yarn add -D @fooxly/eslint-config eslint-plugin-prettier prettierCreate a .eslintrc file in the root of your project with the following content:
{
"root": true,
"extends": [
"@fooxly/eslint-config"
]
}And be sure to check out our other ESLint configurations if your project uses other technologies like React, for example:
Note: Always import "@fooxly/eslint-config" last to override any conflicting rules.
{
...
"extends": [
"@fooxly/eslint-config-react",
"@fooxly/eslint-config"
]
}Create a .prettierrc file in the root of your project with our compatible Prettier configuration:
{
"printWidth": 110,
"tabWidth": 4,
"singleQuote": true,
"quoteProps": "consistent",
"jsxSingleQuote": true,
"trailingComma": "all"
}Add the following scripts to easily validate your code:
{
"scripts": {
...
"lint": "eslint --ext ts,tsx src scripts",
"lint-fix": "yarn lint --fix",
...
}
}