@santi020k/eslint-config-basic 0.1.0 → 0.4.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 (142) hide show
  1. package/dist/index.d.ts +21 -0
  2. package/dist/index.js +129 -0
  3. package/package.json +47 -50
  4. package/.agent/rules/context.md +0 -78
  5. package/.agent/rules/guidelines.md +0 -124
  6. package/.editorconfig +0 -13
  7. package/.env.example +0 -8
  8. package/.github/CODEOWNERS +0 -2
  9. package/.github/DISCUSSION_TEMPLATE/rfcs.yml +0 -21
  10. package/.github/DISCUSSION_TEMPLATE/technical-discussions.yml +0 -21
  11. package/.github/FUNDING.yml +0 -2
  12. package/.github/ISSUE_TEMPLATE/README.md +0 -13
  13. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -69
  14. package/.github/ISSUE_TEMPLATE/config.yml +0 -8
  15. package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -43
  16. package/.github/ISSUE_TEMPLATE/question.yml +0 -22
  17. package/.github/SECURITY.md +0 -12
  18. package/.github/SPONSORSHIPS.md +0 -27
  19. package/.github/dependabot.yml +0 -45
  20. package/.github/labeler.yml +0 -46
  21. package/.github/pull_request_template.md +0 -56
  22. package/.github/workflows/assign-issues.yml +0 -18
  23. package/.github/workflows/audit.yml +0 -22
  24. package/.github/workflows/build.yml +0 -29
  25. package/.github/workflows/codeql.yml +0 -40
  26. package/.github/workflows/docs.yml +0 -49
  27. package/.github/workflows/labeler.yml +0 -18
  28. package/.github/workflows/publish.yml +0 -24
  29. package/.github/workflows/release.yml +0 -35
  30. package/.github/workflows/size-check.yml +0 -23
  31. package/.github/workflows/stale.yml +0 -31
  32. package/.nvmrc +0 -1
  33. package/.vscode/extensions.json +0 -10
  34. package/.vscode/settings.json +0 -55
  35. package/CHANGELOG.md +0 -16
  36. package/CONTRIBUTING.md +0 -194
  37. package/DEVELOPMENT.md +0 -4
  38. package/LICENSE +0 -21
  39. package/README.md +0 -275
  40. package/config/.husky/commit-msg +0 -9
  41. package/config/.husky/pre-commit +0 -1
  42. package/config/.husky/pre-push +0 -1
  43. package/config/.husky/prepare-commit-msg +0 -1
  44. package/cspell.config.yaml +0 -2
  45. package/eslint.config.js +0 -21
  46. package/llms.txt +0 -72
  47. package/packages/astro/README.md +0 -13
  48. package/packages/astro/package.json +0 -45
  49. package/packages/astro/src/ambient.d.ts +0 -10
  50. package/packages/astro/src/index.ts +0 -18
  51. package/packages/astro/src/rules.ts +0 -29
  52. package/packages/astro/tsconfig.json +0 -9
  53. package/packages/astro/tsup.config.ts +0 -11
  54. package/packages/basic/README.md +0 -33
  55. package/packages/basic/package.json +0 -55
  56. package/packages/basic/src/index.ts +0 -110
  57. package/packages/basic/tsconfig.json +0 -9
  58. package/packages/basic/tsup.config.ts +0 -18
  59. package/packages/core/README.md +0 -14
  60. package/packages/core/index.ts +0 -14
  61. package/packages/core/package.json +0 -61
  62. package/packages/core/src/ambient.d.ts +0 -61
  63. package/packages/core/src/index.ts +0 -75
  64. package/packages/core/src/rules.ts +0 -157
  65. package/packages/core/src/settings/gitignore.ts +0 -10
  66. package/packages/core/src/settings/index.ts +0 -1
  67. package/packages/core/src/types.ts +0 -57
  68. package/packages/core/src/utils/index.ts +0 -28
  69. package/packages/core/tsconfig.json +0 -9
  70. package/packages/core/tsup.config.ts +0 -10
  71. package/packages/expo/README.md +0 -13
  72. package/packages/expo/package.json +0 -48
  73. package/packages/expo/src/ambient.d.ts +0 -3
  74. package/packages/expo/src/index.ts +0 -39
  75. package/packages/expo/tsconfig.json +0 -9
  76. package/packages/expo/tsup.config.ts +0 -11
  77. package/packages/nest/package.json +0 -45
  78. package/packages/nest/src/ambient.d.ts +0 -14
  79. package/packages/nest/src/index.ts +0 -20
  80. package/packages/nest/src/rules.ts +0 -15
  81. package/packages/nest/tsconfig.json +0 -9
  82. package/packages/nest/tsup.config.ts +0 -11
  83. package/packages/next/README.md +0 -13
  84. package/packages/next/package.json +0 -47
  85. package/packages/next/src/index.ts +0 -31
  86. package/packages/next/src/rules.ts +0 -16
  87. package/packages/next/tsconfig.json +0 -9
  88. package/packages/next/tsup.config.ts +0 -10
  89. package/packages/optionals/README.md +0 -18
  90. package/packages/optionals/package.json +0 -55
  91. package/packages/optionals/src/ambient.d.ts +0 -25
  92. package/packages/optionals/src/cspell.ts +0 -14
  93. package/packages/optionals/src/i18next.ts +0 -19
  94. package/packages/optionals/src/index.ts +0 -8
  95. package/packages/optionals/src/markdown.ts +0 -66
  96. package/packages/optionals/src/mdx.ts +0 -40
  97. package/packages/optionals/src/stencil.ts +0 -48
  98. package/packages/optionals/src/tailwind.ts +0 -11
  99. package/packages/optionals/src/vitest.ts +0 -61
  100. package/packages/optionals/tsconfig.json +0 -9
  101. package/packages/optionals/tsup.config.ts +0 -11
  102. package/packages/playground/README.md +0 -14
  103. package/packages/playground/package.json +0 -17
  104. package/packages/playground/src/astro/eslint.config.js +0 -4
  105. package/packages/playground/src/js/eslint.config.js +0 -4
  106. package/packages/playground/src/js/index.test.js +0 -63
  107. package/packages/playground/src/mdx/eslint.config.js +0 -4
  108. package/packages/playground/src/mdx/index.mdx +0 -115
  109. package/packages/playground/src/react/eslint.config.js +0 -4
  110. package/packages/playground/src/react/index.test.jsx +0 -130
  111. package/packages/playground/src/ts/eslint.config.js +0 -4
  112. package/packages/playground/src/ts/index.test.ts +0 -61
  113. package/packages/playground/src/ts/tsconfig.json +0 -3
  114. package/packages/playground/tsconfig.json +0 -9
  115. package/packages/react/README.md +0 -14
  116. package/packages/react/index.ts +0 -26
  117. package/packages/react/package.json +0 -49
  118. package/packages/react/src/ambient.d.ts +0 -23
  119. package/packages/react/src/index.ts +0 -52
  120. package/packages/react/src/rules.ts +0 -47
  121. package/packages/react/tsconfig.json +0 -9
  122. package/packages/react/tsup.config.ts +0 -10
  123. package/packages/tests/README.md +0 -17
  124. package/packages/tests/package.json +0 -21
  125. package/packages/tests/src/__snapshots__/snapshots.test.ts.snap +0 -654
  126. package/packages/tests/src/composition.test.ts +0 -171
  127. package/packages/tests/src/configs.test.ts +0 -118
  128. package/packages/tests/src/rules.test.ts +0 -60
  129. package/packages/tests/src/snapshots.test.ts +0 -126
  130. package/packages/tests/tsconfig.json +0 -10
  131. package/packages/tests/vitest.config.ts +0 -8
  132. package/packages/typescript/README.md +0 -14
  133. package/packages/typescript/package.json +0 -47
  134. package/packages/typescript/src/index.ts +0 -32
  135. package/packages/typescript/src/rules.ts +0 -36
  136. package/packages/typescript/tsconfig.json +0 -9
  137. package/packages/typescript/tsup.config.ts +0 -10
  138. package/tsconfig.base.json +0 -20
  139. package/tsconfig.docs.json +0 -18
  140. package/turbo.json +0 -19
  141. package/typedoc.config.mjs +0 -25
  142. package/typedoc.markdown.mjs +0 -26
@@ -1,18 +0,0 @@
1
- import pluginAstro from 'eslint-plugin-astro'
2
-
3
- import type { TSESLint } from '@typescript-eslint/utils'
4
-
5
- import { rules } from './rules.js'
6
-
7
- /**
8
- * Astro ESLint configuration
9
- * Includes Astro plugin recommended rules and custom overrides
10
- */
11
- export const astroConfig: TSESLint.FlatConfig.ConfigArray = [
12
- ...(pluginAstro.configs.recommended as TSESLint.FlatConfig.ConfigArray),
13
- {
14
- name: 'eslint-config-astro/custom',
15
- files: ['**/*.astro'],
16
- rules
17
- }
18
- ]
@@ -1,29 +0,0 @@
1
- import type { TSESLint } from '@typescript-eslint/utils'
2
-
3
- import { groups } from '@santi020k/eslint-config-core'
4
-
5
- export const rules: TSESLint.Linter.RulesRecord = {
6
- 'simple-import-sort/imports': [
7
- 'warn',
8
- {
9
- groups: [
10
- // Packages `react` related packages come first.
11
- ['^react'],
12
- ['^(astro)(/.*|$)?'],
13
- ...groups
14
- ]
15
- }
16
- ],
17
- // Disable no-unresolved rule for .astro files
18
- 'react/jsx-filename-extension': [1, { extensions: ['.astro'] }], // Accept jsx in astro files
19
- 'react/destructuring-assignment': 'off', // Vscode doesn't support automatically destructuring
20
- 'react/require-default-props': 'off', // Allow non-defined react props as undefined
21
- 'react/jsx-props-no-spreading': 'off', // _app.tsx uses spread operator
22
- 'react/react-in-jsx-scope': 'off',
23
- 'react/no-unknown-property': 'off',
24
- // Disable conflicted rules
25
- '@stylistic/jsx-indent': 'off',
26
- '@stylistic/jsx-one-expression-per-line': 'off',
27
- '@stylistic/jsx-tag-spacing': 'off',
28
- 'react/jsx-key': 'off'
29
- }
@@ -1,9 +0,0 @@
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
- }
@@ -1,11 +0,0 @@
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
- })
@@ -1,33 +0,0 @@
1
- # @santi020k/eslint-config-basic
2
-
3
- A comprehensive, composable ESLint configuration for modern JavaScript and TypeScript projects.
4
-
5
- ## Features
6
-
7
- - **Composable**: Pick and choose what you need (React, Next.js, Astro, Expo, etc.).
8
- - **Flat Config**: Built natively for ESLint 9+ Flat Config system.
9
- - **Opinionated yet Flexible**: Sane defaults with easy override capabilities.
10
-
11
- ## Installation
12
-
13
- ```bash
14
- npm install -D @santi020k/eslint-config-basic eslint
15
- ```
16
-
17
- ## Usage
18
-
19
- Create `eslint.config.mjs` (or `.js`):
20
-
21
- ```js
22
- import { ConfigOption, eslintConfig, OptionalOption } from '@santi020k/eslint-config-basic'
23
-
24
- export default eslintConfig({
25
- config: [
26
- ConfigOption.Ts,
27
- ConfigOption.React
28
- ],
29
- optionals: [
30
- OptionalOption.Tailwind
31
- ]
32
- })
33
- ```
@@ -1,55 +0,0 @@
1
- {
2
- "name": "@santi020k/eslint-config-basic",
3
- "version": "0.0.0",
4
- "description": "A comprehensive ESLint configuration package for JavaScript, TypeScript, and React projects.",
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
- "dependencies": {
24
- "@santi020k/eslint-config-astro": "*",
25
- "@santi020k/eslint-config-core": "*",
26
- "@santi020k/eslint-config-expo": "*",
27
- "@santi020k/eslint-config-nest": "*",
28
- "@santi020k/eslint-config-next": "*",
29
- "@santi020k/eslint-config-optionals": "*",
30
- "@santi020k/eslint-config-react": "*",
31
- "@santi020k/eslint-config-typescript": "*",
32
- "@eslint/compat": "^2.0.2",
33
- "@eslint/js": "^9.39.2",
34
- "@typescript-eslint/eslint-plugin": "^8.54.0",
35
- "@typescript-eslint/type-utils": "^8.54.0",
36
- "cross-dirname": "^0.1.0",
37
- "eslint": "^9.39.2",
38
- "typescript-eslint": "^8.54.0"
39
- },
40
- "devDependencies": {
41
- "tsup": "^8.5.1",
42
- "typescript": "^5.9.3",
43
- "@typescript-eslint/utils": "^8.54.0"
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/basic"
54
- }
55
- }
@@ -1,110 +0,0 @@
1
- // Re-export types and utilities from core
2
- export {
3
- ConfigOption,
4
- OptionalOption,
5
- SettingOption,
6
- ReactConfigs,
7
- applyConfigIfOptionPresent,
8
- hasReactConfig,
9
- coreConfig,
10
- jsConfig,
11
- gitignore
12
- } from '@santi020k/eslint-config-core'
13
-
14
- export type {
15
- EslintConfigOptions,
16
- FlatConfigArray
17
- } from '@santi020k/eslint-config-core'
18
-
19
- // Re-export framework configs
20
- export { typescriptConfig, tsConfig } from '@santi020k/eslint-config-typescript'
21
-
22
- export { reactConfig } from '@santi020k/eslint-config-react'
23
-
24
- export { nextConfig } from '@santi020k/eslint-config-next'
25
-
26
- export { astroConfig } from '@santi020k/eslint-config-astro'
27
-
28
- export { expoConfig } from '@santi020k/eslint-config-expo'
29
-
30
- export { nestConfig } from '@santi020k/eslint-config-nest'
31
-
32
- // Re-export optionals
33
- export {
34
- cspell,
35
- i18next,
36
- markdown,
37
- mdx,
38
- stencil,
39
- tailwind,
40
- vitest
41
- } from '@santi020k/eslint-config-optionals'
42
-
43
- // Import for composition
44
- import { astroConfig } from '@santi020k/eslint-config-astro'
45
- import type { EslintConfigOptions, FlatConfigArray } from '@santi020k/eslint-config-core'
46
- import {
47
- applyConfigIfOptionPresent,
48
- ConfigOption,
49
- coreConfig,
50
- gitignore,
51
- hasReactConfig,
52
- OptionalOption,
53
- SettingOption
54
- } from '@santi020k/eslint-config-core'
55
- import { expoConfig } from '@santi020k/eslint-config-expo'
56
- import { nestConfig } from '@santi020k/eslint-config-nest'
57
- import { nextConfig } from '@santi020k/eslint-config-next'
58
- import {
59
- cspell,
60
- i18next,
61
- markdown,
62
- mdx,
63
- stencil,
64
- tailwind,
65
- vitest
66
- } from '@santi020k/eslint-config-optionals'
67
- import { reactConfig } from '@santi020k/eslint-config-react'
68
- import { typescriptConfig } from '@santi020k/eslint-config-typescript'
69
-
70
- /**
71
- * Generates the ESLint configuration array, applying configurations
72
- * and optional settings based on the input configuration.
73
- *
74
- * @param {EslintConfigOptions} options - Configuration and optional settings
75
- * @returns {FlatConfigArray} The final ESLint configuration array
76
- */
77
- export const eslintConfig = ({
78
- config = [],
79
- optionals = [],
80
- settings = []
81
- }: EslintConfigOptions = {}): FlatConfigArray => {
82
- const hasReact = hasReactConfig(config)
83
-
84
- return [
85
- // Settings
86
- ...(settings.includes(SettingOption.Gitignore) ? gitignore : []),
87
-
88
- // Core JS config (always included)
89
- ...coreConfig,
90
-
91
- // React config (included if any React-based framework is used)
92
- ...(hasReact ? reactConfig : []),
93
-
94
- // Framework-specific configs
95
- ...applyConfigIfOptionPresent(config, ConfigOption.Ts, typescriptConfig),
96
- ...applyConfigIfOptionPresent(config, ConfigOption.Next, nextConfig),
97
- ...applyConfigIfOptionPresent(config, ConfigOption.Astro, astroConfig),
98
- ...applyConfigIfOptionPresent(config, ConfigOption.Expo, expoConfig),
99
- ...applyConfigIfOptionPresent(config, ConfigOption.Nest, nestConfig),
100
-
101
- // Optionals
102
- ...(optionals.includes(OptionalOption.Cspell) ? cspell : []),
103
- ...(optionals.includes(OptionalOption.Tailwind) ? tailwind : []),
104
- ...(optionals.includes(OptionalOption.Vitest) ? vitest : []),
105
- ...(optionals.includes(OptionalOption.I18next) ? i18next : []),
106
- ...(optionals.includes(OptionalOption.Stencil) ? stencil : []),
107
- ...(optionals.includes(OptionalOption.Mdx) ? mdx : []),
108
- ...(optionals.includes(OptionalOption.Markdown) ? markdown : [])
109
- ]
110
- }
@@ -1,9 +0,0 @@
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
- }
@@ -1,18 +0,0 @@
1
- import type { Options } from 'tsup'
2
-
3
- const env = process.env.NODE_ENV
4
-
5
- export const tsup: Options = {
6
- splitting: true,
7
- clean: true, // clean up the dist folder
8
- dts: true, // generate dts files
9
- format: ['esm'], // generate esm files
10
- minify: false,
11
- // bundle: env === 'production',
12
- skipNodeModulesBundle: true,
13
- entryPoints: ['src/index.ts'],
14
- watch: env === 'development',
15
- target: 'es2020',
16
- outDir: 'dist',
17
- entry: ['src/**/*.ts'] // include all files under src
18
- }
@@ -1,14 +0,0 @@
1
- # @santi020k/eslint-config-core
2
-
3
- Core ESLint configuration and utilities for the `@santi020k/eslint-config` monorepo.
4
-
5
- ## Description
6
-
7
- This package contains:
8
- - Base JavaScript rules.
9
- - Types and Enums (`ConfigOption`, `OptionalOption`, etc.).
10
- - Utility functions for composing configurations.
11
-
12
- ## Installation
13
-
14
- This package is an internal dependency of `@santi020k/eslint-config` and is not intended to be installed directly.
@@ -1,14 +0,0 @@
1
- import tseslint from 'typescript-eslint'
2
-
3
- import js from '@eslint/js'
4
-
5
- export default [
6
- js.configs.recommended,
7
- ...tseslint.configs.recommended,
8
- {
9
- rules: {
10
- 'no-unused-vars': 'warn',
11
- 'no-console': 'warn'
12
- }
13
- }
14
- ]
@@ -1,61 +0,0 @@
1
- {
2
- "name": "@santi020k/eslint-config-core",
3
- "version": "0.0.0",
4
- "description": "Core ESLint configuration with base JavaScript rules and shared utilities",
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
- "./utils": {
15
- "import": "./dist/utils/index.js",
16
- "types": "./dist/utils/index.d.ts"
17
- },
18
- "./types": {
19
- "import": "./dist/types.js",
20
- "types": "./dist/types.d.ts"
21
- }
22
- },
23
- "files": [
24
- "dist"
25
- ],
26
- "scripts": {
27
- "build": "tsup",
28
- "dev": "tsup --watch",
29
- "clean": "rm -rf dist"
30
- },
31
- "peerDependencies": {
32
- "eslint": "^9.0.0"
33
- },
34
- "dependencies": {
35
- "@eslint/js": "^9.39.2",
36
- "@stylistic/eslint-plugin": "^5.7.1",
37
- "eslint-config-standard": "^17.1.0",
38
- "eslint-plugin-import": "^2.32.0",
39
- "eslint-plugin-jsx-a11y": "^6.10.2",
40
- "eslint-plugin-n": "^17.23.2",
41
- "eslint-plugin-promise": "^7.2.1",
42
- "eslint-plugin-simple-import-sort": "^12.1.1",
43
- "eslint-plugin-unused-imports": "^4.3.0",
44
- "globals": "^17.3.0"
45
- },
46
- "devDependencies": {
47
- "@typescript-eslint/utils": "^8.54.0",
48
- "tsup": "^8.5.1",
49
- "typescript": "^5.9.3"
50
- },
51
- "publishConfig": {
52
- "access": "public"
53
- },
54
- "license": "MIT",
55
- "author": "santi020k",
56
- "repository": {
57
- "type": "git",
58
- "url": "git+https://github.com/santi020k/eslint-config.git",
59
- "directory": "packages/core"
60
- }
61
- }
@@ -1,61 +0,0 @@
1
- // Type declarations for ESLint plugins that don't ship their own types
2
-
3
- declare module 'eslint-config-standard' {
4
- import type { TSESLint } from '@typescript-eslint/utils'
5
-
6
- const config: {
7
- rules: TSESLint.Linter.RulesRecord
8
- }
9
-
10
- export default config
11
- }
12
-
13
- declare module 'eslint-plugin-import' {
14
- import type { TSESLint } from '@typescript-eslint/utils'
15
-
16
- const plugin: {
17
- rules: Record<string, TSESLint.RuleModule<string, unknown[]>>
18
- }
19
-
20
- export default plugin
21
- }
22
-
23
- declare module 'eslint-plugin-jsx-a11y' {
24
- import type { TSESLint } from '@typescript-eslint/utils'
25
-
26
- const plugin: TSESLint.FlatConfig.Plugin
27
-
28
- export default plugin
29
- }
30
-
31
- declare module 'eslint-plugin-n' {
32
- import type { TSESLint } from '@typescript-eslint/utils'
33
-
34
- const plugin: TSESLint.FlatConfig.Plugin
35
-
36
- export default plugin
37
- }
38
-
39
- declare module 'eslint-plugin-promise' {
40
- import type { TSESLint } from '@typescript-eslint/utils'
41
-
42
- const plugin: TSESLint.FlatConfig.Plugin
43
-
44
- export default plugin
45
- }
46
-
47
- declare module 'eslint-plugin-simple-import-sort' {
48
- import type { TSESLint } from '@typescript-eslint/utils'
49
-
50
- const plugin: TSESLint.FlatConfig.Plugin
51
-
52
- export default plugin
53
- }
54
-
55
- declare module 'eslint-plugin-unused-imports' {
56
- import type { TSESLint } from '@typescript-eslint/utils'
57
-
58
- const plugin: TSESLint.FlatConfig.Plugin
59
-
60
- export default plugin
61
- }
@@ -1,75 +0,0 @@
1
- // @ts-check
2
- import configStandard from 'eslint-config-standard'
3
- import pluginImport from 'eslint-plugin-import'
4
- import pluginJsxA11y from 'eslint-plugin-jsx-a11y'
5
- import pluginN from 'eslint-plugin-n'
6
- import pluginPromise from 'eslint-plugin-promise'
7
- import pluginSimpleImport from 'eslint-plugin-simple-import-sort'
8
- import pluginUnusedImport from 'eslint-plugin-unused-imports'
9
- import globals from 'globals'
10
-
11
- import { rules } from './rules.js'
12
-
13
- import eslint from '@eslint/js'
14
- import pluginStylistic from '@stylistic/eslint-plugin'
15
- import type { TSESLint } from '@typescript-eslint/utils'
16
-
17
- // Re-export types and utilities
18
- export * from './types.js'
19
-
20
- export * from './utils/index.js'
21
-
22
- const languageOptions: TSESLint.FlatConfig.LanguageOptions = {
23
- ecmaVersion: 'latest',
24
- sourceType: 'module',
25
- globals: {
26
- ...globals.browser,
27
- ...globals.node
28
- }
29
- }
30
-
31
- /**
32
- * Core JavaScript ESLint configuration
33
- * This is included by default in all configurations
34
- */
35
- export const coreConfig: TSESLint.FlatConfig.ConfigArray = [
36
- {
37
- name: 'eslint-config/recommended',
38
- ...eslint.configs.recommended
39
- },
40
- {
41
- name: 'eslint-config/plugins',
42
- plugins: {
43
- n: pluginN,
44
- promise: pluginPromise,
45
- import: { rules: pluginImport.rules },
46
- 'simple-import-sort': pluginSimpleImport,
47
- 'jsx-a11y': pluginJsxA11y,
48
- 'unused-imports': pluginUnusedImport
49
- },
50
- languageOptions,
51
- rules: {
52
- ...configStandard.rules,
53
- 'import/first': 'off'
54
- }
55
- },
56
- {
57
- name: 'eslint-config/stylistic',
58
- ...pluginStylistic.configs.recommended
59
- },
60
- {
61
- name: 'eslint-config/custom-js',
62
- languageOptions,
63
- files: ['**/*.{js,jsx,mjs,cjs}'],
64
- rules
65
- }
66
- ]
67
-
68
- // Legacy export for backwards compatibility
69
- export { coreConfig as jsConfig }
70
-
71
- // Export rules and groups for use by other packages
72
- export { rules, groups } from './rules.js'
73
-
74
- // Export settings
75
- export { gitignore } from './settings/index.js'