@santi020k/eslint-config-basic 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 (140) hide show
  1. package/.agent/rules/context.md +78 -0
  2. package/.agent/rules/guidelines.md +124 -0
  3. package/.editorconfig +13 -0
  4. package/.env.example +8 -0
  5. package/.github/CODEOWNERS +2 -0
  6. package/.github/DISCUSSION_TEMPLATE/rfcs.yml +21 -0
  7. package/.github/DISCUSSION_TEMPLATE/technical-discussions.yml +21 -0
  8. package/.github/FUNDING.yml +2 -0
  9. package/.github/ISSUE_TEMPLATE/README.md +13 -0
  10. package/.github/ISSUE_TEMPLATE/bug_report.yml +69 -0
  11. package/.github/ISSUE_TEMPLATE/config.yml +8 -0
  12. package/.github/ISSUE_TEMPLATE/feature_request.yml +43 -0
  13. package/.github/ISSUE_TEMPLATE/question.yml +22 -0
  14. package/.github/SECURITY.md +12 -0
  15. package/.github/SPONSORSHIPS.md +27 -0
  16. package/.github/dependabot.yml +45 -0
  17. package/.github/labeler.yml +46 -0
  18. package/.github/pull_request_template.md +56 -0
  19. package/.github/workflows/assign-issues.yml +18 -0
  20. package/.github/workflows/audit.yml +22 -0
  21. package/.github/workflows/build.yml +29 -0
  22. package/.github/workflows/codeql.yml +40 -0
  23. package/.github/workflows/docs.yml +49 -0
  24. package/.github/workflows/labeler.yml +18 -0
  25. package/.github/workflows/publish.yml +24 -0
  26. package/.github/workflows/release.yml +35 -0
  27. package/.github/workflows/size-check.yml +23 -0
  28. package/.github/workflows/stale.yml +31 -0
  29. package/.nvmrc +1 -0
  30. package/.vscode/extensions.json +10 -0
  31. package/.vscode/settings.json +55 -0
  32. package/CHANGELOG.md +16 -0
  33. package/CONTRIBUTING.md +194 -0
  34. package/DEVELOPMENT.md +4 -0
  35. package/LICENSE +21 -0
  36. package/README.md +275 -0
  37. package/config/.husky/commit-msg +9 -0
  38. package/config/.husky/pre-commit +1 -0
  39. package/config/.husky/pre-push +1 -0
  40. package/config/.husky/prepare-commit-msg +1 -0
  41. package/cspell.config.yaml +2 -0
  42. package/eslint.config.js +21 -0
  43. package/llms.txt +72 -0
  44. package/package.json +61 -0
  45. package/packages/astro/README.md +13 -0
  46. package/packages/astro/package.json +45 -0
  47. package/packages/astro/src/ambient.d.ts +10 -0
  48. package/packages/astro/src/index.ts +18 -0
  49. package/packages/astro/src/rules.ts +29 -0
  50. package/packages/astro/tsconfig.json +9 -0
  51. package/packages/astro/tsup.config.ts +11 -0
  52. package/packages/basic/README.md +33 -0
  53. package/packages/basic/package.json +55 -0
  54. package/packages/basic/src/index.ts +110 -0
  55. package/packages/basic/tsconfig.json +9 -0
  56. package/packages/basic/tsup.config.ts +18 -0
  57. package/packages/core/README.md +14 -0
  58. package/packages/core/index.ts +14 -0
  59. package/packages/core/package.json +61 -0
  60. package/packages/core/src/ambient.d.ts +61 -0
  61. package/packages/core/src/index.ts +75 -0
  62. package/packages/core/src/rules.ts +157 -0
  63. package/packages/core/src/settings/gitignore.ts +10 -0
  64. package/packages/core/src/settings/index.ts +1 -0
  65. package/packages/core/src/types.ts +57 -0
  66. package/packages/core/src/utils/index.ts +28 -0
  67. package/packages/core/tsconfig.json +9 -0
  68. package/packages/core/tsup.config.ts +10 -0
  69. package/packages/expo/README.md +13 -0
  70. package/packages/expo/package.json +48 -0
  71. package/packages/expo/src/ambient.d.ts +3 -0
  72. package/packages/expo/src/index.ts +39 -0
  73. package/packages/expo/tsconfig.json +9 -0
  74. package/packages/expo/tsup.config.ts +11 -0
  75. package/packages/nest/package.json +45 -0
  76. package/packages/nest/src/ambient.d.ts +14 -0
  77. package/packages/nest/src/index.ts +20 -0
  78. package/packages/nest/src/rules.ts +15 -0
  79. package/packages/nest/tsconfig.json +9 -0
  80. package/packages/nest/tsup.config.ts +11 -0
  81. package/packages/next/README.md +13 -0
  82. package/packages/next/package.json +47 -0
  83. package/packages/next/src/index.ts +31 -0
  84. package/packages/next/src/rules.ts +16 -0
  85. package/packages/next/tsconfig.json +9 -0
  86. package/packages/next/tsup.config.ts +10 -0
  87. package/packages/optionals/README.md +18 -0
  88. package/packages/optionals/package.json +55 -0
  89. package/packages/optionals/src/ambient.d.ts +25 -0
  90. package/packages/optionals/src/cspell.ts +14 -0
  91. package/packages/optionals/src/i18next.ts +19 -0
  92. package/packages/optionals/src/index.ts +8 -0
  93. package/packages/optionals/src/markdown.ts +66 -0
  94. package/packages/optionals/src/mdx.ts +40 -0
  95. package/packages/optionals/src/stencil.ts +48 -0
  96. package/packages/optionals/src/tailwind.ts +11 -0
  97. package/packages/optionals/src/vitest.ts +61 -0
  98. package/packages/optionals/tsconfig.json +9 -0
  99. package/packages/optionals/tsup.config.ts +11 -0
  100. package/packages/playground/README.md +14 -0
  101. package/packages/playground/package.json +17 -0
  102. package/packages/playground/src/astro/eslint.config.js +4 -0
  103. package/packages/playground/src/js/eslint.config.js +4 -0
  104. package/packages/playground/src/js/index.test.js +63 -0
  105. package/packages/playground/src/mdx/eslint.config.js +4 -0
  106. package/packages/playground/src/mdx/index.mdx +115 -0
  107. package/packages/playground/src/react/eslint.config.js +4 -0
  108. package/packages/playground/src/react/index.test.jsx +130 -0
  109. package/packages/playground/src/ts/eslint.config.js +4 -0
  110. package/packages/playground/src/ts/index.test.ts +61 -0
  111. package/packages/playground/src/ts/tsconfig.json +3 -0
  112. package/packages/playground/tsconfig.json +9 -0
  113. package/packages/react/README.md +14 -0
  114. package/packages/react/index.ts +26 -0
  115. package/packages/react/package.json +49 -0
  116. package/packages/react/src/ambient.d.ts +23 -0
  117. package/packages/react/src/index.ts +52 -0
  118. package/packages/react/src/rules.ts +47 -0
  119. package/packages/react/tsconfig.json +9 -0
  120. package/packages/react/tsup.config.ts +10 -0
  121. package/packages/tests/README.md +17 -0
  122. package/packages/tests/package.json +21 -0
  123. package/packages/tests/src/__snapshots__/snapshots.test.ts.snap +654 -0
  124. package/packages/tests/src/composition.test.ts +171 -0
  125. package/packages/tests/src/configs.test.ts +118 -0
  126. package/packages/tests/src/rules.test.ts +60 -0
  127. package/packages/tests/src/snapshots.test.ts +126 -0
  128. package/packages/tests/tsconfig.json +10 -0
  129. package/packages/tests/vitest.config.ts +8 -0
  130. package/packages/typescript/README.md +14 -0
  131. package/packages/typescript/package.json +47 -0
  132. package/packages/typescript/src/index.ts +32 -0
  133. package/packages/typescript/src/rules.ts +36 -0
  134. package/packages/typescript/tsconfig.json +9 -0
  135. package/packages/typescript/tsup.config.ts +10 -0
  136. package/tsconfig.base.json +20 -0
  137. package/tsconfig.docs.json +18 -0
  138. package/turbo.json +19 -0
  139. package/typedoc.config.mjs +25 -0
  140. package/typedoc.markdown.mjs +26 -0
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "rootDir": "./src"
6
+ },
7
+ "include": ["src/**/*.ts"],
8
+ "exclude": ["node_modules", "dist"]
9
+ }
@@ -0,0 +1,10 @@
1
+ import { defineConfig } from 'tsup'
2
+
3
+ export default defineConfig({
4
+ entry: ['src/index.ts', 'src/types.ts', 'src/utils/index.ts'],
5
+ format: ['esm'],
6
+ dts: true,
7
+ clean: true,
8
+ splitting: false,
9
+ sourcemap: true
10
+ })
@@ -0,0 +1,13 @@
1
+ # @santi020k/eslint-config-expo
2
+
3
+ Expo and React Native specific ESLint rules and configurations.
4
+
5
+ ## Description
6
+
7
+ This package provides:
8
+ - Expo plugin configuration.
9
+ - React Native specific rules.
10
+
11
+ ## Usage
12
+
13
+ This package is used automatically when `ConfigOption.Expo` is selected in the main configuration.
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@santi020k/eslint-config-expo",
3
+ "version": "0.0.0",
4
+ "description": "Expo ESLint configuration",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsup",
20
+ "dev": "tsup --watch",
21
+ "clean": "rm -rf dist"
22
+ },
23
+ "peerDependencies": {
24
+ "eslint": "^9.0.0"
25
+ },
26
+ "dependencies": {
27
+ "@santi020k/eslint-config-core": "*",
28
+ "@eslint/compat": "^1.2.9",
29
+ "@eslint/eslintrc": "^3.3.1",
30
+ "cross-dirname": "^0.1.0",
31
+ "eslint-config-expo": "^9.2.0"
32
+ },
33
+ "devDependencies": {
34
+ "@typescript-eslint/utils": "^8.54.0",
35
+ "tsup": "^8.5.1",
36
+ "typescript": "^5.9.3"
37
+ },
38
+ "publishConfig": {
39
+ "access": "public"
40
+ },
41
+ "license": "MIT",
42
+ "author": "santi020k",
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "git+https://github.com/santi020k/eslint-config.git",
46
+ "directory": "packages/expo"
47
+ }
48
+ }
@@ -0,0 +1,3 @@
1
+ declare module 'cross-dirname' {
2
+ export function getDirname(): string
3
+ }
@@ -0,0 +1,39 @@
1
+ import { getDirname } from 'cross-dirname'
2
+
3
+ import { FlatCompat } from '@eslint/eslintrc'
4
+ import { fixupConfigRules } from '@eslint/compat'
5
+ import type { TSESLint } from '@typescript-eslint/utils'
6
+
7
+ import { groups } from '@santi020k/eslint-config-core'
8
+
9
+ // Initialize FlatCompat with the base directory
10
+ const flatCompat = new FlatCompat({
11
+ baseDirectory: getDirname(),
12
+ recommendedConfig: {}
13
+ })
14
+
15
+ const rules: TSESLint.Linter.RulesRecord = {
16
+ 'simple-import-sort/imports': [
17
+ 'warn',
18
+ {
19
+ groups: [
20
+ // Packages `react` related packages come first.
21
+ ['^react'],
22
+ ['^(expo)(/.*|$)?'],
23
+ ...groups
24
+ ]
25
+ }
26
+ ]
27
+ }
28
+
29
+ /**
30
+ * Expo ESLint configuration
31
+ * Extends the expo config with custom import sorting
32
+ */
33
+ export const expoConfig: TSESLint.FlatConfig.ConfigArray = [
34
+ ...(fixupConfigRules(flatCompat.extends('expo')) as unknown as TSESLint.FlatConfig.ConfigArray),
35
+ {
36
+ name: 'eslint-config-expo/custom',
37
+ rules
38
+ }
39
+ ]
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "rootDir": "./src"
6
+ },
7
+ "include": ["src/**/*.ts"],
8
+ "exclude": ["node_modules", "dist"]
9
+ }
@@ -0,0 +1,11 @@
1
+ import { defineConfig } from 'tsup'
2
+
3
+ export default defineConfig({
4
+ entry: ['src/index.ts'],
5
+ format: ['esm'],
6
+ dts: true,
7
+ splitting: false,
8
+ sourcemap: true,
9
+ clean: true,
10
+ target: 'es2022'
11
+ })
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@santi020k/eslint-config-nest",
3
+ "version": "0.0.0",
4
+ "description": "NestJS ESLint configuration",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsup",
20
+ "dev": "tsup --watch",
21
+ "clean": "rm -rf dist"
22
+ },
23
+ "peerDependencies": {
24
+ "eslint": "^9.0.0"
25
+ },
26
+ "dependencies": {
27
+ "@santi020k/eslint-config-core": "*",
28
+ "@darraghor/eslint-plugin-nestjs-typed": "^6.0.0"
29
+ },
30
+ "devDependencies": {
31
+ "@typescript-eslint/utils": "^8.54.0",
32
+ "tsup": "^8.5.1",
33
+ "typescript": "^5.9.3"
34
+ },
35
+ "publishConfig": {
36
+ "access": "public"
37
+ },
38
+ "license": "MIT",
39
+ "author": "santi020k",
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "git+https://github.com/santi020k/eslint-config.git",
43
+ "directory": "packages/nest"
44
+ }
45
+ }
@@ -0,0 +1,14 @@
1
+ declare module '@darraghor/eslint-plugin-nestjs-typed' {
2
+ import type { TSESLint } from '@typescript-eslint/utils'
3
+
4
+ declare const plugin: {
5
+ configs: {
6
+ flatRecommended: TSESLint.FlatConfig.ConfigArray
7
+ recommended: {
8
+ rules: TSESLint.Linter.RulesRecord
9
+ }
10
+ }
11
+ }
12
+
13
+ export default plugin
14
+ }
@@ -0,0 +1,20 @@
1
+ import { rules } from './rules.js'
2
+
3
+ import nestPlugin from '@darraghor/eslint-plugin-nestjs-typed'
4
+ import type { TSESLint } from '@typescript-eslint/utils'
5
+
6
+ /**
7
+ * NestJS ESLint configuration
8
+ * Includes NestJS plugin with recommended rules
9
+ */
10
+ export const nestConfig: TSESLint.FlatConfig.ConfigArray = [
11
+ // Spread the recommended flat config from the plugin
12
+ ...(nestPlugin.configs.flatRecommended as TSESLint.FlatConfig.ConfigArray),
13
+ {
14
+ name: 'eslint-config-nest/custom',
15
+ rules
16
+ }
17
+ ]
18
+
19
+ // Re-export rules for direct access
20
+ export { rules }
@@ -0,0 +1,15 @@
1
+ import { groups } from '@santi020k/eslint-config-core'
2
+ import type { TSESLint } from '@typescript-eslint/utils'
3
+
4
+ export const rules: TSESLint.Linter.RulesRecord = {
5
+ 'simple-import-sort/imports': [
6
+ 'warn',
7
+ {
8
+ groups: [
9
+ // NestJS packages come first.
10
+ ['^@nestjs'],
11
+ ...groups
12
+ ]
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "rootDir": "./src"
6
+ },
7
+ "include": ["src/**/*.ts"],
8
+ "exclude": ["node_modules", "dist"]
9
+ }
@@ -0,0 +1,11 @@
1
+ import { defineConfig } from 'tsup'
2
+
3
+ export default defineConfig({
4
+ entry: ['src/index.ts'],
5
+ format: ['esm'],
6
+ dts: true,
7
+ splitting: false,
8
+ sourcemap: true,
9
+ clean: true,
10
+ target: 'es2022'
11
+ })
@@ -0,0 +1,13 @@
1
+ # @santi020k/eslint-config-next
2
+
3
+ Next.js specific ESLint rules and configurations.
4
+
5
+ ## Description
6
+
7
+ This package provides:
8
+ - Core Web Vitals recommended rules.
9
+ - Next.js plugin configuration.
10
+
11
+ ## Usage
12
+
13
+ This package is used automatically when `ConfigOption.Next` is selected in the main configuration.
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@santi020k/eslint-config-next",
3
+ "version": "0.0.0",
4
+ "description": "Next.js ESLint configuration",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsup",
20
+ "dev": "tsup --watch",
21
+ "clean": "rm -rf dist"
22
+ },
23
+ "peerDependencies": {
24
+ "eslint": "^9.0.0",
25
+ "next": ">=13.0.0"
26
+ },
27
+ "dependencies": {
28
+ "@santi020k/eslint-config-core": "*",
29
+ "@santi020k/eslint-config-react": "*",
30
+ "@next/eslint-plugin-next": "^16.1.6"
31
+ },
32
+ "devDependencies": {
33
+ "@typescript-eslint/utils": "^8.54.0",
34
+ "tsup": "^8.5.1",
35
+ "typescript": "^5.9.3"
36
+ },
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
40
+ "license": "MIT",
41
+ "author": "santi020k",
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "git+https://github.com/santi020k/eslint-config.git",
45
+ "directory": "packages/next"
46
+ }
47
+ }
@@ -0,0 +1,31 @@
1
+ import { rules } from './rules.js'
2
+
3
+ import pluginNext from '@next/eslint-plugin-next'
4
+ import type { TSESLint } from '@typescript-eslint/utils'
5
+
6
+ /**
7
+ * Next.js ESLint configuration
8
+ * Includes Next.js plugin with core-web-vitals rules
9
+ */
10
+ export const nextConfig: TSESLint.FlatConfig.ConfigArray = [
11
+ {
12
+ name: 'eslint-config-next/plugin',
13
+ plugins: {
14
+ '@next/next': pluginNext
15
+ },
16
+ rules: {
17
+ ...pluginNext.configs['core-web-vitals'].rules
18
+ }
19
+ },
20
+ {
21
+ name: 'eslint-config-next/custom',
22
+ rules
23
+ },
24
+ {
25
+ name: 'eslint-config-next/ignores',
26
+ ignores: ['.next/*']
27
+ }
28
+ ]
29
+
30
+ // Re-export rules for direct access
31
+ export { rules }
@@ -0,0 +1,16 @@
1
+ import { groups } from '@santi020k/eslint-config-core'
2
+ import type { TSESLint } from '@typescript-eslint/utils'
3
+
4
+ export const rules: TSESLint.Linter.RulesRecord = {
5
+ 'simple-import-sort/imports': [
6
+ 'warn',
7
+ {
8
+ groups: [
9
+ // Packages `react` related packages come first.
10
+ ['^react'],
11
+ ['^(next)(/.*|$)?'],
12
+ ...groups
13
+ ]
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist",
5
+ "rootDir": "./src"
6
+ },
7
+ "include": ["src/**/*.ts"],
8
+ "exclude": ["node_modules", "dist"]
9
+ }
@@ -0,0 +1,10 @@
1
+ import { defineConfig } from 'tsup'
2
+
3
+ export default defineConfig({
4
+ entry: ['src/index.ts'],
5
+ format: ['esm'],
6
+ dts: true,
7
+ clean: true,
8
+ splitting: false,
9
+ sourcemap: true
10
+ })
@@ -0,0 +1,18 @@
1
+ # @santi020k/eslint-config-optionals
2
+
3
+ Optional ESLint configurations for various tools and libraries.
4
+
5
+ ## Description
6
+
7
+ This package provides optional configurations for:
8
+ - Tailwind CSS
9
+ - Vitest
10
+ - CSpell
11
+ - i18next
12
+ - MDX
13
+ - Markdown
14
+ - Stencil.js
15
+
16
+ ## Usage
17
+
18
+ These configurations are activated via the `optionals` array in the main `eslintConfig` function.
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@santi020k/eslint-config-optionals",
3
+ "version": "0.0.0",
4
+ "description": "Optional ESLint configurations for various tools and frameworks",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsup",
20
+ "dev": "tsup --watch",
21
+ "clean": "rm -rf dist"
22
+ },
23
+ "peerDependencies": {
24
+ "eslint": "^9.0.0"
25
+ },
26
+ "dependencies": {
27
+ "@cspell/eslint-plugin": "^9.6.4",
28
+ "@eslint/compat": "^2.0.2",
29
+ "@eslint/eslintrc": "^3.3.1",
30
+ "@eslint/markdown": "^7.5.1",
31
+ "@stencil-community/eslint-plugin": "^0.10.0",
32
+ "cross-dirname": "^0.1.0",
33
+ "eslint-plugin-i18next": "^6.1.3",
34
+ "eslint-plugin-mdx": "^3.6.2",
35
+ "eslint-plugin-tailwindcss": "^3.18.2",
36
+ "eslint-plugin-testing-library": "^7.15.4",
37
+ "eslint-plugin-vitest": "^0.5.4",
38
+ "globals": "^17.3.0"
39
+ },
40
+ "devDependencies": {
41
+ "@typescript-eslint/utils": "^8.54.0",
42
+ "tsup": "^8.5.1",
43
+ "typescript": "^5.9.3"
44
+ },
45
+ "publishConfig": {
46
+ "access": "public"
47
+ },
48
+ "license": "MIT",
49
+ "author": "santi020k",
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "git+https://github.com/santi020k/eslint-config.git",
53
+ "directory": "packages/optionals"
54
+ }
55
+ }
@@ -0,0 +1,25 @@
1
+ declare module 'cross-dirname' {
2
+ export function getDirname(): string
3
+ }
4
+
5
+ declare module '@stencil-community/eslint-plugin' {
6
+ const plugin: {
7
+ rules: Record<string, unknown>
8
+ }
9
+ export default plugin
10
+ }
11
+
12
+ declare module 'eslint-plugin-tailwindcss' {
13
+ import type { TSESLint } from '@typescript-eslint/utils'
14
+ const plugin: {
15
+ configs: {
16
+ 'flat/recommended': TSESLint.FlatConfig.ConfigArray
17
+ }
18
+ }
19
+ export default plugin
20
+ }
21
+
22
+ declare module 'eslint-plugin-i18next' {
23
+ const plugin: unknown
24
+ export default plugin
25
+ }
@@ -0,0 +1,14 @@
1
+ import pluginCspell from '@cspell/eslint-plugin'
2
+
3
+ import type { TSESLint } from '@typescript-eslint/utils'
4
+
5
+ /**
6
+ * CSpell ESLint configuration
7
+ * Enables spell checking in your codebase
8
+ */
9
+ export const cspell: TSESLint.FlatConfig.ConfigArray = [
10
+ {
11
+ name: 'optionals/cspell',
12
+ plugins: { '@cspell': pluginCspell }
13
+ }
14
+ ]
@@ -0,0 +1,19 @@
1
+ import { getDirname } from 'cross-dirname'
2
+
3
+ import { FlatCompat } from '@eslint/eslintrc'
4
+ import { fixupConfigRules } from '@eslint/compat'
5
+ import type { TSESLint } from '@typescript-eslint/utils'
6
+
7
+ // Initialize FlatCompat with the base directory
8
+ const flatCompat = new FlatCompat({
9
+ baseDirectory: getDirname(),
10
+ recommendedConfig: {}
11
+ })
12
+
13
+ /**
14
+ * i18next ESLint configuration
15
+ * Enables i18next plugin for internationalization
16
+ */
17
+ export const i18next: TSESLint.FlatConfig.ConfigArray = [
18
+ ...(fixupConfigRules(flatCompat.plugins('i18next')) as unknown as TSESLint.FlatConfig.ConfigArray)
19
+ ]
@@ -0,0 +1,8 @@
1
+ // Re-export all optional configurations
2
+ export { cspell } from './cspell.js'
3
+ export { i18next } from './i18next.js'
4
+ export { markdown } from './markdown.js'
5
+ export { mdx } from './mdx.js'
6
+ export { stencil } from './stencil.js'
7
+ export { tailwind } from './tailwind.js'
8
+ export { vitest } from './vitest.js'
@@ -0,0 +1,66 @@
1
+ import pluginMarkdown from '@eslint/markdown'
2
+ import type { TSESLint } from '@typescript-eslint/utils'
3
+
4
+ /**
5
+ * Markdown ESLint configuration
6
+ * Lints markdown files for common issues
7
+ */
8
+ export const markdown: TSESLint.FlatConfig.ConfigArray = [
9
+ ...(pluginMarkdown.configs.recommended as TSESLint.FlatConfig.ConfigArray),
10
+ {
11
+ name: 'optionals/markdown',
12
+ files: ['**/*.md'],
13
+ language: 'markdown/commonmark',
14
+ rules: {
15
+ 'markdown/fenced-code-language': 'error',
16
+ 'markdown/heading-increment': 'error',
17
+ 'markdown/no-duplicate-headings': 'off',
18
+ 'markdown/no-empty-links': 'error',
19
+ 'markdown/no-html': 'off',
20
+ 'markdown/no-invalid-label-refs': 'error',
21
+ 'markdown/no-missing-label-refs': 'off',
22
+ // Disable js/ts Eslint rules that conflict with markdown
23
+ indent: 'off',
24
+ 'no-irregular-whitespace': 'off',
25
+ '@stylistic/indent': 'off',
26
+ 'no-unused-vars': 'off',
27
+ '@stylistic/jsx-closing-bracket-location': 'off',
28
+ 'no-multi-spaces': 'off',
29
+ '@stylistic/no-multi-spaces': 'off',
30
+ 'comma-dangle': 'off',
31
+ '@stylistic/jsx-tag-spacing': 'off'
32
+ }
33
+ },
34
+ {
35
+ name: 'optionals/markdown-code-blocks',
36
+ files: ['**/*.md/*.ts', '**/*.md/*.tsx', '**/*.md/*.js', '**/*.md/*.jsx'],
37
+ rules: {
38
+ // Disable type-aware rules — code blocks in markdown have no tsconfig
39
+ '@typescript-eslint/no-unsafe-assignment': 'off',
40
+ '@typescript-eslint/no-unsafe-call': 'off',
41
+ '@typescript-eslint/no-unsafe-member-access': 'off',
42
+ '@typescript-eslint/no-unsafe-return': 'off',
43
+ '@typescript-eslint/no-unsafe-argument': 'off',
44
+ '@typescript-eslint/no-floating-promises': 'off',
45
+ '@typescript-eslint/no-misused-promises': 'off',
46
+ '@typescript-eslint/await-thenable': 'off',
47
+ '@typescript-eslint/require-await': 'off',
48
+ '@typescript-eslint/restrict-template-expressions': 'off',
49
+ '@typescript-eslint/no-unnecessary-type-assertion': 'off',
50
+ '@typescript-eslint/unbound-method': 'off',
51
+ // Disable other rules that don't make sense for code snippets
52
+ 'import/no-unresolved': 'off',
53
+ 'no-unused-vars': 'off',
54
+ '@typescript-eslint/no-unused-vars': 'off',
55
+ 'no-undef': 'off',
56
+ '@typescript-eslint/consistent-type-imports': 'off',
57
+ '@typescript-eslint/no-explicit-any': 'off'
58
+ },
59
+ languageOptions: {
60
+ parserOptions: {
61
+ project: null,
62
+ program: null
63
+ }
64
+ }
65
+ }
66
+ ]
@@ -0,0 +1,40 @@
1
+ import * as pluginMdx from 'eslint-plugin-mdx'
2
+
3
+ import type { TSESLint } from '@typescript-eslint/utils'
4
+
5
+ const rules: TSESLint.Linter.RulesRecord = {
6
+ ...pluginMdx.flatCodeBlocks.rules,
7
+ 'no-var': 'error',
8
+ 'prefer-const': 'error',
9
+ 'react/react-in-jsx-scope': 0,
10
+ 'no-unused-vars': 'off',
11
+ '@stylistic/indent': 'off',
12
+ '@stylistic/jsx-closing-bracket-location': 'off',
13
+ 'indent': 'off',
14
+ 'no-multi-spaces': 'off',
15
+ '@stylistic/no-multi-spaces': 'off',
16
+ 'comma-dangle': 'off',
17
+ '@stylistic/jsx-tag-spacing': 'off',
18
+ 'import/export': 'off'
19
+ }
20
+
21
+ /**
22
+ * MDX ESLint configuration
23
+ * Lints MDX files with proper code block handling
24
+ */
25
+ export const mdx: TSESLint.FlatConfig.ConfigArray = [
26
+ {
27
+ files: ['**/*.mdx'],
28
+ ...pluginMdx.flat,
29
+ processor: pluginMdx.createRemarkProcessor({
30
+ lintCodeBlocks: true,
31
+ languageMapper: {}
32
+ }),
33
+ rules
34
+ } as TSESLint.FlatConfig.Config,
35
+ {
36
+ files: ['**/*.mdx'],
37
+ ...pluginMdx.flatCodeBlocks,
38
+ rules
39
+ } as TSESLint.FlatConfig.Config
40
+ ]