You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you don’t have a `.eslintrc.js`, we will create the file for you after installing `@anolilab/eslint-config`.
69
-
70
-
If you already have a `.eslintrc.js`, then you can extend the `.eslintrc.js`, with `@anolilab/eslint-config`.
71
-
72
-
> Note: If the script detects an existing `.eslintrc.js` file, it will not overwrite it.
73
-
74
-
> Note: It can happen that the postinstall script don't run, then you have to add the `.eslintrc.js` manually, or you will use bin command `./node_modules/bin/anolilab-eslint-config` to generate it.
75
-
76
68
> Note: Our default export contains all of our ESLint rules, including ECMAScript 6+. `@anolilab/eslint-config` use the `ecmaVersion`:`2021` as default.
77
69
>
78
70
> To change this configuration, change `env: { es2021: false, then active you needed env }` same for, `parserOptions: { "ecmaVersion": 2021 change the version }`
For more information about `missing` or `optional` to install rules see the `eslint` console output.
236
-
237
-
### Config
238
-
239
-
You can configure `@anolilab/eslint-config` options with your `package.json` file.
240
-
241
-
Add this property to your package.json:
242
-
243
-
```json5
244
-
{
245
-
"anolilab": {
246
-
"eslint-config": {
247
-
// options
248
-
}
249
-
}
250
-
}
251
-
```
252
-
253
-
#### indent
254
-
255
-
Type: `number`
256
-
257
-
Default: `4`
258
-
259
-
It will throw an error if the value is not numeric.
260
-
261
-
#### plugin
262
-
263
-
Type: `object` -> key: `string` value: `boolean`
264
-
265
-
Disable a plugin in your package.json config to turn it off globally in your project.
266
-
267
-
Example using package.json:
268
-
269
-
```json
270
-
{
271
-
"anolilab": {
272
-
"eslint-config": {
273
-
"plugin": {
274
-
"unicorn": false
275
-
}
276
-
}
277
-
}
278
-
}
279
-
```
280
-
281
-
#### warn_on_unsupported_typescript_version
282
-
283
-
Type: `boolean`
284
-
285
-
Default: `undefined`
286
-
287
-
To disable the warning, set the value to `false`.
288
-
289
-
```json
290
-
{
291
-
"anolilab": {
292
-
"eslint-config": {
293
-
"warn_on_unsupported_typescript_version": false
294
-
}
295
-
}
296
-
}
297
-
```
298
-
299
-
#### info_on_disabling_jsx_react_rule
300
-
301
-
Type: `boolean`
302
-
303
-
Default: `undefined`
304
-
305
-
To disable the info, set the value to `false`.
306
-
307
-
```json
308
-
{
309
-
"anolilab": {
310
-
"eslint-config": {
311
-
"info_on_disabling_jsx_react_rule": false
312
-
}
313
-
}
314
-
}
315
-
```
316
-
317
-
#### info_on_disabling_prettier_conflict_rule
318
-
319
-
Type: `boolean`
320
-
321
-
Default: `undefined`
322
-
323
-
To disable the info, set the value to `false`.
324
-
325
-
```json
326
-
{
327
-
"anolilab": {
328
-
"eslint-config": {
329
-
"info_on_disabling_prettier_conflict_rule": false
330
-
}
331
-
}
332
-
}
333
-
```
334
-
335
-
#### info_on_disabling_jsonc_sort_keys_rule
336
-
337
-
Type: `boolean`
338
-
339
-
Default: `undefined`
340
-
341
-
To disable the info, set the value to `false`.
342
-
343
-
```json
344
-
{
345
-
"anolilab": {
346
-
"eslint-config": {
347
-
"info_on_disabling_jsonc_sort_keys_rule": false
348
-
}
349
-
}
350
-
}
351
-
```
352
-
353
-
#### info_on_disabling_etc_no_deprecated
354
-
355
-
Type: `boolean`
356
-
357
-
Default: `undefined`
358
-
359
-
To disable the info, set the value to `false`.
360
-
361
-
```json
362
-
{
363
-
"anolilab": {
364
-
"eslint-config": {
365
-
"info_on_disabling_etc_no_deprecated": false
366
-
}
367
-
}
368
-
}
369
-
```
370
-
371
-
#### info_on_testing_library_framework
372
-
373
-
Type: `boolean`
374
-
375
-
Default: `undefined`
376
-
377
-
To disable the info, set the value to `false`.
378
-
379
-
```json
380
-
{
381
-
"anolilab": {
382
-
"eslint-config": {
383
-
"info_on_testing_library_framework": false
384
-
}
385
-
}
386
-
}
387
-
```
388
-
389
-
#### info_on_found_react_version
390
-
391
-
Type: `boolean`
392
-
393
-
Default: `undefined`
394
-
395
-
To disable the info, set the value to `false`.
396
-
397
-
```json
398
-
{
399
-
"anolilab": {
400
-
"eslint-config": {
401
-
"info_on_found_react_version": false
402
-
}
403
-
}
404
-
}
405
-
```
406
-
407
-
#### import_ignore_exports
408
-
409
-
Type: `string[]`
410
-
411
-
Default: `[]`
412
-
413
-
An array with files/paths for which unused exports will not be reported (e.g module entry points in a published package).
414
-
415
-
```json
416
-
{
417
-
"anolilab": {
418
-
"eslint-config": {
419
-
"import_ignore_exports": []
420
-
}
421
-
}
422
-
}
423
-
```
424
-
425
-
### Let [Prettier](https://prettier.io/) handle style-related rules
426
-
427
-
Prettier is a code formatting tool that offers fewer options but is more professional than the style-related rules in ESLint.
428
-
429
-
Now that Prettier has become a necessary tool in front end projects, `@anolilab/eslint-config` does not need to maintain the style-related rules in ESLint anymore,
430
-
so we completely removed all Prettier related rules, if `prettier` is found in your `package.json` and use ESLint to check logical errors which it’s good at.
431
-
432
-
As for whether two spaces or four spaces are used for indentation and whether there is a semicolon at the end, you can configure it in the project’s `.prettierrc.js`.
433
-
Of course, we also provide a recommended Prettier [configuration](../prettier-config/README.md) for your reference.
434
-
435
-
`@anolilab/eslint-config` does disable all included style-related rules, so there is no need to install [`eslint-config-prettier`](https://github.com/prettier/eslint-config-prettier).
436
-
437
-
## Using experimental features with JavaScript
438
-
439
-
If you are using experimental features such as class fields with JavaScript files you should install `@babel/eslint-parser`.
0 commit comments