eslint-plugin-spellbookx 0.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.
Files changed (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +190 -0
  3. package/dist/configs/astro.d.ts +4 -0
  4. package/dist/configs/astro.d.ts.map +1 -0
  5. package/dist/configs/astro.js +73 -0
  6. package/dist/configs/cspell.d.ts +4 -0
  7. package/dist/configs/cspell.d.ts.map +1 -0
  8. package/dist/configs/cspell.js +10 -0
  9. package/dist/configs/ignores.d.ts +4 -0
  10. package/dist/configs/ignores.d.ts.map +1 -0
  11. package/dist/configs/ignores.js +88 -0
  12. package/dist/configs/index.d.ts +15 -0
  13. package/dist/configs/index.d.ts.map +1 -0
  14. package/dist/configs/index.js +14 -0
  15. package/dist/configs/javascript.d.ts +4 -0
  16. package/dist/configs/javascript.d.ts.map +1 -0
  17. package/dist/configs/javascript.js +79 -0
  18. package/dist/configs/json.d.ts +4 -0
  19. package/dist/configs/json.d.ts.map +1 -0
  20. package/dist/configs/json.js +57 -0
  21. package/dist/configs/markdown.d.ts +4 -0
  22. package/dist/configs/markdown.d.ts.map +1 -0
  23. package/dist/configs/markdown.js +21 -0
  24. package/dist/configs/prettier.d.ts +4 -0
  25. package/dist/configs/prettier.d.ts.map +1 -0
  26. package/dist/configs/prettier.js +19 -0
  27. package/dist/configs/react.d.ts +4 -0
  28. package/dist/configs/react.d.ts.map +1 -0
  29. package/dist/configs/react.js +61 -0
  30. package/dist/configs/recommended/astro.d.ts +4 -0
  31. package/dist/configs/recommended/astro.d.ts.map +1 -0
  32. package/dist/configs/recommended/astro.js +18 -0
  33. package/dist/configs/recommended/index.d.ts +7 -0
  34. package/dist/configs/recommended/index.d.ts.map +1 -0
  35. package/dist/configs/recommended/index.js +6 -0
  36. package/dist/configs/recommended/no-spellcheck-astro.d.ts +4 -0
  37. package/dist/configs/recommended/no-spellcheck-astro.d.ts.map +1 -0
  38. package/dist/configs/recommended/no-spellcheck-astro.js +16 -0
  39. package/dist/configs/recommended/no-spellcheck-react.d.ts +4 -0
  40. package/dist/configs/recommended/no-spellcheck-react.d.ts.map +1 -0
  41. package/dist/configs/recommended/no-spellcheck-react.js +14 -0
  42. package/dist/configs/recommended/no-spellcheck.d.ts +4 -0
  43. package/dist/configs/recommended/no-spellcheck.d.ts.map +1 -0
  44. package/dist/configs/recommended/no-spellcheck.js +14 -0
  45. package/dist/configs/recommended/react.d.ts +4 -0
  46. package/dist/configs/recommended/react.d.ts.map +1 -0
  47. package/dist/configs/recommended/react.js +16 -0
  48. package/dist/configs/recommended/recommended.d.ts +4 -0
  49. package/dist/configs/recommended/recommended.d.ts.map +1 -0
  50. package/dist/configs/recommended/recommended.js +22 -0
  51. package/dist/index.d.ts +9 -0
  52. package/dist/index.d.ts.map +1 -0
  53. package/dist/index.js +49 -0
  54. package/dist/shared-rules/index.d.ts +4 -0
  55. package/dist/shared-rules/index.d.ts.map +1 -0
  56. package/dist/shared-rules/index.js +3 -0
  57. package/dist/shared-rules/js-common.d.ts +25 -0
  58. package/dist/shared-rules/js-common.d.ts.map +1 -0
  59. package/dist/shared-rules/js-common.js +50 -0
  60. package/dist/shared-rules/js-imports-exports.d.ts +16 -0
  61. package/dist/shared-rules/js-imports-exports.d.ts.map +1 -0
  62. package/dist/shared-rules/js-imports-exports.js +191 -0
  63. package/dist/shared-rules/jsdoc.d.ts +23 -0
  64. package/dist/shared-rules/jsdoc.d.ts.map +1 -0
  65. package/dist/shared-rules/jsdoc.js +62 -0
  66. package/dist/tsconfig.lib.tsbuildinfo +1 -0
  67. package/package.json +74 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Davide Di Criscito
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,190 @@
1
+ # eslint-plugin-spellbookx
2
+
3
+ This plugin offers a unified, modern ESLint Flat Config setup to reduce configuration overhead while enforcing best practices, clean code, and maintainable project structures for modern JavaScript, TypeScript, and React projects.
4
+
5
+ ---
6
+
7
+ ## Table of Contents
8
+
9
+ - [Installation](#installation)
10
+ - [Available Configurations](#available-configurations)
11
+ - [Usage Examples](#usage-examples)
12
+ - [Rules Explanation](#rules-explanation)
13
+ - [License](#license)
14
+
15
+ ---
16
+
17
+ ## Installation
18
+
19
+ ```bash
20
+ npm install -g eslint
21
+ npm install -D eslint eslint-plugin-spellbookx
22
+ ```
23
+
24
+ or
25
+
26
+ ```bash
27
+ pnpm add -g eslint
28
+ pnpm add -D eslint eslint-plugin-spellbookx
29
+ ```
30
+
31
+ or
32
+
33
+ ```bash
34
+ yarn global add eslint
35
+ yarn add -D eslint eslint-plugin-spellbookx
36
+ ```
37
+
38
+ or
39
+
40
+ ```bash
41
+ bun add -g eslint
42
+ bun add -D eslint eslint-plugin-spellbookx
43
+ ```
44
+
45
+ Then use Flat Config by importing the desired configurations:
46
+
47
+ ```js
48
+ // eslint.config.js
49
+ import spellbookx from 'eslint-plugin-spellbookx';
50
+
51
+ export default [...spellbookx.configs.recommended];
52
+ ```
53
+
54
+ ---
55
+
56
+ ## Available Configurations
57
+
58
+ | Config Name | Description |
59
+ | --------------------------------- | --------------------------------------------------------------------------------------------------------------- |
60
+ | `ignores` | Global ignore patterns for node modules, build artifacts, caches, and IDE/project files. |
61
+ | `javascript` | Base rules for JS/TS files with Unicorn, Prettier, JSDoc, and TypeScript-specific adjustments. |
62
+ | `react` | Adds React/JSX/TSX rules and React Hooks best practices. |
63
+ | `json` | Enforces JSON, JSON5, JSONC, and `package.json` best practices including property ordering and required fields. |
64
+ | `markdown` | Lints Markdown files and code blocks within them. |
65
+ | `cspell` | Integrates with Code Spell Checker for detecting typos in code and text. |
66
+ | `prettier` | Ensures Prettier formatting rules are applied consistently. |
67
+ | `recommended` | Combines ignores, JS/TS, JSON, Markdown, Prettier, and cspell for a full setup. |
68
+ | `recommended-astro` | Recommended setup including Astro support. |
69
+ | `recommended-react` | Recommended setup including React support. |
70
+ | `recommended-no-spellcheck` | Recommended setup without cspell. |
71
+ | `recommended-no-spellcheck-astro` | Recommended setup for Astro without cspell. |
72
+ | `recommended-no-spellcheck-react` | Recommended setup for React without cspell. |
73
+
74
+ ---
75
+
76
+ ## Usage Examples
77
+
78
+ ### JavaScript / TypeScript
79
+
80
+ ```js
81
+ // eslint.config.js
82
+ import spellbookx from 'eslint-plugin-spellbookx';
83
+
84
+ export default [...spellbookx.configs.recommended];
85
+ ```
86
+
87
+ ### React / TSX
88
+
89
+ ```js
90
+ import spellbookx from 'eslint-plugin-spellbookx';
91
+
92
+ export default [...spellbookx.configs['recommended-react']];
93
+ ```
94
+
95
+ ### Astro / React / TSX
96
+
97
+ ```js
98
+ import spellbookx from 'eslint-plugin-spellbookx';
99
+
100
+ export default [...spellbookx.configs['recommended-astro']];
101
+ ```
102
+
103
+ ### JSON / Package Files
104
+
105
+ ```js
106
+ import spellbookx from 'eslint-plugin-spellbookx';
107
+
108
+ export default [...spellbookx.configs.json];
109
+ ```
110
+
111
+ ### Markdown with Embedded Code
112
+
113
+ ```js
114
+ import spellbookx from 'eslint-plugin-spellbookx';
115
+
116
+ export default [...spellbookx.configs.markdown];
117
+ ```
118
+
119
+ ### Disabling Spell Checker
120
+
121
+ ```js
122
+ import spellbookx from 'eslint-plugin-spellbookx';
123
+
124
+ export default [...spellbookx.configs['recommended-no-spellcheck']];
125
+ ```
126
+
127
+ ```js
128
+ import spellbookx from 'eslint-plugin-spellbookx';
129
+
130
+ export default [...spellbookx.configs['recommended-no-spellcheck-astro']];
131
+ ```
132
+
133
+ ```js
134
+ import spellbookx from 'eslint-plugin-spellbookx';
135
+
136
+ export default [...spellbookx.configs['recommended-no-spellcheck-react']];
137
+ ```
138
+
139
+ ---
140
+
141
+ ## Rules Explanation
142
+
143
+ ### TypeScript-Specific
144
+
145
+ - **`@typescript-eslint/no-unused-vars`**: Replaces ESLint's default `no-unused-vars` to understand TypeScript constructs like interfaces, enums, and types. Variables prefixed with `_` are ignored.
146
+ - **`@typescript-eslint/quotes` & `@typescript-eslint/semi`**: Disabled to defer to Prettier for formatting consistency.
147
+
148
+ ### Unicorn Rules
149
+
150
+ - Enforces consistent filename casing (`kebab-case`).
151
+ - Prefers modern safe methods (`Buffer.from`, `Array.includes`, `String.replaceAll`, `TypeError`).
152
+ - Prevents unsafe patterns like `instanceof Array` or manual `new Error()` without a proper type.
153
+ - `no-null` and `prevent-abbreviations` are disabled to allow flexibility.
154
+ - Explicit length checks are warned, not enforced.
155
+
156
+ ### JSDoc
157
+
158
+ - Encourages documentation for functions, classes, and methods.
159
+ - Enforces descriptions for all significant code structures.
160
+
161
+ ### Prettier
162
+
163
+ - Ensures consistent formatting across JS/TS, JSON, Markdown, and React code.
164
+
165
+ ### Import Sorting
166
+
167
+ Uses `eslint-plugin-simple-import-sort` for structured, deterministic import ordering:
168
+
169
+ 1. Environment variables (`dotenv`, `@dotenvx/dotenvx`)
170
+ 2. Side-effect imports
171
+ 3. Node built-ins
172
+ 4. React core and ecosystem
173
+ 5. Backend frameworks and middlewares
174
+ 6. State management, data-fetching, GraphQL clients
175
+ 7. Generic third-party libraries
176
+ 8. UI libraries and icon packs
177
+ 9. Relative imports
178
+ 10. Styles, assets, and media
179
+
180
+ This promotes readability, predictable structure, and clear separation between layers of the project.
181
+
182
+ ---
183
+
184
+ ## License
185
+
186
+ This project is licensed under the MIT License.
187
+
188
+ **Copyright (c) 2025 Davide Di Criscito**
189
+
190
+ For the full details, see the [LICENSE](LICENSE) file.
@@ -0,0 +1,4 @@
1
+ import type { Linter } from 'eslint';
2
+ declare const configAstro: Linter.Config[];
3
+ export default configAstro;
4
+ //# sourceMappingURL=astro.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"astro.d.ts","sourceRoot":"","sources":["../../src/configs/astro.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAkBrC,QAAA,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EA2D9B,CAAC;AAEH,eAAe,WAAW,CAAC"}
@@ -0,0 +1,73 @@
1
+ import astroParser from 'astro-eslint-parser';
2
+ import { defineConfig } from 'eslint/config';
3
+ import astro from 'eslint-plugin-astro';
4
+ import importPlugin from 'eslint-plugin-import';
5
+ import nodeDependencies from 'eslint-plugin-node-dependencies';
6
+ import prettierPlugin from 'eslint-plugin-prettier';
7
+ import simpleImportSort from 'eslint-plugin-simple-import-sort';
8
+ import unicorn from 'eslint-plugin-unicorn';
9
+ import globals from 'globals';
10
+ import tseslint from 'typescript-eslint';
11
+ import js from '@eslint/js';
12
+ import eslintReact from '@eslint-react/eslint-plugin';
13
+ import { jsRulesCommon } from '../shared-rules/js-common.js';
14
+ import { jsRulesImportsExports } from '../shared-rules/js-imports-exports.js';
15
+ import configIgnores from './ignores.js';
16
+ import configPrettier from './prettier.js';
17
+ const configAstro = defineConfig([
18
+ configIgnores,
19
+ // --- Astro ---
20
+ {
21
+ files: [
22
+ '*.astro',
23
+ '*.astro/*.js',
24
+ '*.astro/*.ts',
25
+ '*.astro/*.jsx',
26
+ '*.astro/*.tsx',
27
+ '**/*.astro',
28
+ '**/*.astro/*.js',
29
+ '**/*.astro/*.ts',
30
+ '**/*.astro/*.jsx',
31
+ '**/*.astro/*.tsx',
32
+ ],
33
+ plugins: {
34
+ import: importPlugin,
35
+ prettier: prettierPlugin,
36
+ 'simple-import-sort': simpleImportSort,
37
+ astro,
38
+ },
39
+ extends: [
40
+ js.configs.recommended,
41
+ ...tseslint.configs.recommended,
42
+ eslintReact.configs['recommended-typescript'],
43
+ nodeDependencies.configs['flat/recommended'],
44
+ unicorn.configs.recommended,
45
+ astro.configs['flat/all'],
46
+ ],
47
+ languageOptions: {
48
+ sourceType: 'module',
49
+ globals: {
50
+ ...globals.node,
51
+ ...globals.browser,
52
+ ...globals.es2022,
53
+ },
54
+ parser: astroParser,
55
+ parserOptions: {
56
+ parser: tseslint.parser,
57
+ tsconfigRootDir: import.meta.dirname,
58
+ },
59
+ },
60
+ rules: {
61
+ // Common rules
62
+ ...jsRulesCommon,
63
+ ...jsRulesImportsExports,
64
+ // Unicorn
65
+ 'unicorn/filename-case': 'off',
66
+ // Prettier
67
+ 'prettier/prettier': 'error',
68
+ },
69
+ },
70
+ // --- Prettier ---
71
+ configPrettier,
72
+ ]);
73
+ export default configAstro;
@@ -0,0 +1,4 @@
1
+ import type { Linter } from 'eslint';
2
+ declare const configCSpell: Linter.Config[];
3
+ export default configCSpell;
4
+ //# sourceMappingURL=cspell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cspell.d.ts","sourceRoot":"","sources":["../../src/configs/cspell.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAOrC,QAAA,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAI/B,CAAC;AAEH,eAAe,YAAY,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { defineConfig } from 'eslint/config';
2
+ import cspell from '@cspell/eslint-plugin/configs';
3
+ import configIgnores from './ignores.js';
4
+ import configPrettier from './prettier.js';
5
+ const configCSpell = defineConfig([
6
+ configIgnores,
7
+ cspell.recommended,
8
+ configPrettier,
9
+ ]);
10
+ export default configCSpell;
@@ -0,0 +1,4 @@
1
+ import type { Linter } from 'eslint';
2
+ declare const configIgnores: Linter.Config[];
3
+ export default configIgnores;
4
+ //# sourceMappingURL=ignores.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ignores.d.ts","sourceRoot":"","sources":["../../src/configs/ignores.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,QAAA,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EA0FhC,CAAC;AAEH,eAAe,aAAa,CAAC"}
@@ -0,0 +1,88 @@
1
+ import { defineConfig, globalIgnores } from 'eslint/config';
2
+ const configIgnores = defineConfig([
3
+ globalIgnores([
4
+ // Node / JS / TS build & lock files
5
+ '**/node_modules/**',
6
+ '**/dist/**',
7
+ '**/build/**',
8
+ '**/out/**',
9
+ '**/out-tsc/**',
10
+ '**/coverage/**',
11
+ '**/.astro/**',
12
+ '**/.next/**',
13
+ '**/.nuxt/**',
14
+ '**/.svelte-kit/**',
15
+ '**/.turbo/**',
16
+ '**/.pnpm/**',
17
+ '**/.npm/**',
18
+ '**/.yarn/**',
19
+ '**/.pnp/**',
20
+ '**/package-lock.json',
21
+ '**/pnpm-lock.yaml',
22
+ '**/yarn.lock',
23
+ '**/bun.lockb',
24
+ // Python environments and cache
25
+ '**/__pycache__/**',
26
+ '**/*.pyc',
27
+ '**/*.pyo',
28
+ '**/.mypy_cache/**',
29
+ '**/.pytest_cache/**',
30
+ '**/.tox/**',
31
+ '**/.ruff_cache/**',
32
+ '**/.venv/**',
33
+ '**/venv/**',
34
+ '**/env/**',
35
+ '**/.ipynb_checkpoints/**',
36
+ // Rust build artifacts
37
+ '**/target/**',
38
+ '**/.cargo/**',
39
+ '**/Cargo.lock',
40
+ // Go dependencies and cache
41
+ '**/go.sum',
42
+ '**/go.work',
43
+ '**/go.work.sum',
44
+ '**/vendor/**',
45
+ '**/.gopath/**',
46
+ '**/.cache/go-build/**',
47
+ // Miscellaneous project artifacts
48
+ '**/*LICENSE*',
49
+ '**/*.log',
50
+ '**/.cache/**',
51
+ '**/.temp/**',
52
+ '**/.tmp/**',
53
+ '**/.DS_Store',
54
+ '**/.idea/**',
55
+ '**/.vscode/**',
56
+ '**/.nx/**',
57
+ '**/.cspell/**',
58
+ '**/.cursor/**',
59
+ '**/.history/**',
60
+ '**/.terraform/**',
61
+ '**/.devcontainer/**',
62
+ '**/.direnv/**',
63
+ '**/.editorconfig',
64
+ '**/.eslintcache',
65
+ '**/.babelrc',
66
+ '**/.prettier*',
67
+ '**/.sass-cache/**',
68
+ '**/.gradle/**',
69
+ '**/.docker/**',
70
+ '**/.kube/**',
71
+ '**/.git/**',
72
+ '**/.svn/**',
73
+ '**/.hg/**',
74
+ '**/.gemini/**',
75
+ '**/.codacy/**',
76
+ '.github/instructions/**',
77
+ // Windows system artifacts
78
+ '**/*:Zone.Identifier',
79
+ '**/Thumbs.db',
80
+ '**/desktop.ini',
81
+ '**/$RECYCLE.BIN/**',
82
+ '**/System Volume Information/**',
83
+ '**/pagefile.sys',
84
+ '**/swapfile.sys',
85
+ '**/hiberfil.sys',
86
+ ]),
87
+ ]);
88
+ export default configIgnores;
@@ -0,0 +1,15 @@
1
+ export { default as configAstro } from './astro.js';
2
+ export { default as configCSpell } from './cspell.js';
3
+ export { default as configIgnores } from './ignores.js';
4
+ export { default as configJavascript } from './javascript.js';
5
+ export { default as configJson } from './json.js';
6
+ export { default as configMarkdown } from './markdown.js';
7
+ export { default as configPrettier } from './prettier.js';
8
+ export { default as configReact } from './react.js';
9
+ export { default as configRecommendedAstro } from './recommended/astro.js';
10
+ export { default as configRecommendedNoSpellCheck } from './recommended/no-spellcheck.js';
11
+ export { default as configRecommendedNoSpellCheckAstro } from './recommended/no-spellcheck-astro.js';
12
+ export { default as configRecommendedNoSpellCheckReact } from './recommended/no-spellcheck-react.js';
13
+ export { default as configRecommendedReact } from './recommended/react.js';
14
+ export { default as configRecommended } from './recommended/recommended.js';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/configs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AACrG,OAAO,EAAE,OAAO,IAAI,kCAAkC,EAAE,MAAM,sCAAsC,CAAC;AACrG,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,14 @@
1
+ export { default as configAstro } from './astro.js';
2
+ export { default as configCSpell } from './cspell.js';
3
+ export { default as configIgnores } from './ignores.js';
4
+ export { default as configJavascript } from './javascript.js';
5
+ export { default as configJson } from './json.js';
6
+ export { default as configMarkdown } from './markdown.js';
7
+ export { default as configPrettier } from './prettier.js';
8
+ export { default as configReact } from './react.js';
9
+ export { default as configRecommendedAstro } from './recommended/astro.js';
10
+ export { default as configRecommendedNoSpellCheck } from './recommended/no-spellcheck.js';
11
+ export { default as configRecommendedNoSpellCheckAstro } from './recommended/no-spellcheck-astro.js';
12
+ export { default as configRecommendedNoSpellCheckReact } from './recommended/no-spellcheck-react.js';
13
+ export { default as configRecommendedReact } from './recommended/react.js';
14
+ export { default as configRecommended } from './recommended/recommended.js';
@@ -0,0 +1,4 @@
1
+ import type { Linter } from 'eslint';
2
+ declare const configJavascript: Linter.Config[];
3
+ export default configJavascript;
4
+ //# sourceMappingURL=javascript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"javascript.d.ts","sourceRoot":"","sources":["../../src/configs/javascript.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAkBrC,QAAA,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAmEnC,CAAC;AAEH,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,79 @@
1
+ import { defineConfig } from 'eslint/config';
2
+ import importPlugin from 'eslint-plugin-import';
3
+ import jsdoc from 'eslint-plugin-jsdoc';
4
+ import nodeDependencies from 'eslint-plugin-node-dependencies';
5
+ import prettierPlugin from 'eslint-plugin-prettier';
6
+ import simpleImportSort from 'eslint-plugin-simple-import-sort';
7
+ import unicorn from 'eslint-plugin-unicorn';
8
+ import globals from 'globals';
9
+ import tseslint from 'typescript-eslint';
10
+ import js from '@eslint/js';
11
+ import { jsRulesCommon } from '../shared-rules/js-common.js';
12
+ import { jsRulesImportsExports } from '../shared-rules/js-imports-exports.js';
13
+ import { jsDocRules } from '../shared-rules/jsdoc.js';
14
+ import configIgnores from './ignores.js';
15
+ import configPrettier from './prettier.js';
16
+ const configJavascript = defineConfig([
17
+ configIgnores,
18
+ // --- Js/Ts base ---
19
+ {
20
+ files: ['**/*.{js,ts,cjs,cts,mjs,mts}'],
21
+ plugins: {
22
+ jsdoc,
23
+ import: importPlugin,
24
+ prettier: prettierPlugin,
25
+ 'simple-import-sort': simpleImportSort,
26
+ },
27
+ extends: [
28
+ js.configs.recommended,
29
+ ...tseslint.configs.recommended,
30
+ nodeDependencies.configs['flat/recommended'],
31
+ unicorn.configs.recommended,
32
+ jsdoc.configs['flat/contents-typescript-flavor'],
33
+ jsdoc.configs['flat/logical-typescript-flavor'],
34
+ jsdoc.configs['flat/requirements-typescript-flavor'],
35
+ jsdoc.configs['flat/stylistic-typescript-flavor'],
36
+ ],
37
+ languageOptions: {
38
+ globals: {
39
+ ...globals.node,
40
+ ...globals.browser,
41
+ },
42
+ },
43
+ rules: {
44
+ ...jsRulesCommon,
45
+ ...jsDocRules,
46
+ ...jsRulesImportsExports,
47
+ },
48
+ },
49
+ // --- CommonJS specifics ---
50
+ {
51
+ files: ['**/*.{cjs,cts}', '**/webpack.config.{js,cjs}'],
52
+ languageOptions: {
53
+ globals: { ...globals.commonjs },
54
+ },
55
+ rules: {
56
+ '@typescript-eslint/no-require-imports': 'off',
57
+ 'unicorn/prefer-module': 'off',
58
+ },
59
+ },
60
+ // --- Module specifics ---
61
+ {
62
+ files: ['**/*.{js,ts,mjs,mts}'],
63
+ languageOptions: {
64
+ sourceType: 'module',
65
+ globals: { ...globals.es2022 },
66
+ },
67
+ },
68
+ // --- Test files ---
69
+ {
70
+ files: ['**/*.test.{js,ts}', '**/*.spec.{js,ts}'],
71
+ rules: {
72
+ 'no-console': 'off',
73
+ '@typescript-eslint/no-unused-vars': 'warn',
74
+ 'unicorn/no-null': 'warn',
75
+ },
76
+ },
77
+ configPrettier,
78
+ ]);
79
+ export default configJavascript;
@@ -0,0 +1,4 @@
1
+ import { type Linter } from 'eslint';
2
+ declare const configJson: Linter.Config[];
3
+ export default configJson;
4
+ //# sourceMappingURL=json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/configs/json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AASlD,QAAA,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAmD7B,CAAC;AAEH,eAAe,UAAU,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { defineConfig } from 'eslint/config';
2
+ import packageJson from 'eslint-plugin-package-json';
3
+ import jsoncParser from 'jsonc-eslint-parser';
4
+ import json from '@eslint/json';
5
+ import configIgnores from './ignores.js';
6
+ import configPrettier from './prettier.js';
7
+ const configJson = defineConfig([
8
+ configIgnores,
9
+ {
10
+ files: ['**/*.json'],
11
+ plugins: { json: json },
12
+ language: 'json/json',
13
+ extends: ['json/recommended'],
14
+ languageOptions: { parser: jsoncParser },
15
+ rules: {
16
+ 'prettier/prettier': 'off',
17
+ },
18
+ },
19
+ {
20
+ files: ['**/*.json5'],
21
+ plugins: { json: json },
22
+ language: 'json/json5',
23
+ extends: ['json/recommended'],
24
+ languageOptions: { parser: jsoncParser },
25
+ },
26
+ {
27
+ files: ['**/*.jsonc', '**/tsconfig*.json', '**/.vscode/**/*.json'],
28
+ plugins: { json: json },
29
+ language: 'json/jsonc',
30
+ extends: ['json/recommended'],
31
+ languageOptions: { parser: jsoncParser },
32
+ },
33
+ {
34
+ files: ['**/package.json'],
35
+ plugins: { json: json, 'package-json': packageJson },
36
+ language: 'json/json',
37
+ extends: [packageJson.configs.recommended],
38
+ languageOptions: { parser: jsoncParser },
39
+ rules: {
40
+ 'package-json/order-properties': 'error',
41
+ 'package-json/sort-collections': 'error',
42
+ 'package-json/require-description': 'error',
43
+ 'package-json/require-bugs': 'error',
44
+ 'package-json/require-keywords': 'error',
45
+ 'package-json/require-name': 'error',
46
+ 'package-json/require-version': 'error',
47
+ 'package-json/valid-description': 'error',
48
+ 'package-json/valid-license': 'error',
49
+ 'package-json/valid-name': 'error',
50
+ 'package-json/valid-package-definition': 'error',
51
+ 'package-json/valid-version': 'error',
52
+ 'prettier/prettier': 'off',
53
+ },
54
+ },
55
+ configPrettier,
56
+ ]);
57
+ export default configJson;
@@ -0,0 +1,4 @@
1
+ import { type Linter } from 'eslint';
2
+ declare const configMarkdown: Linter.Config[];
3
+ export default configMarkdown;
4
+ //# sourceMappingURL=markdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/configs/markdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AASlD,QAAA,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAejC,CAAC;AAEH,eAAe,cAAc,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { defineConfig } from 'eslint/config';
2
+ import markdown from '@eslint/markdown';
3
+ import { jsRulesCommon } from '../shared-rules/js-common.js';
4
+ import { jsRulesImportsExports } from '../shared-rules/js-imports-exports.js';
5
+ import configIgnores from './ignores.js';
6
+ import configPrettier from './prettier.js';
7
+ const configMarkdown = defineConfig([
8
+ configIgnores,
9
+ {
10
+ files: ['**/*.md'],
11
+ plugins: { markdown: markdown },
12
+ language: 'markdown/gfm',
13
+ extends: ['markdown/recommended'],
14
+ },
15
+ {
16
+ files: ['**/*.md/*.js', '**/*.md/*.ts', '**/*.md/*.jsx', '**/*.md/*.tsx'],
17
+ rules: { ...jsRulesCommon, ...jsRulesImportsExports },
18
+ },
19
+ configPrettier,
20
+ ]);
21
+ export default configMarkdown;
@@ -0,0 +1,4 @@
1
+ import type { Linter } from 'eslint';
2
+ declare const configPrettier: Linter.Config[];
3
+ export default configPrettier;
4
+ //# sourceMappingURL=prettier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prettier.d.ts","sourceRoot":"","sources":["../../src/configs/prettier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAKrC,QAAA,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAejC,CAAC;AAEH,eAAe,cAAc,CAAC"}