eslint-plugin-spellbookx 0.3.3 → 0.7.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 (88) hide show
  1. package/.turbo/turbo-build.log +12 -0
  2. package/LICENSE +1 -1
  3. package/README.md +11 -52
  4. package/dist/configs/cspell.d.ts +2 -3
  5. package/dist/configs/cspell.d.ts.map +1 -1
  6. package/dist/configs/javascript.d.ts +1 -2
  7. package/dist/configs/javascript.d.ts.map +1 -1
  8. package/dist/configs/json.d.ts +2 -3
  9. package/dist/configs/json.d.ts.map +1 -1
  10. package/dist/configs/markdown.d.ts +2 -3
  11. package/dist/configs/markdown.d.ts.map +1 -1
  12. package/dist/configs/recommended.d.ts +3 -0
  13. package/dist/configs/recommended.d.ts.map +1 -0
  14. package/dist/configs/vuoto.d.ts +3 -0
  15. package/dist/configs/vuoto.d.ts.map +1 -0
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +484 -43
  19. package/dist/types.d.ts +1 -1
  20. package/dist/types.d.ts.map +1 -1
  21. package/dist/types.js +10 -1
  22. package/package.json +27 -33
  23. package/rolldown.config.ts +31 -0
  24. package/src/configs/cspell.ts +9 -0
  25. package/src/configs/ignores.ts +96 -0
  26. package/src/configs/javascript.ts +322 -0
  27. package/src/configs/json.ts +57 -0
  28. package/src/configs/markdown.ts +15 -0
  29. package/src/configs/recommended.ts +20 -0
  30. package/src/configs/vuoto.ts +12 -0
  31. package/{dist/helpers.js → src/helpers.ts} +6 -1
  32. package/src/index.ts +38 -0
  33. package/src/types.ts +8 -0
  34. package/tsconfig.json +10 -0
  35. package/dist/configs/astro.d.ts +0 -4
  36. package/dist/configs/astro.d.ts.map +0 -1
  37. package/dist/configs/astro.js +0 -67
  38. package/dist/configs/cspell.js +0 -10
  39. package/dist/configs/ignores.js +0 -88
  40. package/dist/configs/index.d.ts +0 -15
  41. package/dist/configs/index.d.ts.map +0 -1
  42. package/dist/configs/index.js +0 -14
  43. package/dist/configs/javascript.js +0 -79
  44. package/dist/configs/json.js +0 -57
  45. package/dist/configs/markdown.js +0 -21
  46. package/dist/configs/prettier.d.ts +0 -4
  47. package/dist/configs/prettier.d.ts.map +0 -1
  48. package/dist/configs/prettier.js +0 -19
  49. package/dist/configs/react.d.ts +0 -4
  50. package/dist/configs/react.d.ts.map +0 -1
  51. package/dist/configs/react.js +0 -61
  52. package/dist/configs/recommended/astro.d.ts +0 -4
  53. package/dist/configs/recommended/astro.d.ts.map +0 -1
  54. package/dist/configs/recommended/astro.js +0 -18
  55. package/dist/configs/recommended/index.d.ts +0 -7
  56. package/dist/configs/recommended/index.d.ts.map +0 -1
  57. package/dist/configs/recommended/index.js +0 -6
  58. package/dist/configs/recommended/no-spellcheck-astro.d.ts +0 -4
  59. package/dist/configs/recommended/no-spellcheck-astro.d.ts.map +0 -1
  60. package/dist/configs/recommended/no-spellcheck-astro.js +0 -16
  61. package/dist/configs/recommended/no-spellcheck-react.d.ts +0 -4
  62. package/dist/configs/recommended/no-spellcheck-react.d.ts.map +0 -1
  63. package/dist/configs/recommended/no-spellcheck-react.js +0 -14
  64. package/dist/configs/recommended/no-spellcheck.d.ts +0 -4
  65. package/dist/configs/recommended/no-spellcheck.d.ts.map +0 -1
  66. package/dist/configs/recommended/no-spellcheck.js +0 -14
  67. package/dist/configs/recommended/react.d.ts +0 -4
  68. package/dist/configs/recommended/react.d.ts.map +0 -1
  69. package/dist/configs/recommended/react.js +0 -16
  70. package/dist/configs/recommended/recommended.d.ts +0 -4
  71. package/dist/configs/recommended/recommended.d.ts.map +0 -1
  72. package/dist/configs/recommended/recommended.js +0 -22
  73. package/dist/dependencies.d.ts +0 -3
  74. package/dist/dependencies.d.ts.map +0 -1
  75. package/dist/dependencies.js +0 -4
  76. package/dist/shared-rules/index.d.ts +0 -4
  77. package/dist/shared-rules/index.d.ts.map +0 -1
  78. package/dist/shared-rules/index.js +0 -3
  79. package/dist/shared-rules/js-common.d.ts +0 -25
  80. package/dist/shared-rules/js-common.d.ts.map +0 -1
  81. package/dist/shared-rules/js-common.js +0 -50
  82. package/dist/shared-rules/js-imports-exports.d.ts +0 -16
  83. package/dist/shared-rules/js-imports-exports.d.ts.map +0 -1
  84. package/dist/shared-rules/js-imports-exports.js +0 -191
  85. package/dist/shared-rules/jsdoc.d.ts +0 -23
  86. package/dist/shared-rules/jsdoc.d.ts.map +0 -1
  87. package/dist/shared-rules/jsdoc.js +0 -62
  88. package/dist/tsconfig.lib.tsbuildinfo +0 -1
@@ -0,0 +1,9 @@
1
+ import { Linter } from 'eslint';
2
+ import { defineConfig } from 'eslint/config';
3
+ import prettierRecommended from 'eslint-plugin-prettier/recommended';
4
+ import cspell from '@cspell/eslint-plugin/configs';
5
+
6
+ export const configCspell: Linter.Config[] = defineConfig([
7
+ cspell.recommended,
8
+ prettierRecommended,
9
+ ]);
@@ -0,0 +1,96 @@
1
+ import type { Linter } from 'eslint';
2
+ import { defineConfig, globalIgnores } from 'eslint/config';
3
+
4
+ const configIgnores: Linter.Config[] = defineConfig([
5
+ globalIgnores([
6
+ // Node / JS / TS build & lock files
7
+ '**/node_modules/**',
8
+ '**/dist/**',
9
+ '**/build/**',
10
+ '**/out/**',
11
+ '**/out-tsc/**',
12
+ '**/coverage/**',
13
+ '**/.astro/**',
14
+ '**/.next/**',
15
+ '**/.nuxt/**',
16
+ '**/.svelte-kit/**',
17
+ '**/.turbo/**',
18
+ '**/.pnpm/**',
19
+ '**/.npm/**',
20
+ '**/.yarn/**',
21
+ '**/.pnp/**',
22
+ '**/package-lock.json',
23
+ '**/pnpm-lock.yaml',
24
+ '**/yarn.lock',
25
+ '**/bun.lockb',
26
+
27
+ // Python environments and cache
28
+ '**/__pycache__/**',
29
+ '**/*.pyc',
30
+ '**/*.pyo',
31
+ '**/.mypy_cache/**',
32
+ '**/.pytest_cache/**',
33
+ '**/.tox/**',
34
+ '**/.ruff_cache/**',
35
+ '**/.venv/**',
36
+ '**/venv/**',
37
+ '**/env/**',
38
+ '**/.ipynb_checkpoints/**',
39
+
40
+ // Rust build artifacts
41
+ '**/target/**',
42
+ '**/.cargo/**',
43
+ '**/Cargo.lock',
44
+
45
+ // Go dependencies and cache
46
+ '**/go.sum',
47
+ '**/go.work',
48
+ '**/go.work.sum',
49
+ '**/vendor/**',
50
+ '**/.gopath/**',
51
+ '**/.cache/go-build/**',
52
+
53
+ // Miscellaneous project artifacts
54
+ '**/*LICENSE*',
55
+ '**/*.log',
56
+ '**/.cache/**',
57
+ '**/.temp/**',
58
+ '**/.tmp/**',
59
+ '**/.DS_Store',
60
+ '**/.idea/**',
61
+ '**/.vscode/**',
62
+ '**/.nx/**',
63
+ '**/.cspell/**',
64
+ '**/.cursor/**',
65
+ '**/.history/**',
66
+ '**/.terraform/**',
67
+ '**/.devcontainer/**',
68
+ '**/.direnv/**',
69
+ '**/.editorconfig',
70
+ '**/.eslintcache',
71
+ '**/.babelrc',
72
+ '**/.prettier*',
73
+ '**/.sass-cache/**',
74
+ '**/.gradle/**',
75
+ '**/.docker/**',
76
+ '**/.kube/**',
77
+ '**/.git/**',
78
+ '**/.svn/**',
79
+ '**/.hg/**',
80
+ '**/.gemini/**',
81
+ '**/.codacy/**',
82
+ '.github/instructions/**',
83
+
84
+ // Windows system artifacts
85
+ '**/*:Zone.Identifier',
86
+ '**/Thumbs.db',
87
+ '**/desktop.ini',
88
+ '**/$RECYCLE.BIN/**',
89
+ '**/System Volume Information/**',
90
+ '**/pagefile.sys',
91
+ '**/swapfile.sys',
92
+ '**/hiberfil.sys',
93
+ ]),
94
+ ]);
95
+
96
+ export default configIgnores;
@@ -0,0 +1,322 @@
1
+ import type { Linter } from 'eslint';
2
+ import { defineConfig } from 'eslint/config';
3
+ import importPlugin from 'eslint-plugin-import';
4
+ import jsdoc from 'eslint-plugin-jsdoc';
5
+ import nodeDependencies from 'eslint-plugin-node-dependencies';
6
+ import prettierPlugin from 'eslint-plugin-prettier';
7
+ import prettierRecommended from 'eslint-plugin-prettier/recommended';
8
+ import simpleImportSort from 'eslint-plugin-simple-import-sort';
9
+ import unicorn from 'eslint-plugin-unicorn';
10
+ import globals from 'globals';
11
+ import tseslint from 'typescript-eslint';
12
+ import js from '@eslint/js';
13
+ import eslintReact from '@eslint-react/eslint-plugin';
14
+
15
+ export const configJavascript: Linter.Config[] = defineConfig([
16
+ // --- Common for JS/TS/JSX/TSX ---
17
+ {
18
+ files: ['**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}'],
19
+ plugins: {
20
+ jsdoc,
21
+ import: importPlugin,
22
+ prettier: prettierPlugin,
23
+ 'simple-import-sort': simpleImportSort,
24
+ },
25
+ extends: [
26
+ js.configs.recommended,
27
+ ...tseslint.configs.recommended,
28
+ unicorn.configs.recommended,
29
+ ],
30
+ rules: {
31
+ 'prettier/prettier': 'error',
32
+ 'no-unused-vars': 'off',
33
+ '@typescript-eslint/no-unused-vars': [
34
+ 'error',
35
+ { argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
36
+ ],
37
+
38
+ // Enforce structured and grouped imports using simple-import-sort
39
+ 'sort-imports': 'off',
40
+ 'simple-import-sort/exports': 'error',
41
+ 'simple-import-sort/imports': [
42
+ 'error',
43
+ {
44
+ groups: [
45
+ // dotenv & dotenvx packages
46
+ ['^@dotenvx/dotenvx', '^dotenv'],
47
+
48
+ // Side-effect imports (e.g. polyfills)
49
+ [String.raw`^\u0000`],
50
+
51
+ // Env imports for React Native, Expo, etc.
52
+ ['^@env'],
53
+
54
+ // Node.js built-in modules
55
+ [
56
+ '^assert',
57
+ '^buffer',
58
+ '^child_process',
59
+ '^cluster',
60
+ '^console',
61
+ '^constants',
62
+ '^crypto',
63
+ '^dgram',
64
+ '^dns',
65
+ '^domain',
66
+ '^events',
67
+ '^fs',
68
+ '^http',
69
+ '^https',
70
+ '^inspector',
71
+ '^module',
72
+ '^net',
73
+ '^os',
74
+ '^path',
75
+ '^perf_hooks',
76
+ '^process',
77
+ '^punycode',
78
+ '^querystring',
79
+ '^readline',
80
+ '^repl',
81
+ '^stream',
82
+ '^string_decoder',
83
+ '^timers',
84
+ '^tls',
85
+ '^tty',
86
+ '^url',
87
+ '^util',
88
+ '^v8',
89
+ '^vm',
90
+ '^zlib',
91
+ ],
92
+
93
+ // Node.js built-in modules #2
94
+ ['^node:'],
95
+
96
+ // Node.js backend frameworks
97
+ [
98
+ '^@fastify',
99
+ '^@hapi/hapi',
100
+ '^@koa/koa',
101
+ '^@nestjs',
102
+ '^express',
103
+ '^fastify',
104
+ '^hapi',
105
+ '^koa',
106
+ '^loopback',
107
+ '^nest',
108
+ '^sails',
109
+ ],
110
+
111
+ // Node.js backend middlewares & utilities
112
+ [
113
+ '^body-parser',
114
+ '^connect-redis',
115
+ '^cookie-parser',
116
+ '^cors',
117
+ '^express-rate-limit',
118
+ '^express-session',
119
+ '^helmet',
120
+ '^morgan',
121
+ '^passport',
122
+ String.raw`^pino-`,
123
+ '^redis',
124
+ '^winston',
125
+ ],
126
+
127
+ // UI Frameworks (React, Vue, Svelte, etc.)
128
+ ['^@angular', '^react', '^solid-js', '^svelte', '^vue'],
129
+
130
+ // React specific packages
131
+ [
132
+ '^@tanstack/router',
133
+ '^react-dom',
134
+ '^react-helmet',
135
+ '^react-intl',
136
+ '^react-router',
137
+ '^react-router-dom',
138
+ ],
139
+
140
+ // Full-stack/SSR frameworks (Next.js, Remix, etc.)
141
+ ['^@nuxt/kit', '^@remix-run', '^@sveltejs/kit', '^gatsby', '^next'],
142
+
143
+ // React Native & Expo
144
+ [
145
+ '^@expo',
146
+ String.raw`^@expo\/`,
147
+ '^@react-native',
148
+ '^expo',
149
+ String.raw`^expo-`,
150
+ '^react-native',
151
+ '^react-navigation',
152
+ ],
153
+
154
+ // State management libraries
155
+ [
156
+ '^@reduxjs/toolkit',
157
+ '^jotai',
158
+ '^mobx',
159
+ '^recoil',
160
+ '^redux',
161
+ '^valtio',
162
+ '^zustand',
163
+ ],
164
+
165
+ // Data-fetching libraries
166
+ [
167
+ '^@apollo/client',
168
+ '^@tanstack/react-query',
169
+ '^axios',
170
+ '^graphql',
171
+ '^swr',
172
+ ],
173
+
174
+ // UI libraries & design systems
175
+ [
176
+ '^@chakra-ui',
177
+ '^@headlessui/react',
178
+ '^@lottiefiles',
179
+ '^@material-ui',
180
+ '^@mui',
181
+ '^@nextui-org/react',
182
+ '^@radix-ui',
183
+ '^@pittorica/pitto',
184
+ '^radix-ui',
185
+ '^antd',
186
+ '^framer-motion',
187
+ '^native-base',
188
+ '^react-native-paper',
189
+ '^shadcn-ui',
190
+ '^tailwindcss',
191
+ ],
192
+
193
+ // CSS-in-JS & utility libraries
194
+ [
195
+ '^@emotion',
196
+ '^class-variance-authority',
197
+ '^clsx',
198
+ '^lucide-react',
199
+ '^styled-components',
200
+ '^tailwind-merge',
201
+ '^twin.macro',
202
+ '^tw-animate-css',
203
+ ],
204
+
205
+ // Common icon packages
206
+ [
207
+ String.raw`^@expo\/vector-icons`,
208
+ '^@fortawesome',
209
+ '^@tabler/icons-react',
210
+ '^lucide',
211
+ '^react-feather',
212
+ '^react-icons',
213
+ '^react-native-feather',
214
+ '^react-native-vector-icons',
215
+ ],
216
+
217
+ // Testing libraries and utilities
218
+ [
219
+ '^@testing-library',
220
+ '^cypress',
221
+ '^jest',
222
+ '^playwright',
223
+ '^vitest',
224
+ ],
225
+
226
+ // Generic third-party packages (npm scope and plain)
227
+ ['^[a-z]', String.raw`^@\w`],
228
+
229
+ // Monorepo/workspace scoped packages
230
+ ['@org/', '^@my-org/', '^@workspace/', '^@repo/'],
231
+
232
+ // Asset imports (images, fonts, etc.)
233
+ [
234
+ String.raw`^.+\.(avi|mkv|mov|mp4|webm)$`,
235
+ String.raw`^.+\.(mp3|ogg|wav|weba)$`,
236
+ String.raw`^.+\.(gif|jpe?g|png|svg|webp)$`,
237
+ String.raw`^.+\.lottie$`,
238
+ String.raw`^.+\.(eot|otf|ttf|woff|woff2)$`,
239
+ ],
240
+
241
+ // JSON files
242
+ [String.raw`^.+\.json$`],
243
+
244
+ // Stylesheets (css, scss, less, etc.)
245
+ [String.raw`^.+\.less$`, String.raw`^.+\.s?css$`],
246
+
247
+ // Relative imports (parent, sibling, current)
248
+ [String.raw`^\.?\.\/`],
249
+ ],
250
+ },
251
+ ],
252
+
253
+ 'unicorn/no-null': 'off',
254
+ 'unicorn/prevent-abbreviations': 'off',
255
+ },
256
+ },
257
+
258
+ // --- Node.js Specifics (TS/JS files) ---
259
+ {
260
+ files: ['**/*.{ts,js,mts,mjs,cts,cjs}'],
261
+ ignores: ['**/*.{tsx,jsx}'],
262
+ extends: [
263
+ nodeDependencies.configs['flat/recommended'],
264
+ jsdoc.configs['flat/contents-typescript-flavor'],
265
+ jsdoc.configs['flat/logical-typescript-flavor'],
266
+ ],
267
+ languageOptions: {
268
+ globals: { ...globals.node },
269
+ },
270
+ rules: {
271
+ 'unicorn/filename-case': ['error', { case: 'kebabCase' }],
272
+ 'jsdoc/require-jsdoc': [
273
+ 'warn',
274
+ {
275
+ require: {
276
+ FunctionDeclaration: true,
277
+ MethodDefinition: true,
278
+ ClassDeclaration: true,
279
+ },
280
+ },
281
+ ],
282
+ 'jsdoc/require-description': 'warn',
283
+ },
284
+ },
285
+
286
+ // --- React Specifics (TSX/JSX files) ---
287
+ {
288
+ files: ['**/*.{tsx,jsx}'],
289
+ extends: [eslintReact.configs['recommended-typescript']],
290
+ languageOptions: {
291
+ sourceType: 'module',
292
+ globals: { ...globals.browser, ...globals.es2022 },
293
+ parser: tseslint.parser,
294
+ parserOptions: {
295
+ projectService: true,
296
+ tsconfigRootDir: import.meta.dirname,
297
+ },
298
+ },
299
+ rules: {
300
+ // Filename case OFF for React components
301
+ 'unicorn/filename-case': 'off',
302
+ // JSDoc OFF for React components
303
+ 'jsdoc/require-jsdoc': 'off',
304
+ 'jsdoc/require-description': 'off',
305
+ 'jsdoc/require-param': 'off',
306
+ 'jsdoc/require-returns': 'off',
307
+ 'jsdoc/check-tag-names': 'off',
308
+ },
309
+ },
310
+
311
+ // --- CommonJS Overrides ---
312
+ {
313
+ files: ['**/*.{cjs,cts}'],
314
+ languageOptions: { globals: { ...globals.commonjs } },
315
+ rules: {
316
+ '@typescript-eslint/no-require-imports': 'off',
317
+ 'unicorn/prefer-module': 'off',
318
+ },
319
+ },
320
+
321
+ prettierRecommended,
322
+ ]);
@@ -0,0 +1,57 @@
1
+ import { Linter } from 'eslint';
2
+ import { defineConfig } from 'eslint/config';
3
+ import packageJson from 'eslint-plugin-package-json';
4
+ import prettierRecommended from 'eslint-plugin-prettier/recommended';
5
+ import jsoncParser from 'jsonc-eslint-parser';
6
+ import json from '@eslint/json';
7
+
8
+ export const configJson: Linter.Config[] = defineConfig([
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
+
56
+ prettierRecommended,
57
+ ]);
@@ -0,0 +1,15 @@
1
+ import { Linter } from 'eslint';
2
+ import { defineConfig } from 'eslint/config';
3
+ import prettierRecommended from 'eslint-plugin-prettier/recommended';
4
+ import markdown from '@eslint/markdown';
5
+
6
+ export const configMarkdown: Linter.Config[] = defineConfig([
7
+ {
8
+ files: ['**/*.md'],
9
+ plugins: { markdown: markdown },
10
+ language: 'markdown/gfm',
11
+ extends: ['markdown/recommended'],
12
+ },
13
+
14
+ prettierRecommended,
15
+ ]);
@@ -0,0 +1,20 @@
1
+ import { Linter } from 'eslint';
2
+ import { defineConfig } from 'eslint/config';
3
+ import prettierRecommended from 'eslint-plugin-prettier/recommended';
4
+
5
+ import { configCspell } from './cspell.js';
6
+ import configIgnores from './ignores.js';
7
+ import { configJavascript } from './javascript.js';
8
+ import { configJson } from './json.js';
9
+ import { configMarkdown } from './markdown.js';
10
+ import { configVuoto } from './vuoto.js';
11
+
12
+ export const configRecommended: Linter.Config[] = defineConfig([
13
+ configIgnores,
14
+ configJavascript,
15
+ configJson,
16
+ configMarkdown,
17
+ configVuoto,
18
+ configCspell,
19
+ prettierRecommended,
20
+ ]);
@@ -0,0 +1,12 @@
1
+ import type { Linter } from 'eslint';
2
+ import { defineConfig } from 'eslint/config';
3
+ import vuoto from 'eslint-plugin-vuoto';
4
+
5
+ export const configVuoto: Linter.Config[] = defineConfig([
6
+ {
7
+ plugins: {
8
+ vuoto,
9
+ },
10
+ },
11
+ vuoto.configs.all,
12
+ ]);
@@ -1,4 +1,9 @@
1
1
  import { readFileSync } from 'node:fs';
2
2
  import { fileURLToPath } from 'node:url';
3
+
3
4
  const packagePath = fileURLToPath(new URL('../package.json', import.meta.url));
4
- export const packageJson = JSON.parse(readFileSync(packagePath, 'utf8'));
5
+ export const packageJson = JSON.parse(readFileSync(packagePath, 'utf8')) as {
6
+ name: string;
7
+ version: string;
8
+ peerDependencies: Record<string, string>;
9
+ };
package/src/index.ts ADDED
@@ -0,0 +1,38 @@
1
+ import type { ESLint, Linter } from 'eslint';
2
+
3
+ import { configCspell } from './configs/cspell.js';
4
+ import configIgnores from './configs/ignores.js';
5
+ import { configJavascript } from './configs/javascript.js';
6
+ import { configJson } from './configs/json.js';
7
+ import { configMarkdown } from './configs/markdown.js';
8
+ import { configRecommended } from './configs/recommended.js';
9
+ import { configVuoto } from './configs/vuoto.js';
10
+ import { packageJson } from './helpers.js';
11
+ import { SbxESLintConfig } from './types.js';
12
+
13
+ const configs: Record<SbxESLintConfig, Linter.Config[]> = {
14
+ cspell: configCspell,
15
+ ignores: configIgnores,
16
+ javascript: configJavascript,
17
+ json: configJson,
18
+ markdown: configMarkdown,
19
+ recommended: configRecommended,
20
+ vuoto: configVuoto,
21
+ };
22
+
23
+ type Plugin = ESLint.Plugin & {
24
+ configs: typeof configs;
25
+ };
26
+
27
+ const plugin: Plugin = {
28
+ meta: {
29
+ name: packageJson.name,
30
+ version: packageJson.version,
31
+ namespace: 'spellbookx',
32
+ },
33
+ configs,
34
+ rules: {},
35
+ processors: {},
36
+ };
37
+
38
+ export default plugin;
package/src/types.ts ADDED
@@ -0,0 +1,8 @@
1
+ export type SbxESLintConfig =
2
+ | 'cspell'
3
+ | 'ignores'
4
+ | 'javascript'
5
+ | 'json'
6
+ | 'markdown'
7
+ | 'recommended'
8
+ | 'vuoto';
package/tsconfig.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "@spellbookx/typescript-config/base.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "rootDir": "./src",
6
+ "tsBuildInfoFile": "./dist/.tsbuildinfo"
7
+ },
8
+ "include": ["src/**/*"],
9
+ "exclude": ["node_modules", "**/*.test.ts"]
10
+ }
@@ -1,4 +0,0 @@
1
- import type { Linter } from 'eslint';
2
- declare const configAstro: Linter.Config[];
3
- export default configAstro;
4
- //# sourceMappingURL=astro.d.ts.map
@@ -1 +0,0 @@
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,EAqD9B,CAAC;AAEH,eAAe,WAAW,CAAC"}
@@ -1,67 +0,0 @@
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
- ],
28
- plugins: {
29
- import: importPlugin,
30
- prettier: prettierPlugin,
31
- 'simple-import-sort': simpleImportSort,
32
- },
33
- extends: [
34
- js.configs.recommended,
35
- ...tseslint.configs.recommended,
36
- ...astro.configs['flat/recommended'],
37
- eslintReact.configs['recommended-typescript'],
38
- nodeDependencies.configs['flat/recommended'],
39
- unicorn.configs.recommended,
40
- ],
41
- languageOptions: {
42
- sourceType: 'module',
43
- globals: {
44
- ...globals.node,
45
- ...globals.browser,
46
- ...globals.es2022,
47
- },
48
- parser: astroParser,
49
- parserOptions: {
50
- parser: tseslint.parser,
51
- tsconfigRootDir: import.meta.dirname,
52
- },
53
- },
54
- rules: {
55
- // Common rules
56
- ...jsRulesCommon,
57
- ...jsRulesImportsExports,
58
- // Unicorn
59
- 'unicorn/filename-case': 'off',
60
- // Prettier
61
- 'prettier/prettier': 'error',
62
- },
63
- },
64
- // --- Prettier ---
65
- configPrettier,
66
- ]);
67
- export default configAstro;