@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.
- package/dist/index.d.ts +21 -0
- package/dist/index.js +129 -0
- package/package.json +47 -50
- package/.agent/rules/context.md +0 -78
- package/.agent/rules/guidelines.md +0 -124
- package/.editorconfig +0 -13
- package/.env.example +0 -8
- package/.github/CODEOWNERS +0 -2
- package/.github/DISCUSSION_TEMPLATE/rfcs.yml +0 -21
- package/.github/DISCUSSION_TEMPLATE/technical-discussions.yml +0 -21
- package/.github/FUNDING.yml +0 -2
- package/.github/ISSUE_TEMPLATE/README.md +0 -13
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -69
- package/.github/ISSUE_TEMPLATE/config.yml +0 -8
- package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -43
- package/.github/ISSUE_TEMPLATE/question.yml +0 -22
- package/.github/SECURITY.md +0 -12
- package/.github/SPONSORSHIPS.md +0 -27
- package/.github/dependabot.yml +0 -45
- package/.github/labeler.yml +0 -46
- package/.github/pull_request_template.md +0 -56
- package/.github/workflows/assign-issues.yml +0 -18
- package/.github/workflows/audit.yml +0 -22
- package/.github/workflows/build.yml +0 -29
- package/.github/workflows/codeql.yml +0 -40
- package/.github/workflows/docs.yml +0 -49
- package/.github/workflows/labeler.yml +0 -18
- package/.github/workflows/publish.yml +0 -24
- package/.github/workflows/release.yml +0 -35
- package/.github/workflows/size-check.yml +0 -23
- package/.github/workflows/stale.yml +0 -31
- package/.nvmrc +0 -1
- package/.vscode/extensions.json +0 -10
- package/.vscode/settings.json +0 -55
- package/CHANGELOG.md +0 -16
- package/CONTRIBUTING.md +0 -194
- package/DEVELOPMENT.md +0 -4
- package/LICENSE +0 -21
- package/README.md +0 -275
- package/config/.husky/commit-msg +0 -9
- package/config/.husky/pre-commit +0 -1
- package/config/.husky/pre-push +0 -1
- package/config/.husky/prepare-commit-msg +0 -1
- package/cspell.config.yaml +0 -2
- package/eslint.config.js +0 -21
- package/llms.txt +0 -72
- package/packages/astro/README.md +0 -13
- package/packages/astro/package.json +0 -45
- package/packages/astro/src/ambient.d.ts +0 -10
- package/packages/astro/src/index.ts +0 -18
- package/packages/astro/src/rules.ts +0 -29
- package/packages/astro/tsconfig.json +0 -9
- package/packages/astro/tsup.config.ts +0 -11
- package/packages/basic/README.md +0 -33
- package/packages/basic/package.json +0 -55
- package/packages/basic/src/index.ts +0 -110
- package/packages/basic/tsconfig.json +0 -9
- package/packages/basic/tsup.config.ts +0 -18
- package/packages/core/README.md +0 -14
- package/packages/core/index.ts +0 -14
- package/packages/core/package.json +0 -61
- package/packages/core/src/ambient.d.ts +0 -61
- package/packages/core/src/index.ts +0 -75
- package/packages/core/src/rules.ts +0 -157
- package/packages/core/src/settings/gitignore.ts +0 -10
- package/packages/core/src/settings/index.ts +0 -1
- package/packages/core/src/types.ts +0 -57
- package/packages/core/src/utils/index.ts +0 -28
- package/packages/core/tsconfig.json +0 -9
- package/packages/core/tsup.config.ts +0 -10
- package/packages/expo/README.md +0 -13
- package/packages/expo/package.json +0 -48
- package/packages/expo/src/ambient.d.ts +0 -3
- package/packages/expo/src/index.ts +0 -39
- package/packages/expo/tsconfig.json +0 -9
- package/packages/expo/tsup.config.ts +0 -11
- package/packages/nest/package.json +0 -45
- package/packages/nest/src/ambient.d.ts +0 -14
- package/packages/nest/src/index.ts +0 -20
- package/packages/nest/src/rules.ts +0 -15
- package/packages/nest/tsconfig.json +0 -9
- package/packages/nest/tsup.config.ts +0 -11
- package/packages/next/README.md +0 -13
- package/packages/next/package.json +0 -47
- package/packages/next/src/index.ts +0 -31
- package/packages/next/src/rules.ts +0 -16
- package/packages/next/tsconfig.json +0 -9
- package/packages/next/tsup.config.ts +0 -10
- package/packages/optionals/README.md +0 -18
- package/packages/optionals/package.json +0 -55
- package/packages/optionals/src/ambient.d.ts +0 -25
- package/packages/optionals/src/cspell.ts +0 -14
- package/packages/optionals/src/i18next.ts +0 -19
- package/packages/optionals/src/index.ts +0 -8
- package/packages/optionals/src/markdown.ts +0 -66
- package/packages/optionals/src/mdx.ts +0 -40
- package/packages/optionals/src/stencil.ts +0 -48
- package/packages/optionals/src/tailwind.ts +0 -11
- package/packages/optionals/src/vitest.ts +0 -61
- package/packages/optionals/tsconfig.json +0 -9
- package/packages/optionals/tsup.config.ts +0 -11
- package/packages/playground/README.md +0 -14
- package/packages/playground/package.json +0 -17
- package/packages/playground/src/astro/eslint.config.js +0 -4
- package/packages/playground/src/js/eslint.config.js +0 -4
- package/packages/playground/src/js/index.test.js +0 -63
- package/packages/playground/src/mdx/eslint.config.js +0 -4
- package/packages/playground/src/mdx/index.mdx +0 -115
- package/packages/playground/src/react/eslint.config.js +0 -4
- package/packages/playground/src/react/index.test.jsx +0 -130
- package/packages/playground/src/ts/eslint.config.js +0 -4
- package/packages/playground/src/ts/index.test.ts +0 -61
- package/packages/playground/src/ts/tsconfig.json +0 -3
- package/packages/playground/tsconfig.json +0 -9
- package/packages/react/README.md +0 -14
- package/packages/react/index.ts +0 -26
- package/packages/react/package.json +0 -49
- package/packages/react/src/ambient.d.ts +0 -23
- package/packages/react/src/index.ts +0 -52
- package/packages/react/src/rules.ts +0 -47
- package/packages/react/tsconfig.json +0 -9
- package/packages/react/tsup.config.ts +0 -10
- package/packages/tests/README.md +0 -17
- package/packages/tests/package.json +0 -21
- package/packages/tests/src/__snapshots__/snapshots.test.ts.snap +0 -654
- package/packages/tests/src/composition.test.ts +0 -171
- package/packages/tests/src/configs.test.ts +0 -118
- package/packages/tests/src/rules.test.ts +0 -60
- package/packages/tests/src/snapshots.test.ts +0 -126
- package/packages/tests/tsconfig.json +0 -10
- package/packages/tests/vitest.config.ts +0 -8
- package/packages/typescript/README.md +0 -14
- package/packages/typescript/package.json +0 -47
- package/packages/typescript/src/index.ts +0 -32
- package/packages/typescript/src/rules.ts +0 -36
- package/packages/typescript/tsconfig.json +0 -9
- package/packages/typescript/tsup.config.ts +0 -10
- package/tsconfig.base.json +0 -20
- package/tsconfig.docs.json +0 -18
- package/turbo.json +0 -19
- package/typedoc.config.mjs +0 -25
- package/typedoc.markdown.mjs +0 -26
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
useCallback,
|
|
3
|
-
useEffect,
|
|
4
|
-
useMemo,
|
|
5
|
-
useRef,
|
|
6
|
-
useState
|
|
7
|
-
} from 'react'
|
|
8
|
-
|
|
9
|
-
// Helper function to simulate fetching data
|
|
10
|
-
const fetchTodos = () => new Promise(resolve => {
|
|
11
|
-
setTimeout(() => {
|
|
12
|
-
resolve([
|
|
13
|
-
{ id: 1, text: 'Learn React', completed: true },
|
|
14
|
-
{
|
|
15
|
-
id: 2,
|
|
16
|
-
text: 'Build a Todo App',
|
|
17
|
-
completed: false
|
|
18
|
-
},
|
|
19
|
-
{ id: 3, text: 'Profit!', completed: false }
|
|
20
|
-
])
|
|
21
|
-
}, 1000)
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
const TodoApp = () => {
|
|
25
|
-
const [todos, setTodos] = useState([])
|
|
26
|
-
const [filter, setFilter] = useState('all')
|
|
27
|
-
const [sortOrder, setSortOrder] = useState('asc')
|
|
28
|
-
const inputRef = useRef()
|
|
29
|
-
|
|
30
|
-
// Fetch todos when the component mounts
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
const loadTodos = async () => {
|
|
33
|
-
const fetchedTodos = await fetchTodos()
|
|
34
|
-
|
|
35
|
-
setTodos(fetchedTodos)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
loadTodos()
|
|
39
|
-
}, [todos])
|
|
40
|
-
|
|
41
|
-
// Handle adding a new todo
|
|
42
|
-
const addTodo = useCallback(() => {
|
|
43
|
-
const text = inputRef.current.value.trim()
|
|
44
|
-
|
|
45
|
-
if (text) {
|
|
46
|
-
setTodos(prevTodos => [
|
|
47
|
-
...prevTodos,
|
|
48
|
-
{ id: Date.now(), text, completed: false }
|
|
49
|
-
])
|
|
50
|
-
|
|
51
|
-
inputRef.current.value = ''
|
|
52
|
-
}
|
|
53
|
-
}, [])
|
|
54
|
-
|
|
55
|
-
// Handle toggling the completion state of a todo
|
|
56
|
-
const toggleTodo = useCallback(id => {
|
|
57
|
-
setTodos(prevTodos => prevTodos.map(todo => todo.id === id ? { ...todo, completed: !todo.completed } : todo))
|
|
58
|
-
}, [])
|
|
59
|
-
|
|
60
|
-
// Handle changing the filter state
|
|
61
|
-
const handleFilterChange = useCallback(event => {
|
|
62
|
-
setFilter(event.target.value)
|
|
63
|
-
}, [])
|
|
64
|
-
|
|
65
|
-
// Handle changing the sort order
|
|
66
|
-
const handleSortChange = useCallback(event => {
|
|
67
|
-
setSortOrder(event.target.value)
|
|
68
|
-
}, [])
|
|
69
|
-
|
|
70
|
-
// Filter and sort todos based on current state
|
|
71
|
-
const filteredAndSortedTodos = useMemo(() => {
|
|
72
|
-
const filteredTodos = todos.filter(todo => {
|
|
73
|
-
if (filter === 'completed') return todo.completed
|
|
74
|
-
|
|
75
|
-
if (filter === 'incomplete') return !todo.completed
|
|
76
|
-
|
|
77
|
-
return true
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
return filteredTodos.sort((a, b) => {
|
|
81
|
-
if (sortOrder === 'asc') return a.text.localeCompare(b.text)
|
|
82
|
-
|
|
83
|
-
return b.text.localeCompare(a.text)
|
|
84
|
-
})
|
|
85
|
-
}, [todos, filter, sortOrder])
|
|
86
|
-
|
|
87
|
-
return (
|
|
88
|
-
<div>
|
|
89
|
-
<h1>Todo List</h1>
|
|
90
|
-
<div>
|
|
91
|
-
<input ref={inputRef} type="text" placeholder="New todo" />
|
|
92
|
-
<button type="button" onClick={addTodo}>
|
|
93
|
-
Add Todo
|
|
94
|
-
</button>
|
|
95
|
-
</div>
|
|
96
|
-
<div>
|
|
97
|
-
<label>
|
|
98
|
-
Filter:
|
|
99
|
-
<select value={filter} onChange={handleFilterChange}>
|
|
100
|
-
<option value="all">All</option>
|
|
101
|
-
<option value="completed">Completed</option>
|
|
102
|
-
<option value="incomplete">Incomplete</option>
|
|
103
|
-
</select>
|
|
104
|
-
</label>
|
|
105
|
-
<label>
|
|
106
|
-
Sort:
|
|
107
|
-
<select value={sortOrder} onChange={handleSortChange}>
|
|
108
|
-
<option value="asc">Ascending</option>
|
|
109
|
-
<option value="desc">Descending</option>
|
|
110
|
-
</select>
|
|
111
|
-
</label>
|
|
112
|
-
</div>
|
|
113
|
-
<ul>
|
|
114
|
-
{filteredAndSortedTodos.map(todo => (
|
|
115
|
-
<li
|
|
116
|
-
key={todo.id}
|
|
117
|
-
style={{ textDecoration: todo.completed ? 'line-through' : 'none' }}
|
|
118
|
-
>
|
|
119
|
-
{todo.text}
|
|
120
|
-
<button type="button" onClick={() => toggleTodo(todo.id)}>
|
|
121
|
-
{todo.completed ? 'Undo' : 'Complete'}
|
|
122
|
-
</button>
|
|
123
|
-
</li>
|
|
124
|
-
))}
|
|
125
|
-
</ul>
|
|
126
|
-
</div>
|
|
127
|
-
)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export default TodoApp
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// Function definitions to test various stylistic rules
|
|
2
|
-
const myFunction1 = (): string => {
|
|
3
|
-
const value = 10
|
|
4
|
-
|
|
5
|
-
if (value > 5) {
|
|
6
|
-
console.log('Value is greater than 5')
|
|
7
|
-
} else {
|
|
8
|
-
console.log('Value is 5 or less')
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const result: string = value > 5 ? 'High' : 'Low'
|
|
12
|
-
const array: number[] = [1, 2, 3]
|
|
13
|
-
|
|
14
|
-
array.forEach(item => {
|
|
15
|
-
console.log(item)
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
return result
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Testing object and array formatting rules
|
|
22
|
-
const myObject: { a: number, b: number, c: number } = { a: 1, b: 2, c: 3 }
|
|
23
|
-
const myArray: number[] = [1, 2, 3, 4, 5]
|
|
24
|
-
|
|
25
|
-
// Testing padding and spacing rules
|
|
26
|
-
if (myArray.length > 0) {
|
|
27
|
-
console.log('Array is not empty')
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const myFunction2 = (param: boolean): boolean => !!param
|
|
31
|
-
// Testing invalid typeof comparison
|
|
32
|
-
const count = 0
|
|
33
|
-
|
|
34
|
-
if (typeof count === 'number') {
|
|
35
|
-
console.log('Count is a number')
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Testing unused variables
|
|
39
|
-
// eslint-disable-next-line unused-imports/no-unused-vars, @typescript-eslint/no-unused-vars
|
|
40
|
-
const unusedVar = 'This is unused'
|
|
41
|
-
|
|
42
|
-
// Function with multiple return statements
|
|
43
|
-
// eslint-disable-next-line unused-imports/no-unused-vars, @typescript-eslint/no-unused-vars
|
|
44
|
-
const complexFunction = (): string => {
|
|
45
|
-
if (count > 10) return 'High'
|
|
46
|
-
|
|
47
|
-
if (count < 0) return 'Low'
|
|
48
|
-
|
|
49
|
-
return 'Medium'
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Testing no-use-before-define
|
|
53
|
-
myDefinedFunction()
|
|
54
|
-
|
|
55
|
-
// eslint-disable-next-line func-style
|
|
56
|
-
function myDefinedFunction(): void {
|
|
57
|
-
console.log('Function called before definition')
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Export statement to test sorting
|
|
61
|
-
export { myFunction1, myFunction2, myObject, myArray }
|
package/packages/react/README.md
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# @santi020k/eslint-config-react
|
|
2
|
-
|
|
3
|
-
React specific ESLint rules and configurations.
|
|
4
|
-
|
|
5
|
-
## Description
|
|
6
|
-
|
|
7
|
-
This package provides:
|
|
8
|
-
- `eslint-plugin-react` recommended rules.
|
|
9
|
-
- `eslint-plugin-react-hooks` recommended rules.
|
|
10
|
-
- JSX accessibility rules.
|
|
11
|
-
|
|
12
|
-
## Usage
|
|
13
|
-
|
|
14
|
-
This package is used automatically when `ConfigOption.React` is selected in the main configuration.
|
package/packages/react/index.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import jsxA11y from 'eslint-plugin-jsx-a11y'
|
|
2
|
-
import react from 'eslint-plugin-react'
|
|
3
|
-
import reactHooks from 'eslint-plugin-react-hooks'
|
|
4
|
-
|
|
5
|
-
import core from '@santi020k/eslint-config-core'
|
|
6
|
-
|
|
7
|
-
export default [
|
|
8
|
-
...core,
|
|
9
|
-
{
|
|
10
|
-
plugins: {
|
|
11
|
-
react,
|
|
12
|
-
'react-hooks': reactHooks,
|
|
13
|
-
'jsx-a11y': jsxA11y
|
|
14
|
-
},
|
|
15
|
-
rules: {
|
|
16
|
-
...react.configs.recommended.rules,
|
|
17
|
-
...reactHooks.configs.recommended.rules,
|
|
18
|
-
...jsxA11y.configs.recommended.rules
|
|
19
|
-
},
|
|
20
|
-
settings: {
|
|
21
|
-
react: {
|
|
22
|
-
version: 'detect'
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
]
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@santi020k/eslint-config-react",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"description": "React ESLint configuration with hooks and JSX rules",
|
|
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
|
-
"react": ">=18.0.0"
|
|
26
|
-
},
|
|
27
|
-
"dependencies": {
|
|
28
|
-
"@santi020k/eslint-config-core": "*",
|
|
29
|
-
"@eslint/compat": "^2.0.2",
|
|
30
|
-
"eslint-plugin-react": "^7.37.5",
|
|
31
|
-
"eslint-plugin-react-hooks": "^7.0.1",
|
|
32
|
-
"globals": "^17.3.0"
|
|
33
|
-
},
|
|
34
|
-
"devDependencies": {
|
|
35
|
-
"@typescript-eslint/utils": "^8.54.0",
|
|
36
|
-
"tsup": "^8.5.1",
|
|
37
|
-
"typescript": "^5.9.3"
|
|
38
|
-
},
|
|
39
|
-
"publishConfig": {
|
|
40
|
-
"access": "public"
|
|
41
|
-
},
|
|
42
|
-
"license": "MIT",
|
|
43
|
-
"author": "santi020k",
|
|
44
|
-
"repository": {
|
|
45
|
-
"type": "git",
|
|
46
|
-
"url": "git+https://github.com/santi020k/eslint-config.git",
|
|
47
|
-
"directory": "packages/react"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
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 }
|
|
@@ -1,47 +0,0 @@
|
|
|
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
|
-
}
|
package/packages/tests/README.md
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
```
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
}
|