@betgames/lint-client
v0.0.6
Published
Eslint and Prettier configs for frontend projects
Downloads
3
Readme
fe-config
Frontend configs for eslint and prettier
This package provides extensible shared configs for eslint and prettier for frontend projects.
Repository
Installation
Eslint
- Install config package
yarn add
- Install correct versions of each package from
@betgames/lint-client
dependencies:
Run yarn add --dev <dependency>@<version>
for each dependency.
Usage
@betgames/lint-client/src/eslint
Add "extends": "@betgames/lint-client/src/eslint"
to your .eslintrc
// .eslintrc.json
"extends": ["@betgames/lint-client/src/eslint"],
"globals": {
// Additional global variables...
},
"rules": {
// Additional, per-project rules...
},
@betgames/lint-client/src/eslint/jest
This entry point enables the linting rules for jest files.
// .eslintrc.json
"overrides": [
{
"files": ["*.test.ts", "*.test.tsx"],
"extends": ["@betgames/lint-client/src/eslint/jest"]
},
]
@betgames/lint-client/src/eslint/ts
// .eslintrc.json
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"extends": ["@betgames/lint-client/src/eslint/ts"]
},
]
Prettier
To use your shared Prettier config in other projects, you need to reference it in your project's package.json
manifest by adding the prettier property:
{
"name": "project",
// ...
"prettier": "@betgames/lint-client/src/prettier"
// ...
}