@anolilab/eslint-config 16.0.1 → 16.1.0
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 +10 -0
- package/README.md +75 -0
- package/dist/index.cjs +10 -8
- package/dist/index.d.cts +42 -1
- package/dist/index.d.mts +42 -1
- package/dist/index.d.ts +42 -1
- package/dist/index.mjs +11 -9
- package/dist/packem_shared/getFilesGlobs-BbIYwP6s.mjs +1 -0
- package/dist/packem_shared/getFilesGlobs-llCT-8Ra.cjs +1 -0
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## @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)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **eslint-config:** enhance ESLint configuration with new plugins and utilities ([df11e7a](https://github.com/anolilab/javascript-style-guide/commit/df11e7a7d5aa943a275d020deedfee8a3723b2fd))
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* **eslint-config:** added missing eslint-plugin-react-you-might-not-need-an-effect ([5162c8f](https://github.com/anolilab/javascript-style-guide/commit/5162c8fc85f4535fd56f5f11e144adb4ac770ebf))
|
|
10
|
+
|
|
1
11
|
## @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
12
|
|
|
3
13
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -568,3 +568,78 @@ The anolilab javascript-style-guide is open-sourced software licensed under the
|
|
|
568
568
|
[license-url]: LICENSE.md "license"
|
|
569
569
|
[npm-image]: https://img.shields.io/npm/v/@anolilab/eslint-config/latest.svg?style=for-the-badge&logo=npm
|
|
570
570
|
[npm-url]: https://www.npmjs.com/package/@anolilab/eslint-config/v/latest "npm"
|
|
571
|
+
|
|
572
|
+
### Using `getFilesGlobs` for Common File Types
|
|
573
|
+
|
|
574
|
+
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.
|
|
575
|
+
|
|
576
|
+
You can import it alongside `createConfig`:
|
|
577
|
+
|
|
578
|
+
```javascript
|
|
579
|
+
// eslint.config.js
|
|
580
|
+
import { createConfig, getFilesGlobs } from "@anolilab/eslint-config";
|
|
581
|
+
import globals from "globals";
|
|
582
|
+
|
|
583
|
+
const baseConfig = createConfig();
|
|
584
|
+
|
|
585
|
+
// Get glob patterns for all JavaScript and TypeScript files
|
|
586
|
+
const jsTsFiles = getFilesGlobs("js_and_ts");
|
|
587
|
+
// Get glob patterns for Markdown files
|
|
588
|
+
const markdownFiles = getFilesGlobs("markdown");
|
|
589
|
+
// Get glob patterns for HTML related files
|
|
590
|
+
const htmlFiles = getFilesGlobs("html");
|
|
591
|
+
|
|
592
|
+
export default [
|
|
593
|
+
...baseConfig,
|
|
594
|
+
{
|
|
595
|
+
files: jsTsFiles,
|
|
596
|
+
// languageOptions, rules, etc., specific to JS and TS files
|
|
597
|
+
rules: {
|
|
598
|
+
// 'your-rule/for-js-ts': 'error',
|
|
599
|
+
}
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
files: markdownFiles,
|
|
603
|
+
// languageOptions, rules, etc., specific to Markdown files
|
|
604
|
+
// Often, you might use a specific processor or plugin for Markdown here
|
|
605
|
+
// processor: markdownProcessor, // Fictional example
|
|
606
|
+
// plugins: { markdownPlugin } // Fictional example
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
files: htmlFiles,
|
|
610
|
+
// languageOptions, rules, etc., specific to HTML files
|
|
611
|
+
},
|
|
612
|
+
// ... other configurations
|
|
613
|
+
];
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
The `getFilesGlobs` function accepts one of the following `FileType` strings:
|
|
617
|
+
|
|
618
|
+
- `"all"`: All JavaScript, TypeScript, and declaration files.
|
|
619
|
+
- `"astro_ts"`: TypeScript files within Astro components.
|
|
620
|
+
- `"astro"`: Astro component files (`.astro`).
|
|
621
|
+
- `"css"`: CSS files.
|
|
622
|
+
- `"d.ts"`: TypeScript declaration files (`.d.ts`, `.d.cts`, `.d.mts`).
|
|
623
|
+
- `"e2e"`: End-to-end test files.
|
|
624
|
+
- `"graphql"`: GraphQL files (`.gql`, `.graphql`).
|
|
625
|
+
- `"html"`: Various HTML-like template files (`.html`, `.hbs`, `.erb`, etc.).
|
|
626
|
+
- `"js_and_ts"`: All JavaScript and TypeScript source files (excluding declarations).
|
|
627
|
+
- `"js"`: JavaScript files (`.js`, `.mjs`, `.cjs`).
|
|
628
|
+
- `"jsx_and_tsx"`: JSX and TSX files.
|
|
629
|
+
- `"less"`: LESS files.
|
|
630
|
+
- `"markdown_in_markdown"`: Markdown files embedded within other Markdown files.
|
|
631
|
+
- `"markdown_inline_js_jsx"`: JS/JSX code blocks within Markdown.
|
|
632
|
+
- `"markdown"`: Markdown files (`.md`, `.mkdn`, etc.).
|
|
633
|
+
- `"postcss"`: PostCSS configuration files.
|
|
634
|
+
- `"scss"`: SCSS files.
|
|
635
|
+
- `"storybook"`: Storybook story files.
|
|
636
|
+
- `"svg"`: SVG files.
|
|
637
|
+
- `"toml"`: TOML files.
|
|
638
|
+
- `"ts"`: All TypeScript files including declarations and TSX (`.ts`, `.tsx`, `.d.ts`, etc.).
|
|
639
|
+
- `"vitest"`: Vitest test files.
|
|
640
|
+
- `"xml"`: XML files.
|
|
641
|
+
- `"yaml"`: YAML files (`.yaml`, `.yml`).
|
|
642
|
+
|
|
643
|
+
Using `getFilesGlobs` can make your configuration more readable and maintainable by abstracting away the specific glob patterns.
|
|
644
|
+
|
|
645
|
+
### Type-Aware Linting
|