@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.
- package/.agent/rules/context.md +78 -0
- package/.agent/rules/guidelines.md +124 -0
- package/.editorconfig +13 -0
- package/.env.example +8 -0
- package/.github/CODEOWNERS +2 -0
- package/.github/DISCUSSION_TEMPLATE/rfcs.yml +21 -0
- package/.github/DISCUSSION_TEMPLATE/technical-discussions.yml +21 -0
- package/.github/FUNDING.yml +2 -0
- package/.github/ISSUE_TEMPLATE/README.md +13 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +69 -0
- package/.github/ISSUE_TEMPLATE/config.yml +8 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +43 -0
- package/.github/ISSUE_TEMPLATE/question.yml +22 -0
- package/.github/SECURITY.md +12 -0
- package/.github/SPONSORSHIPS.md +27 -0
- package/.github/dependabot.yml +45 -0
- package/.github/labeler.yml +46 -0
- package/.github/pull_request_template.md +56 -0
- package/.github/workflows/assign-issues.yml +18 -0
- package/.github/workflows/audit.yml +22 -0
- package/.github/workflows/build.yml +29 -0
- package/.github/workflows/codeql.yml +40 -0
- package/.github/workflows/docs.yml +49 -0
- package/.github/workflows/labeler.yml +18 -0
- package/.github/workflows/publish.yml +24 -0
- package/.github/workflows/release.yml +35 -0
- package/.github/workflows/size-check.yml +23 -0
- package/.github/workflows/stale.yml +31 -0
- package/.nvmrc +1 -0
- package/.vscode/extensions.json +10 -0
- package/.vscode/settings.json +55 -0
- package/CHANGELOG.md +16 -0
- package/CONTRIBUTING.md +194 -0
- package/DEVELOPMENT.md +4 -0
- package/LICENSE +21 -0
- package/README.md +275 -0
- package/config/.husky/commit-msg +9 -0
- package/config/.husky/pre-commit +1 -0
- package/config/.husky/pre-push +1 -0
- package/config/.husky/prepare-commit-msg +1 -0
- package/cspell.config.yaml +2 -0
- package/eslint.config.js +21 -0
- package/llms.txt +72 -0
- package/package.json +61 -0
- package/packages/astro/README.md +13 -0
- package/packages/astro/package.json +45 -0
- package/packages/astro/src/ambient.d.ts +10 -0
- package/packages/astro/src/index.ts +18 -0
- package/packages/astro/src/rules.ts +29 -0
- package/packages/astro/tsconfig.json +9 -0
- package/packages/astro/tsup.config.ts +11 -0
- package/packages/basic/README.md +33 -0
- package/packages/basic/package.json +55 -0
- package/packages/basic/src/index.ts +110 -0
- package/packages/basic/tsconfig.json +9 -0
- package/packages/basic/tsup.config.ts +18 -0
- package/packages/core/README.md +14 -0
- package/packages/core/index.ts +14 -0
- package/packages/core/package.json +61 -0
- package/packages/core/src/ambient.d.ts +61 -0
- package/packages/core/src/index.ts +75 -0
- package/packages/core/src/rules.ts +157 -0
- package/packages/core/src/settings/gitignore.ts +10 -0
- package/packages/core/src/settings/index.ts +1 -0
- package/packages/core/src/types.ts +57 -0
- package/packages/core/src/utils/index.ts +28 -0
- package/packages/core/tsconfig.json +9 -0
- package/packages/core/tsup.config.ts +10 -0
- package/packages/expo/README.md +13 -0
- package/packages/expo/package.json +48 -0
- package/packages/expo/src/ambient.d.ts +3 -0
- package/packages/expo/src/index.ts +39 -0
- package/packages/expo/tsconfig.json +9 -0
- package/packages/expo/tsup.config.ts +11 -0
- package/packages/nest/package.json +45 -0
- package/packages/nest/src/ambient.d.ts +14 -0
- package/packages/nest/src/index.ts +20 -0
- package/packages/nest/src/rules.ts +15 -0
- package/packages/nest/tsconfig.json +9 -0
- package/packages/nest/tsup.config.ts +11 -0
- package/packages/next/README.md +13 -0
- package/packages/next/package.json +47 -0
- package/packages/next/src/index.ts +31 -0
- package/packages/next/src/rules.ts +16 -0
- package/packages/next/tsconfig.json +9 -0
- package/packages/next/tsup.config.ts +10 -0
- package/packages/optionals/README.md +18 -0
- package/packages/optionals/package.json +55 -0
- package/packages/optionals/src/ambient.d.ts +25 -0
- package/packages/optionals/src/cspell.ts +14 -0
- package/packages/optionals/src/i18next.ts +19 -0
- package/packages/optionals/src/index.ts +8 -0
- package/packages/optionals/src/markdown.ts +66 -0
- package/packages/optionals/src/mdx.ts +40 -0
- package/packages/optionals/src/stencil.ts +48 -0
- package/packages/optionals/src/tailwind.ts +11 -0
- package/packages/optionals/src/vitest.ts +61 -0
- package/packages/optionals/tsconfig.json +9 -0
- package/packages/optionals/tsup.config.ts +11 -0
- package/packages/playground/README.md +14 -0
- package/packages/playground/package.json +17 -0
- package/packages/playground/src/astro/eslint.config.js +4 -0
- package/packages/playground/src/js/eslint.config.js +4 -0
- package/packages/playground/src/js/index.test.js +63 -0
- package/packages/playground/src/mdx/eslint.config.js +4 -0
- package/packages/playground/src/mdx/index.mdx +115 -0
- package/packages/playground/src/react/eslint.config.js +4 -0
- package/packages/playground/src/react/index.test.jsx +130 -0
- package/packages/playground/src/ts/eslint.config.js +4 -0
- package/packages/playground/src/ts/index.test.ts +61 -0
- package/packages/playground/src/ts/tsconfig.json +3 -0
- package/packages/playground/tsconfig.json +9 -0
- package/packages/react/README.md +14 -0
- package/packages/react/index.ts +26 -0
- package/packages/react/package.json +49 -0
- package/packages/react/src/ambient.d.ts +23 -0
- package/packages/react/src/index.ts +52 -0
- package/packages/react/src/rules.ts +47 -0
- package/packages/react/tsconfig.json +9 -0
- package/packages/react/tsup.config.ts +10 -0
- package/packages/tests/README.md +17 -0
- package/packages/tests/package.json +21 -0
- package/packages/tests/src/__snapshots__/snapshots.test.ts.snap +654 -0
- package/packages/tests/src/composition.test.ts +171 -0
- package/packages/tests/src/configs.test.ts +118 -0
- package/packages/tests/src/rules.test.ts +60 -0
- package/packages/tests/src/snapshots.test.ts +126 -0
- package/packages/tests/tsconfig.json +10 -0
- package/packages/tests/vitest.config.ts +8 -0
- package/packages/typescript/README.md +14 -0
- package/packages/typescript/package.json +47 -0
- package/packages/typescript/src/index.ts +32 -0
- package/packages/typescript/src/rules.ts +36 -0
- package/packages/typescript/tsconfig.json +9 -0
- package/packages/typescript/tsup.config.ts +10 -0
- package/tsconfig.base.json +20 -0
- package/tsconfig.docs.json +18 -0
- package/turbo.json +19 -0
- package/typedoc.config.mjs +25 -0
- 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,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
|
+
}
|