@anolilab/eslint-config 16.0.1 → 16.1.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## @anolilab/eslint-config [16.1.1](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@16.1.0...@anolilab/eslint-config@16.1.1) (2025-05-26)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **eslint-config:** fixed esm type export ([cbcf70c](https://github.com/anolilab/javascript-style-guide/commit/cbcf70cf502b7031c0963f2b1f44b83adb9cf2a9))
6
+ * **eslint-config:** fixed style rules when prettier is not installed to use stylistic ([b744d87](https://github.com/anolilab/javascript-style-guide/commit/b744d87eae7278c8d76c1a27d8abca749062f6e7))
7
+ * **eslint-config:** update type export and add linting for types ([8e169f6](https://github.com/anolilab/javascript-style-guide/commit/8e169f690e509d6dcae96ae5c690c78579583943))
8
+
9
+ ## @anolilab/eslint-config [16.1.0](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@16.0.1...@anolilab/eslint-config@16.1.0) (2025-05-26)
10
+
11
+ ### Features
12
+
13
+ * **eslint-config:** enhance ESLint configuration with new plugins and utilities ([df11e7a](https://github.com/anolilab/javascript-style-guide/commit/df11e7a7d5aa943a275d020deedfee8a3723b2fd))
14
+
15
+ ### Bug Fixes
16
+
17
+ * **eslint-config:** added missing eslint-plugin-react-you-might-not-need-an-effect ([5162c8f](https://github.com/anolilab/javascript-style-guide/commit/5162c8fc85f4535fd56f5f11e144adb4ac770ebf))
18
+
1
19
  ## @anolilab/eslint-config [16.0.1](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@16.0.0...@anolilab/eslint-config@16.0.1) (2025-05-26)
2
20
 
3
21
  ### Bug Fixes
package/README.md CHANGED
@@ -108,7 +108,7 @@ export default createConfig(
108
108
  "eslint:recommended",
109
109
  // Other extends...
110
110
  ],
111
- })
111
+ }),
112
112
 
113
113
  // Other flat configs...
114
114
  );
@@ -131,7 +131,7 @@ export default createConfig({
131
131
  // `.eslintignore` is no longer supported in Flat config, use `ignores` instead
132
132
  ignores: [
133
133
  "**/fixtures",
134
- // ...globs
134
+ // ...globs
135
135
  ],
136
136
 
137
137
  // Disable jsonc and yaml support
@@ -146,7 +146,7 @@ export default createConfig({
146
146
  typescript: true,
147
147
  vue: true,
148
148
 
149
- yaml: false
149
+ yaml: false,
150
150
  });
151
151
  ```
152
152
 
@@ -171,7 +171,7 @@ import { createConfig } from "@anolilab/eslint-config";
171
171
 
172
172
  export default createConfig(
173
173
  {
174
- // Configures for anolilab's config
174
+ // Configures for anolilab's config
175
175
  },
176
176
 
177
177
  // From the second arguments they are ESLint Flat Configs
@@ -362,91 +362,91 @@ Our configuration integrates a wide array of ESLint plugins to cover various asp
362
362
 
363
363
  These plugins form the backbone of our linting rules, focusing on best practices, consistency, and potential errors.
364
364
 
365
- - **[@eslint/js](https://www.npmjs.com/package/@eslint/js)**: Core ESLint rules.
366
- - **[eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)**: Various awesome ESLint rules.
367
- - **[eslint-plugin-sonarjs](https://github.com/SonarSource/eslint-plugin-sonarjs)**: Rules to detect bugs and code smells.
368
- - **[eslint-plugin-promise](https://github.com/eslint-community/eslint-plugin-promise)**: Enforce best practices for JavaScript promises.
369
- - **[eslint-plugin-es-x](https://github.com/eslint-community/eslint-plugin-es-x)** (formerly `eslint-plugin-es`): Prevent ES6+ syntax from being used in ES5 environments.
370
- - **[eslint-plugin-antfu](https://github.com/antfu/eslint-config)**: Opinionated linting rules by Anthony Fu.
371
- - **[eslint-plugin-perfectionist](https://github.com/azat-io/eslint-plugin-perfectionist)**: Rules for sorting and ordering various data structures.
372
- - **[eslint-plugin-no-for-of-array](https://github.com/smelukov/eslint-plugin-no-for-of-array)**: Disallow `for...of` loops on arrays (promoting array methods).
373
- - **[eslint-plugin-unused-imports](https://github.com/sweepline/eslint-plugin-unused-imports)**: Find and remove unused ES6 imports.
365
+ - **[@eslint/js](https://www.npmjs.com/package/@eslint/js)**: Core ESLint rules.
366
+ - **[eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)**: Various awesome ESLint rules.
367
+ - **[eslint-plugin-sonarjs](https://github.com/SonarSource/eslint-plugin-sonarjs)**: Rules to detect bugs and code smells.
368
+ - **[eslint-plugin-promise](https://github.com/eslint-community/eslint-plugin-promise)**: Enforce best practices for JavaScript promises.
369
+ - **[eslint-plugin-es-x](https://github.com/eslint-community/eslint-plugin-es-x)** (formerly `eslint-plugin-es`): Prevent ES6+ syntax from being used in ES5 environments.
370
+ - **[eslint-plugin-antfu](https://github.com/antfu/eslint-config)**: Opinionated linting rules by Anthony Fu.
371
+ - **[eslint-plugin-perfectionist](https://github.com/azat-io/eslint-plugin-perfectionist)**: Rules for sorting and ordering various data structures.
372
+ - **[eslint-plugin-no-for-of-array](https://github.com/smelukov/eslint-plugin-no-for-of-array)**: Disallow `for...of` loops on arrays (promoting array methods).
373
+ - **[eslint-plugin-unused-imports](https://github.com/sweepline/eslint-plugin-unused-imports)**: Find and remove unused ES6 imports.
374
374
 
375
375
  ### Stylistic & Formatting
376
376
 
377
377
  These plugins help maintain a consistent code style. Note that while these are included, you can also use Prettier for formatting, and our config is designed to be compatible.
378
378
 
379
- - **[@stylistic/eslint-plugin](https://eslint.style/packages/default)** (and `@stylistic/eslint-plugin-ts`): ESLint Stylistic, for all stylistic rules.
380
- - **[eslint-plugin-simple-import-sort](https://github.com/lydell/eslint-plugin-simple-import-sort)**: Easy import sorting.
381
- - **[eslint-plugin-format](https://github.com/antfu/eslint-plugin-format)**: Enables formatting of various file types using Prettier or other formatters via ESLint.
379
+ - **[@stylistic/eslint-plugin](https://eslint.style/packages/default)** (and `@stylistic/eslint-plugin-ts`): ESLint Stylistic, for all stylistic rules.
380
+ - **[eslint-plugin-simple-import-sort](https://github.com/lydell/eslint-plugin-simple-import-sort)**: Easy import sorting.
381
+ - **[eslint-plugin-format](https://github.com/antfu/eslint-plugin-format)**: Enables formatting of various file types using Prettier or other formatters via ESLint.
382
382
 
383
383
  ### Language Support & Syntax
384
384
 
385
385
  Plugins for specific languages or syntaxes beyond standard JavaScript/TypeScript.
386
386
 
387
- - **[@typescript-eslint/eslint-plugin](https://typescript-eslint.io/)**: The tooling that enables ESLint to lint TypeScript code.
388
- - **[eslint-plugin-jsonc](https://github.com/ota-meshi/eslint-plugin-jsonc)**: ESLint plugin for JSON, JSONC, and JSON5 files.
389
- - **[eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml)**: ESLint plugin for YAML files.
390
- - **[eslint-plugin-toml](https://github.com/ota-meshi/eslint-plugin-toml)**: ESLint plugin for TOML files.
391
- - **[eslint-plugin-html](https://github.com/BenoitZugmeyer/eslint-plugin-html)**: An ESLint plugin to extract and lint script tags from HTML files.
392
- - **[@html-eslint/eslint-plugin](https://html-eslint.org/)**: Alternative ESLint plugin for HTML files.
393
- - **[@eslint/markdown](https://www.npmjs.com/package/@eslint/markdown)**: Lint JavaScript code blocks in Markdown documents.
394
- - **[eslint-plugin-astro](https://github.com/ota-meshi/eslint-plugin-astro)**: ESLint plugin for Astro components.
387
+ - **[@typescript-eslint/eslint-plugin](https://typescript-eslint.io/)**: The tooling that enables ESLint to lint TypeScript code.
388
+ - **[eslint-plugin-jsonc](https://github.com/ota-meshi/eslint-plugin-jsonc)**: ESLint plugin for JSON, JSONC, and JSON5 files.
389
+ - **[eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml)**: ESLint plugin for YAML files.
390
+ - **[eslint-plugin-toml](https://github.com/ota-meshi/eslint-plugin-toml)**: ESLint plugin for TOML files.
391
+ - **[eslint-plugin-html](https://github.com/BenoitZugmeyer/eslint-plugin-html)**: An ESLint plugin to extract and lint script tags from HTML files.
392
+ - **[@html-eslint/eslint-plugin](https://html-eslint.org/)**: Alternative ESLint plugin for HTML files.
393
+ - **[@eslint/markdown](https://www.npmjs.com/package/@eslint/markdown)**: Lint JavaScript code blocks in Markdown documents.
394
+ - **[eslint-plugin-astro](https://github.com/ota-meshi/eslint-plugin-astro)**: ESLint plugin for Astro components.
395
395
 
396
396
  ### Import & Module System
397
397
 
398
398
  Managing imports and module structure.
399
399
 
400
- - **[eslint-plugin-import-x](https://github.com/un-es/eslint-plugin-import-x)** (formerly `eslint-plugin-import`): Linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names.
401
- * Uses `eslint-import-resolver-node` and `eslint-import-resolver-typescript`.
402
- - **[eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n)** (formerly `eslint-plugin-node`): Additional ESLint rules for Node.js.
400
+ - **[eslint-plugin-import-x](https://github.com/un-es/eslint-plugin-import-x)** (formerly `eslint-plugin-import`): Linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names.
401
+ - Uses `eslint-import-resolver-node` and `eslint-import-resolver-typescript`.
402
+ - **[eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n)** (formerly `eslint-plugin-node`): Additional ESLint rules for Node.js.
403
403
 
404
404
  ### Security
405
405
 
406
406
  Plugins focused on identifying potential security vulnerabilities.
407
407
 
408
- - **[eslint-plugin-security](https://github.com/eslint-community/eslint-plugin-security)**: ESLint rules for Node Security.
409
- - **[eslint-plugin-no-secrets](https://github.com/nickdeis/eslint-plugin-no-secrets)**: An ESLint plugin that detects potential secrets/credentials.
410
- - **[eslint-plugin-no-unsanitized](https://github.com/mozilla/eslint-plugin-no-unsanitized)**: ESLint plugin for security related rules regarding untrusted input.
408
+ - **[eslint-plugin-security](https://github.com/eslint-community/eslint-plugin-security)**: ESLint rules for Node Security.
409
+ - **[eslint-plugin-no-secrets](https://github.com/nickdeis/eslint-plugin-no-secrets)**: An ESLint plugin that detects potential secrets/credentials.
410
+ - **[eslint-plugin-no-unsanitized](https://github.com/mozilla/eslint-plugin-no-unsanitized)**: ESLint plugin for security related rules regarding untrusted input.
411
411
 
412
412
  ### Testing
413
413
 
414
414
  Plugins for various testing frameworks and practices.
415
415
 
416
- - **[eslint-plugin-no-only-tests](https://github.com/levibuzolic/eslint-plugin-no-only-tests)**: Disallow `.only` calls in test files.
417
- - **[eslint-plugin-testing-library](https://github.com/testing-library/eslint-plugin-testing-library)**: ESLint plugin for Testing Library.
418
- - **[eslint-plugin-playwright](https://github.com/playwright-community/eslint-plugin-playwright)**: ESLint plugin for Playwright.
416
+ - **[eslint-plugin-no-only-tests](https://github.com/levibuzolic/eslint-plugin-no-only-tests)**: Disallow `.only` calls in test files.
417
+ - **[eslint-plugin-testing-library](https://github.com/testing-library/eslint-plugin-testing-library)**: ESLint plugin for Testing Library.
418
+ - **[eslint-plugin-playwright](https://github.com/playwright-community/eslint-plugin-playwright)**: ESLint plugin for Playwright.
419
419
 
420
420
  ### Frameworks & Libraries
421
421
 
422
422
  Support for specific UI frameworks, libraries, and tools.
423
423
 
424
- - **[@eslint-react/eslint-plugin](https://github.com/AriPerkkio/eslint-react)**: A comprehensive ESLint plugin for React.
425
- - **[eslint-plugin-react-hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks)**: ESLint rules for React Hooks.
426
- - **[eslint-plugin-react-refresh](https://www.npmjs.com/package/eslint-plugin-react-refresh)**: Enforces best practices for React Fast Refresh.
427
- - **[eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y)**: Static AST checker for accessibility rules on JSX elements.
428
- - **[eslint-plugin-validate-jsx-nesting](https://github.com/TitTat/eslint-plugin-validate-jsx-nesting)**: Validate JSX element nesting.
429
- - **[eslint-plugin-tailwindcss](https://github.com/francoismassart/eslint-plugin-tailwindcss)**: ESLint plugin for Tailwind CSS.
430
- - **[eslint-plugin-storybook](https://github.com/storybookjs/eslint-plugin-storybook)**: Best practice rules for Storybook.
431
- - **[@tanstack/eslint-plugin-query](https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query)**: ESLint rules for TanStack Query.
432
- - **[@tanstack/eslint-plugin-router](https://tanstack.com/router/latest/docs/eslint/eslint-plugin-router)**: ESLint rules for TanStack Router.
433
- - **[@unocss/eslint-plugin](https://github.com/unocss/unocss/tree/main/packages/eslint-plugin)**: ESLint plugin for UnoCSS.
434
- - **[eslint-plugin-zod](https://github.com/IsaacScript/eslint-plugin-zod)**: ESLint rules for Zod schemas.
435
- - **[eslint-plugin-you-dont-need-lodash-underscore](https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore)**: Encourages use of native JavaScript methods over Lodash/Underscore.
424
+ - **[@eslint-react/eslint-plugin](https://github.com/AriPerkkio/eslint-react)**: A comprehensive ESLint plugin for React.
425
+ - **[eslint-plugin-react-hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks)**: ESLint rules for React Hooks.
426
+ - **[eslint-plugin-react-refresh](https://www.npmjs.com/package/eslint-plugin-react-refresh)**: Enforces best practices for React Fast Refresh.
427
+ - **[eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y)**: Static AST checker for accessibility rules on JSX elements.
428
+ - **[eslint-plugin-validate-jsx-nesting](https://github.com/TitTat/eslint-plugin-validate-jsx-nesting)**: Validate JSX element nesting.
429
+ - **[eslint-plugin-tailwindcss](https://github.com/francoismassart/eslint-plugin-tailwindcss)**: ESLint plugin for Tailwind CSS.
430
+ - **[eslint-plugin-storybook](https://github.com/storybookjs/eslint-plugin-storybook)**: Best practice rules for Storybook.
431
+ - **[@tanstack/eslint-plugin-query](https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query)**: ESLint rules for TanStack Query.
432
+ - **[@tanstack/eslint-plugin-router](https://tanstack.com/router/latest/docs/eslint/eslint-plugin-router)**: ESLint rules for TanStack Router.
433
+ - **[@unocss/eslint-plugin](https://github.com/unocss/unocss/tree/main/packages/eslint-plugin)**: ESLint plugin for UnoCSS.
434
+ - **[eslint-plugin-zod](https://github.com/IsaacScript/eslint-plugin-zod)**: ESLint rules for Zod schemas.
435
+ - **[eslint-plugin-you-dont-need-lodash-underscore](https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore)**: Encourages use of native JavaScript methods over Lodash/Underscore.
436
436
 
437
437
  ### Documentation & Comments
438
438
 
439
- - **[@eslint-community/eslint-plugin-eslint-comments](https://github.com/eslint-community/eslint-plugin-eslint-comments)** (formerly `eslint-plugin-eslint-comments`): Additional ESLint rules for ESLint directive comments (`/*eslint-...*/`).
440
- - **[eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc)**: JSDoc specific linting rules.
441
- - **[eslint-plugin-tsdoc](https://github.com/microsoft/tsdoc/tree/main/eslint-plugin)**: TSDoc specific linting rules.
439
+ - **[@eslint-community/eslint-plugin-eslint-comments](https://github.com/eslint-community/eslint-plugin-eslint-comments)** (formerly `eslint-plugin-eslint-comments`): Additional ESLint rules for ESLint directive comments (`/*eslint-...*/`).
440
+ - **[eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc)**: JSDoc specific linting rules.
441
+ - **[eslint-plugin-tsdoc](https://github.com/microsoft/tsdoc/tree/main/eslint-plugin)**: TSDoc specific linting rules.
442
442
 
443
443
  ### Compatibility & Others
444
444
 
445
- - **[eslint-plugin-compat](https://github.com/amilajack/eslint-plugin-compat)**: Lint the browser compatibility of your code.
446
- - **[eslint-config-flat-gitignore](https://github.com/antfu/eslint-config-flat-gitignore)**: Utility to use .gitignore in flat config.
447
- - **[eslint-flat-config-utils](https://github.com/antfu/eslint-flat-config-utils)**: Utilities for working with ESLint flat config.
448
- - **[eslint-merge-processors](https://github.com/eslint/eslint-merge-processors)**: Utility to merge ESLint processors.
449
- - **[@eslint/compat](https://www.npmjs.com/package/@eslint/compat)**: Utilities for compatibility between ESLint flat config and eslintrc.
445
+ - **[eslint-plugin-compat](https://github.com/amilajack/eslint-plugin-compat)**: Lint the browser compatibility of your code.
446
+ - **[eslint-config-flat-gitignore](https://github.com/antfu/eslint-config-flat-gitignore)**: Utility to use .gitignore in flat config.
447
+ - **[eslint-flat-config-utils](https://github.com/antfu/eslint-flat-config-utils)**: Utilities for working with ESLint flat config.
448
+ - **[eslint-merge-processors](https://github.com/eslint/eslint-merge-processors)**: Utility to merge ESLint processors.
449
+ - **[@eslint/compat](https://www.npmjs.com/package/@eslint/compat)**: Utilities for compatibility between ESLint flat config and eslintrc.
450
450
 
451
451
  ---
452
452
 
@@ -454,46 +454,46 @@ Support for specific UI frameworks, libraries, and tools.
454
454
 
455
455
  This list is a more condensed version and might not be exhaustive if some plugins are very specific or utility-based. It aims to provide a quick overview of the primary active linting plugins.
456
456
 
457
- - `@eslint/js`
458
- - `@stylistic/eslint-plugin`
459
- - `@typescript-eslint/eslint-plugin`
460
- - `@eslint-community/eslint-plugin-eslint-comments`
461
- - `@eslint-react/eslint-plugin`
462
- - `@tanstack/eslint-plugin-query`
463
- - `@tanstack/eslint-plugin-router`
464
- - `@unocss/eslint-plugin`
465
- - `eslint-plugin-antfu`
466
- - `eslint-plugin-astro`
467
- - `eslint-plugin-compat`
468
- - `eslint-plugin-es-x`
469
- - `eslint-plugin-format`
470
- - `eslint-plugin-html` (or `@html-eslint/eslint-plugin`)
471
- - `eslint-plugin-import-x`
472
- - `eslint-plugin-jsdoc`
473
- - `eslint-plugin-jsonc`
474
- - `eslint-plugin-jsx-a11y`
475
- - `eslint-plugin-n`
476
- - `eslint-plugin-no-only-tests`
477
- - `eslint-plugin-no-secrets`
478
- - `eslint-plugin-no-unsanitized`
479
- - `eslint-plugin-perfectionist`
480
- - `eslint-plugin-playwright`
481
- - `eslint-plugin-promise`
482
- - `eslint-plugin-react-hooks`
483
- - `eslint-plugin-regexp` (often a dependency of other plugins like SonarJS)
484
- - `eslint-plugin-security`
485
- - `eslint-plugin-simple-import-sort`
486
- - `eslint-plugin-sonarjs`
487
- - `eslint-plugin-storybook`
488
- - `eslint-plugin-tailwindcss`
489
- - `eslint-plugin-testing-library`
490
- - `eslint-plugin-toml`
491
- - `eslint-plugin-tsdoc`
492
- - `eslint-plugin-unicorn`
493
- - `eslint-plugin-unused-imports`
494
- - `eslint-plugin-yml`
495
- - `eslint-plugin-zod`
496
- - `eslint-plugin-you-dont-need-lodash-underscore`
457
+ - `@eslint/js`
458
+ - `@stylistic/eslint-plugin`
459
+ - `@typescript-eslint/eslint-plugin`
460
+ - `@eslint-community/eslint-plugin-eslint-comments`
461
+ - `@eslint-react/eslint-plugin`
462
+ - `@tanstack/eslint-plugin-query`
463
+ - `@tanstack/eslint-plugin-router`
464
+ - `@unocss/eslint-plugin`
465
+ - `eslint-plugin-antfu`
466
+ - `eslint-plugin-astro`
467
+ - `eslint-plugin-compat`
468
+ - `eslint-plugin-es-x`
469
+ - `eslint-plugin-format`
470
+ - `eslint-plugin-html` (or `@html-eslint/eslint-plugin`)
471
+ - `eslint-plugin-import-x`
472
+ - `eslint-plugin-jsdoc`
473
+ - `eslint-plugin-jsonc`
474
+ - `eslint-plugin-jsx-a11y`
475
+ - `eslint-plugin-n`
476
+ - `eslint-plugin-no-only-tests`
477
+ - `eslint-plugin-no-secrets`
478
+ - `eslint-plugin-no-unsanitized`
479
+ - `eslint-plugin-perfectionist`
480
+ - `eslint-plugin-playwright`
481
+ - `eslint-plugin-promise`
482
+ - `eslint-plugin-react-hooks`
483
+ - `eslint-plugin-regexp` (often a dependency of other plugins like SonarJS)
484
+ - `eslint-plugin-security`
485
+ - `eslint-plugin-simple-import-sort`
486
+ - `eslint-plugin-sonarjs`
487
+ - `eslint-plugin-storybook`
488
+ - `eslint-plugin-tailwindcss`
489
+ - `eslint-plugin-testing-library`
490
+ - `eslint-plugin-toml`
491
+ - `eslint-plugin-tsdoc`
492
+ - `eslint-plugin-unicorn`
493
+ - `eslint-plugin-unused-imports`
494
+ - `eslint-plugin-yml`
495
+ - `eslint-plugin-zod`
496
+ - `eslint-plugin-you-dont-need-lodash-underscore`
497
497
 
498
498
  ## Our Stance on Formatting
499
499
 
@@ -507,15 +507,17 @@ This ESLint configuration includes stylistic rules that can format your JavaScri
507
507
  To ensure code is linted and fixed before committing, we recommend integrating with a pre-commit tool like `lint-staged` and `husky`. Our sister package, `@anolilab/lint-staged-config`, is designed to work seamlessly with this ESLint configuration.
508
508
 
509
509
  Example `lint-staged` configuration in your `package.json` (or relevant file):
510
+
510
511
  ```json
511
512
  // package.json
512
513
  {
513
514
  "lint-staged": {
514
515
  "*.{js,jsx,ts,tsx}": "eslint --fix"
515
- // Add other linters for other file types if needed
516
+ // Add other linters for other file types if needed
516
517
  }
517
518
  }
518
519
  ```
520
+
519
521
  Ensure `husky` is set up to run `lint-staged` on pre-commit.
520
522
 
521
523
  ## Versioning Policy
@@ -554,9 +556,9 @@ If you would like to help take a look at the [list of issues](https://github.com
554
556
  - [Daniel Bannert](https://github.com/prisis)
555
557
  - [All Contributors](https://github.com/anolilab/javascript-style-guide/graphs/contributors)
556
558
  - Inspired by and thankful for the work in configurations like:
557
- - [eslint-config-airbnb](https://www.npmjs.com/package/eslint-config-airbnb)
558
- - [eslint-config-canonical](https://github.com/gajus/eslint-config-canonical)
559
- - [@antfu/eslint-config](https://github.com/antfu/eslint-config) (for its modern approach and clear documentation)
559
+ - [eslint-config-airbnb](https://www.npmjs.com/package/eslint-config-airbnb)
560
+ - [eslint-config-canonical](https://github.com/gajus/eslint-config-canonical)
561
+ - [@antfu/eslint-config](https://github.com/antfu/eslint-config) (for its modern approach and clear documentation)
560
562
 
561
563
  ## License
562
564
 
@@ -568,3 +570,77 @@ The anolilab javascript-style-guide is open-sourced software licensed under the
568
570
  [license-url]: LICENSE.md "license"
569
571
  [npm-image]: https://img.shields.io/npm/v/@anolilab/eslint-config/latest.svg?style=for-the-badge&logo=npm
570
572
  [npm-url]: https://www.npmjs.com/package/@anolilab/eslint-config/v/latest "npm"
573
+
574
+ ### Using `getFilesGlobs` for Common File Types
575
+
576
+ Your `@anolilab/eslint-config` package also exports a handy utility function `getFilesGlobs` that provides pre-defined glob patterns for common file types. This can simplify targeting specific sets of files in your ESLint configuration objects.
577
+
578
+ You can import it alongside `createConfig`:
579
+
580
+ ```javascript
581
+ // eslint.config.js
582
+ import { createConfig, getFilesGlobs } from "@anolilab/eslint-config";
583
+
584
+ const baseConfig = createConfig();
585
+
586
+ // Get glob patterns for all JavaScript and TypeScript files
587
+ const jsTsFiles = getFilesGlobs("js_and_ts");
588
+ // Get glob patterns for Markdown files
589
+ const markdownFiles = getFilesGlobs("markdown");
590
+ // Get glob patterns for HTML related files
591
+ const htmlFiles = getFilesGlobs("html");
592
+
593
+ export default [
594
+ ...baseConfig,
595
+ {
596
+ files: jsTsFiles,
597
+ // languageOptions, rules, etc., specific to JS and TS files
598
+ rules: {
599
+ // 'your-rule/for-js-ts': 'error',
600
+ },
601
+ },
602
+ {
603
+ files: markdownFiles,
604
+ // languageOptions, rules, etc., specific to Markdown files
605
+ // Often, you might use a specific processor or plugin for Markdown here
606
+ // processor: markdownProcessor, // Fictional example
607
+ // plugins: { markdownPlugin } // Fictional example
608
+ },
609
+ {
610
+ files: htmlFiles,
611
+ // languageOptions, rules, etc., specific to HTML files
612
+ },
613
+ // ... other configurations
614
+ ];
615
+ ```
616
+
617
+ The `getFilesGlobs` function accepts one of the following `FileType` strings:
618
+
619
+ - `"all"`: All JavaScript, TypeScript, and declaration files.
620
+ - `"astro_ts"`: TypeScript files within Astro components.
621
+ - `"astro"`: Astro component files (`.astro`).
622
+ - `"css"`: CSS files.
623
+ - `"d.ts"`: TypeScript declaration files (`.d.ts`, `.d.cts`, `.d.mts`).
624
+ - `"e2e"`: End-to-end test files.
625
+ - `"graphql"`: GraphQL files (`.gql`, `.graphql`).
626
+ - `"html"`: Various HTML-like template files (`.html`, `.hbs`, `.erb`, etc.).
627
+ - `"js_and_ts"`: All JavaScript and TypeScript source files (excluding declarations).
628
+ - `"js"`: JavaScript files (`.js`, `.mjs`, `.cjs`).
629
+ - `"jsx_and_tsx"`: JSX and TSX files.
630
+ - `"less"`: LESS files.
631
+ - `"markdown_in_markdown"`: Markdown files embedded within other Markdown files.
632
+ - `"markdown_inline_js_jsx"`: JS/JSX code blocks within Markdown.
633
+ - `"markdown"`: Markdown files (`.md`, `.mkdn`, etc.).
634
+ - `"postcss"`: PostCSS configuration files.
635
+ - `"scss"`: SCSS files.
636
+ - `"storybook"`: Storybook story files.
637
+ - `"svg"`: SVG files.
638
+ - `"toml"`: TOML files.
639
+ - `"ts"`: All TypeScript files including declarations and TSX (`.ts`, `.tsx`, `.d.ts`, etc.).
640
+ - `"vitest"`: Vitest test files.
641
+ - `"xml"`: XML files.
642
+ - `"yaml"`: YAML files (`.yaml`, `.yml`).
643
+
644
+ Using `getFilesGlobs` can make your configuration more readable and maintainable by abstracting away the specific glob patterns.
645
+
646
+ ### Type-Aware Linting