@fabdeh/eslint-config 0.7.1 → 0.8.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/dist/index.d.ts +232 -78
- package/dist/index.js +202 -51
- package/package.json +50 -43
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
- Requires ESLint v9.21.0+
|
|
20
20
|
|
|
21
21
|
> [!WARNING]
|
|
22
|
-
> Please keep in mind that this is **_a personal config_** with a lot opinions. Changes might not always be pleased by everyone and every use
|
|
22
|
+
> Please keep in mind that this is **_a personal config_** with a lot of opinions. Changes might not always be pleased by everyone and every use case.
|
|
23
23
|
>
|
|
24
24
|
> If you are using this config directly, I'd suggest you **review the changes everytime you update**. Or if you want more control over the rules, always feel free to fork it. Thanks!
|
|
25
25
|
|
|
@@ -42,7 +42,7 @@ import { defineConfig } from '@fabdeh/eslint-config';
|
|
|
42
42
|
export default defineConfig();
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
### Add
|
|
45
|
+
### Add the scripts for package.json
|
|
46
46
|
|
|
47
47
|
For example:
|
|
48
48
|
|
|
@@ -106,7 +106,7 @@ Add the following settings to your `.vscode/settings.json`:
|
|
|
106
106
|
|
|
107
107
|
## Customization
|
|
108
108
|
|
|
109
|
-
Since the beginning, we used [ESLint Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new). It provides much better organization and composition.
|
|
109
|
+
Since the beginning, we've used [ESLint Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new). It provides much better organization and composition.
|
|
110
110
|
|
|
111
111
|
Normally you only need to import the `defineConfig` function:
|
|
112
112
|
|
|
@@ -287,7 +287,7 @@ The following integrations are automatically enabled if the corresponding packag
|
|
|
287
287
|
|
|
288
288
|
#### TypeScript
|
|
289
289
|
|
|
290
|
-
Most of TypeScript rules are
|
|
290
|
+
Most of the TypeScript rules are enabled automatically if `typescript` package is installed in you project. Some `@typescript-eslint` rules are also enabled by default for JavaScript files.
|
|
291
291
|
You can explicitly enable/disable TypeScript integration manually:
|
|
292
292
|
|
|
293
293
|
```js
|
|
@@ -301,15 +301,15 @@ export default defineConfig({
|
|
|
301
301
|
|
|
302
302
|
##### Erasable Syntax Only
|
|
303
303
|
|
|
304
|
-
The TypeScript integration also
|
|
304
|
+
The TypeScript integration also allows you to turn on/off rules that will report on using syntax that will not be allowed by TypeScript's [--erasableSyntaxOnly option](https://devblogs.microsoft.com/typescript/announcing-typescript-5-8-beta/#the---erasablesyntaxonly-option):
|
|
305
305
|
|
|
306
306
|
> Recently, Node.js 23.6 unflagged [experimental support for running TypeScript files directly](https://nodejs.org/api/typescript.html#type-stripping); however, only certain constructs are supported under this mode.
|
|
307
307
|
>
|
|
308
308
|
> ...
|
|
309
309
|
>
|
|
310
|
-
> TypeScript 5.8 introduces the `--erasableSyntaxOnly` flag. When this flag is enabled, TypeScript will only allow you to use constructs that can be erased from a file
|
|
310
|
+
> TypeScript 5.8 introduces the `--erasableSyntaxOnly` flag. When this flag is enabled, TypeScript will only allow you to use constructs that can be erased from a file and will issue an error if it encounters any constructs that cannot be erased.
|
|
311
311
|
|
|
312
|
-
You can enable these rules as
|
|
312
|
+
You can enable these rules as follows:
|
|
313
313
|
|
|
314
314
|
```js
|
|
315
315
|
// eslint.config.js
|
|
@@ -322,7 +322,7 @@ export default defineConfig({
|
|
|
322
322
|
});
|
|
323
323
|
```
|
|
324
324
|
|
|
325
|
-
These rules are disabled by default and therefore the associated ESLint plugin is also not installed by default.
|
|
325
|
+
These rules are disabled by default, and therefore the associated ESLint plugin is also not installed by default.
|
|
326
326
|
Running `pnpx eslint` should prompt you to install the required plugin; otherwise, you can install it manually:
|
|
327
327
|
|
|
328
328
|
```bash
|
|
@@ -344,7 +344,7 @@ export default defineConfig({
|
|
|
344
344
|
|
|
345
345
|
#### NgRx
|
|
346
346
|
|
|
347
|
-
NgRx support is also detected automatically if any of the following
|
|
347
|
+
NgRx support is also detected automatically if any of the following packages is installed in your project.
|
|
348
348
|
|
|
349
349
|
- `@ngrx/store`
|
|
350
350
|
- `@ngrx/effects`
|
|
@@ -362,11 +362,11 @@ export default defineConfig({
|
|
|
362
362
|
});
|
|
363
363
|
```
|
|
364
364
|
|
|
365
|
-
> Of course, NgRx depends on Angular so the Angular integration will be enabled as well.
|
|
365
|
+
> Of course, NgRx depends on Angular, so the Angular integration will be enabled as well.
|
|
366
366
|
|
|
367
367
|
#### Vitest
|
|
368
368
|
|
|
369
|
-
The vitest integration is detected automatically by checking if `vitest` is installed in your project. It can be
|
|
369
|
+
The vitest integration is detected automatically by checking if `vitest` is installed in your project. It can be enabled/disabled manually in the configuration:
|
|
370
370
|
|
|
371
371
|
```js
|
|
372
372
|
// eslint.config.js
|
|
@@ -383,7 +383,7 @@ We provide some optional integrations for specific use cases, that we don't incl
|
|
|
383
383
|
|
|
384
384
|
#### Formatters
|
|
385
385
|
|
|
386
|
-
Use external formatters to format files that ESLint cannot handle yet (`.css`, `.html`, etc). Powered by [`eslint-plugin-format`](https://github.com/antfu/eslint-plugin-format).
|
|
386
|
+
Use external formatters to format files that ESLint cannot handle yet (`.css`, `.html`, etc.). Powered by [`eslint-plugin-format`](https://github.com/antfu/eslint-plugin-format).
|
|
387
387
|
|
|
388
388
|
```js
|
|
389
389
|
// eslint.config.js
|