Skip to content

Commit e3d89b3

Browse files
committed
Add design decisions
1 parent 3b9c0de commit e3d89b3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ The TypeScript configuration uses the same rules as the base configuration, with
4040
- Rules which will be checked by the TypeScript compiler anyway are disabled.
4141
- Rules which would work differently for TypeScript code have been replaced by their [@typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin), where this is possible without requiring type checking as part of linting (see [Design decisions](#design-decisions)).
4242

43+
This configuration can be used as-is even for mixed or JavaScript-only projects, but does require the `typescript` package to be installed.
44+
4345
#### Advanced TypeScript usage
4446

4547
For projects wanting stricter checks, consider using [linting with type information](https://typescript-eslint.io/docs/linting/type-linting/) Here is a sample ESLint configuration:
@@ -147,6 +149,18 @@ module.exports = {
147149
};
148150
```
149151

152+
## Design decisions
153+
154+
This configuration strikes a balance between ease of use for users, and ease of maintenance.
155+
156+
- We use the same React-aware configuration everywhere, even non-React projects.
157+
- We use a separate TypeScript configuration file only due to its experimental nature.
158+
- There is a single package with a single set of dependencies.
159+
160+
The base configuration is kept very simple, extending from the Airbnb configuration, with Prettier compatibility and more permissive rules.
161+
162+
The TypeScript configuration does not rely on type checking, so it can also be used for JavaScript projects. This will eventually allow us to have a single configuration file for all projects, once the TypeScript support is no longer deemed experimental.
163+
150164
## What’s included
151165

152166
> See [`config.js`](./config.js) for the config definition, and [`src/rules.test.js`](./src/rules.test.js) for the whole set of rules and settings.

0 commit comments

Comments
 (0)