@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,23 @@
1
+ // Type declarations for ESLint plugins that don't ship their own types
2
+
3
+ declare module 'eslint-plugin-react/configs/recommended.js' {
4
+ import type { TSESLint } from '@typescript-eslint/utils'
5
+
6
+ const config: TSESLint.FlatConfig.Config
7
+
8
+ export default config
9
+ }
10
+
11
+ declare module 'eslint-plugin-react-hooks' {
12
+ import type { TSESLint } from '@typescript-eslint/utils'
13
+
14
+ const plugin: TSESLint.FlatConfig.Plugin & {
15
+ configs: {
16
+ recommended: {
17
+ rules: TSESLint.Linter.RulesRecord
18
+ }
19
+ }
20
+ }
21
+
22
+ export default plugin
23
+ }
@@ -0,0 +1,52 @@
1
+ // @ts-check
2
+ import pluginReactConfig from 'eslint-plugin-react/configs/recommended.js'
3
+ import pluginReactHooks from 'eslint-plugin-react-hooks'
4
+ import globals from 'globals'
5
+
6
+ import { rules } from './rules.js'
7
+
8
+ import { fixupConfigRules } from '@eslint/compat'
9
+ import type { TSESLint } from '@typescript-eslint/utils'
10
+
11
+ const languageOptions: TSESLint.FlatConfig.LanguageOptions = {
12
+ ecmaVersion: 'latest',
13
+ sourceType: 'module',
14
+ ...(pluginReactConfig.languageOptions as TSESLint.FlatConfig.LanguageOptions),
15
+ globals: {
16
+ ...globals.browser,
17
+ ...globals.node
18
+ }
19
+ }
20
+
21
+ /**
22
+ * React ESLint configuration
23
+ * Includes React plugin recommended rules and React Hooks
24
+ */
25
+ export const reactConfig: TSESLint.FlatConfig.ConfigArray = [
26
+ // Use type assertion to handle @eslint/compat type mismatch
27
+ ...(fixupConfigRules(pluginReactConfig as unknown as Parameters<typeof fixupConfigRules>[0]).map(react => ({
28
+ ...react,
29
+ name: 'eslint-config-react/recommended',
30
+ languageOptions,
31
+ settings: {
32
+ react: {
33
+ version: 'detect'
34
+ }
35
+ }
36
+ })) as unknown as TSESLint.FlatConfig.ConfigArray),
37
+ {
38
+ name: 'eslint-config-react/custom',
39
+ plugins: {
40
+ 'react-hooks': pluginReactHooks
41
+ },
42
+ languageOptions,
43
+ files: ['**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}'],
44
+ rules: {
45
+ ...pluginReactHooks.configs.recommended.rules,
46
+ ...rules
47
+ }
48
+ }
49
+ ]
50
+
51
+ // Re-export rules for direct access
52
+ export { rules }
@@ -0,0 +1,47 @@
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
+ 'react/react-in-jsx-scope': 'off',
6
+ 'react/jsx-max-depth': ['warn', { max: 7 }],
7
+ 'react/prop-types': 'off',
8
+ 'react-hooks/exhaustive-deps': 'off',
9
+ 'react/button-has-type': 'warn',
10
+ 'react/display-name': 'warn',
11
+ 'react/no-children-prop': 'warn',
12
+ 'react/no-danger-with-children': 'warn',
13
+ 'react/no-unstable-nested-components': 'warn',
14
+ 'react/self-closing-comp': ['warn', { component: true, html: true }],
15
+ 'react/jsx-curly-brace-presence': [
16
+ 'warn',
17
+ { props: 'never', children: 'never' }
18
+ ],
19
+ 'react/jsx-curly-newline': 'warn',
20
+ 'react/destructuring-assignment': 'warn',
21
+ 'react/jsx-pascal-case': 'warn',
22
+ 'react/boolean-prop-naming': 'warn',
23
+ 'react/hook-use-state': 'warn',
24
+ 'react/jsx-boolean-value': 'warn',
25
+ 'react/jsx-closing-tag-location': 'warn',
26
+ 'react/jsx-closing-bracket-location': 'warn',
27
+ 'react/jsx-wrap-multilines': 'warn',
28
+ 'react/jsx-no-target-blank': 'warn',
29
+ 'react/jsx-no-leaked-render': 'warn',
30
+ 'react/jsx-handler-names': 'warn',
31
+ 'react/jsx-fragments': 'warn',
32
+ 'react/no-deprecated': 'warn',
33
+ 'react/no-multi-comp': 'warn',
34
+ 'react/no-unescaped-entities': 'warn',
35
+ 'react/jsx-no-undef': 'warn',
36
+ 'react/no-unknown-property': 'warn',
37
+ 'simple-import-sort/imports': [
38
+ 'warn',
39
+ {
40
+ groups: [
41
+ // Packages `react` related packages come first.
42
+ ['^react'],
43
+ ...groups
44
+ ]
45
+ }
46
+ ]
47
+ }
@@ -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,17 @@
1
+ # @santi020k/eslint-config-tests
2
+
3
+ Internal integration tests for the ESLint configuration packages.
4
+
5
+ ## Description
6
+
7
+ This package uses Vitest to run integration tests, verifying that:
8
+ - Configs are exported correctly.
9
+ - Configurations can be composed without errors.
10
+ - Rules are present as expected.
11
+
12
+ ## Usage
13
+
14
+ Run tests:
15
+ ```bash
16
+ npm run test
17
+ ```
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@santi020k/eslint-config-tests",
3
+ "private": false,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "test": "vitest run"
8
+ },
9
+ "devDependencies": {
10
+ "@santi020k/eslint-config-basic": "*",
11
+ "@santi020k/eslint-config-core": "*",
12
+ "@santi020k/eslint-config-typescript": "*",
13
+ "@santi020k/eslint-config-react": "*",
14
+ "@santi020k/eslint-config-astro": "*",
15
+ "@santi020k/eslint-config-next": "*",
16
+ "@santi020k/eslint-config-expo": "*",
17
+ "vitest": "^4.0.18",
18
+ "eslint": "^9.39.2",
19
+ "typescript": "^5.9.3"
20
+ }
21
+ }