@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,18 +0,0 @@
|
|
|
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.
|
|
@@ -1,55 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
]
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
]
|
|
@@ -1,8 +0,0 @@
|
|
|
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'
|
|
@@ -1,66 +0,0 @@
|
|
|
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
|
-
]
|
|
@@ -1,40 +0,0 @@
|
|
|
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
|
-
]
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { fixupPluginRules } from '@eslint/compat'
|
|
2
|
-
import stencilPlugin from '@stencil-community/eslint-plugin'
|
|
3
|
-
import type { TSESLint } from '@typescript-eslint/utils'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Stencil ESLint configuration
|
|
7
|
-
* Enforces best practices for Stencil.js components
|
|
8
|
-
*/
|
|
9
|
-
export const stencil: TSESLint.FlatConfig.ConfigArray = [
|
|
10
|
-
{
|
|
11
|
-
name: 'optionals/stencil',
|
|
12
|
-
files: ['**/*.{tsx,ts}'],
|
|
13
|
-
plugins: {
|
|
14
|
-
'@stencil-community': fixupPluginRules({
|
|
15
|
-
rules: stencilPlugin.rules as Record<string, unknown>
|
|
16
|
-
} as Parameters<typeof fixupPluginRules>[0]) as unknown as TSESLint.FlatConfig.Plugin
|
|
17
|
-
},
|
|
18
|
-
rules: {
|
|
19
|
-
'@stencil-community/async-methods': 'error',
|
|
20
|
-
'@stencil-community/ban-prefix': ['error', ['stencil', 'stnl', 'st']],
|
|
21
|
-
'@stencil-community/decorators-context': 'error',
|
|
22
|
-
'@stencil-community/decorators-style': [
|
|
23
|
-
'error', {
|
|
24
|
-
prop: 'inline',
|
|
25
|
-
state: 'inline',
|
|
26
|
-
element: 'inline',
|
|
27
|
-
event: 'inline',
|
|
28
|
-
method: 'multiline',
|
|
29
|
-
watch: 'multiline',
|
|
30
|
-
listen: 'multiline'
|
|
31
|
-
}],
|
|
32
|
-
'@stencil-community/element-type': 'error',
|
|
33
|
-
'@stencil-community/host-data-deprecated': 'error',
|
|
34
|
-
'@stencil-community/methods-must-be-public': 'error',
|
|
35
|
-
'@stencil-community/no-unused-watch': 'error',
|
|
36
|
-
'@stencil-community/own-methods-must-be-private': 'error',
|
|
37
|
-
'@stencil-community/own-props-must-be-private': 'error',
|
|
38
|
-
'@stencil-community/prefer-vdom-listener': 'error',
|
|
39
|
-
'@stencil-community/props-must-be-public': 'error',
|
|
40
|
-
'@stencil-community/props-must-be-readonly': 'error',
|
|
41
|
-
'@stencil-community/render-returns-host': 'error',
|
|
42
|
-
'@stencil-community/required-jsdoc': 'error',
|
|
43
|
-
'@stencil-community/reserved-member-names': 'error',
|
|
44
|
-
'@stencil-community/single-export': 'error',
|
|
45
|
-
'@stencil-community/strict-mutable': 'error'
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
]
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import pluginTailwind from 'eslint-plugin-tailwindcss'
|
|
2
|
-
|
|
3
|
-
import type { TSESLint } from '@typescript-eslint/utils'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Tailwind CSS ESLint configuration
|
|
7
|
-
* Enforces Tailwind CSS best practices
|
|
8
|
-
*/
|
|
9
|
-
export const tailwind: TSESLint.FlatConfig.ConfigArray = [
|
|
10
|
-
...(pluginTailwind.configs['flat/recommended'] as TSESLint.FlatConfig.ConfigArray)
|
|
11
|
-
]
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import testingLibrary from 'eslint-plugin-testing-library'
|
|
2
|
-
import pluginVitest from 'eslint-plugin-vitest'
|
|
3
|
-
import globals from 'globals'
|
|
4
|
-
|
|
5
|
-
import { fixupPluginRules } from '@eslint/compat'
|
|
6
|
-
import type { TSESLint } from '@typescript-eslint/utils'
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Vitest ESLint configuration
|
|
10
|
-
* Provides linting rules for Vitest test files with best practices
|
|
11
|
-
*/
|
|
12
|
-
export const vitest: TSESLint.FlatConfig.ConfigArray = [
|
|
13
|
-
{
|
|
14
|
-
name: 'optionals/vitest',
|
|
15
|
-
files: [
|
|
16
|
-
'tests/**/*.{js,ts,jsx,tsx}',
|
|
17
|
-
'**/__tests__/**/*.{js,ts,jsx,tsx}',
|
|
18
|
-
'**/__mocks__/**/*.{js,ts,jsx,tsx}',
|
|
19
|
-
'**/test/**/*.{js,ts,jsx,tsx}',
|
|
20
|
-
'**/spec/**/*.{js,ts,jsx,tsx}',
|
|
21
|
-
'**/__spec__/**/*.{js,ts,jsx,tsx}',
|
|
22
|
-
'**/*.test.{js,ts,jsx,tsx}',
|
|
23
|
-
'**/*.spec.{js,ts,jsx,tsx}',
|
|
24
|
-
'vitest.config.{js,ts}'
|
|
25
|
-
],
|
|
26
|
-
languageOptions: {
|
|
27
|
-
globals: {
|
|
28
|
-
...globals.node
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
plugins: {
|
|
32
|
-
vitest: pluginVitest,
|
|
33
|
-
'testing-library': fixupPluginRules({
|
|
34
|
-
rules: testingLibrary.rules
|
|
35
|
-
} as unknown as Parameters<typeof fixupPluginRules>[0]) as unknown as TSESLint.FlatConfig.Plugin
|
|
36
|
-
},
|
|
37
|
-
rules: {
|
|
38
|
-
// Vitest recommended rules
|
|
39
|
-
...pluginVitest.configs.recommended.rules,
|
|
40
|
-
|
|
41
|
-
// Best practice rules for testing
|
|
42
|
-
'vitest/max-nested-describe': ['error', { max: 3 }],
|
|
43
|
-
'vitest/expect-expect': [
|
|
44
|
-
'error',
|
|
45
|
-
{
|
|
46
|
-
assertFunctionNames: ['expect', 'assert', 'should']
|
|
47
|
-
}
|
|
48
|
-
],
|
|
49
|
-
'vitest/no-identical-title': 'error',
|
|
50
|
-
'vitest/no-focused-tests': 'error',
|
|
51
|
-
'vitest/no-disabled-tests': 'warn',
|
|
52
|
-
'vitest/prefer-to-be': 'warn',
|
|
53
|
-
'vitest/prefer-to-have-length': 'warn',
|
|
54
|
-
'vitest/valid-expect': 'error',
|
|
55
|
-
|
|
56
|
-
// Disable some rules that conflict with test patterns
|
|
57
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
58
|
-
'@stylistic/padding-line-between-statements': 'off'
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
]
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# @santi020k/eslint-config-playground
|
|
2
|
-
|
|
3
|
-
Internal playground package for testing ESLint configurations against real files.
|
|
4
|
-
|
|
5
|
-
## Description
|
|
6
|
-
|
|
7
|
-
This package contains various file types (React, Astro, MDX, TS) to verify that the ESLint rules are applied correctly in a real-world project structure.
|
|
8
|
-
|
|
9
|
-
## Usage
|
|
10
|
-
|
|
11
|
-
Run linting on this package:
|
|
12
|
-
```bash
|
|
13
|
-
npm run lint -w @santi020k/eslint-config-playground
|
|
14
|
-
```
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@santi020k/eslint-config-playground",
|
|
3
|
-
"private": false,
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"lint": "eslint .",
|
|
8
|
-
"lint:fix": "eslint . --fix"
|
|
9
|
-
},
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"@santi020k/eslint-config-basic": "*",
|
|
12
|
-
"eslint": "^9.39.2",
|
|
13
|
-
"react": "^19.2.4",
|
|
14
|
-
"react-dom": "^19.2.4",
|
|
15
|
-
"typescript": "^5.9.3"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// test.js
|
|
2
|
-
|
|
3
|
-
// Function definitions to test various stylistic rules
|
|
4
|
-
const myFunction1 = () => {
|
|
5
|
-
const value = 10
|
|
6
|
-
|
|
7
|
-
if (value > 5) {
|
|
8
|
-
console.log('Value is greater than 5')
|
|
9
|
-
} else {
|
|
10
|
-
console.log('Value is 5 or less')
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const result = value > 5 ? 'High' : 'Low'
|
|
14
|
-
const array = [1, 2, 3]
|
|
15
|
-
|
|
16
|
-
array.forEach(item => {
|
|
17
|
-
console.log(item)
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
return result
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Testing object and array formatting rules
|
|
24
|
-
const myObject = { a: 1, b: 2, c: 3 }
|
|
25
|
-
const myArray = [1, 2, 3, 4, 5]
|
|
26
|
-
|
|
27
|
-
// Testing padding and spacing rules
|
|
28
|
-
if (myArray.length > 0) {
|
|
29
|
-
console.log('Array is not empty')
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const myFunction2 = param => !!param
|
|
33
|
-
// Testing invalid typeof comparison
|
|
34
|
-
const count = 0
|
|
35
|
-
|
|
36
|
-
if (typeof count === 'number') {
|
|
37
|
-
console.log('Count is a number')
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Testing unused variables
|
|
41
|
-
// eslint-disable-next-line no-unused-vars, unused-imports/no-unused-vars
|
|
42
|
-
const unusedVar = 'This is unused'
|
|
43
|
-
|
|
44
|
-
// Function with multiple return statements
|
|
45
|
-
// eslint-disable-next-line no-unused-vars, unused-imports/no-unused-vars
|
|
46
|
-
const complexFunction = () => {
|
|
47
|
-
if (count > 10) return 'High'
|
|
48
|
-
|
|
49
|
-
if (count < 0) return 'Low'
|
|
50
|
-
|
|
51
|
-
return 'Medium'
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Testing no-use-before-define
|
|
55
|
-
myDefinedFunction()
|
|
56
|
-
|
|
57
|
-
// eslint-disable-next-line func-style
|
|
58
|
-
function myDefinedFunction() {
|
|
59
|
-
console.log('Function called before definition')
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Export statement to test sorting
|
|
63
|
-
export { myFunction1, myFunction2, myObject, myArray }
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "The Ultimate MDX Example"
|
|
3
|
-
description: "A complete overview of MDX capabilities with lorem ipsum content"
|
|
4
|
-
author: "Santiago Ipsum"
|
|
5
|
-
tags: ["mdx", "example", "components"]
|
|
6
|
-
date: "2025-04-21"
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
import { Button, Alert, FancyBox } from '../components/UI'
|
|
10
|
-
import Note from '../components/Note'
|
|
11
|
-
import Chart from '../components/Chart'
|
|
12
|
-
|
|
13
|
-
## ๐ข Welcome to the MDX Playground
|
|
14
|
-
|
|
15
|
-
# Welcome to the MDX Playground ๐ข
|
|
16
|
-
|
|
17
|
-
This is an **MDX** file. It's like Markdown, but on _steroids_ โ powered by **JSX**. Let's explore all the features using some _Lorem Ipsum_.
|
|
18
|
-
|
|
19
|
-
## ๐งฉ Embedded JSX Components
|
|
20
|
-
|
|
21
|
-
You can embed React components directly:
|
|
22
|
-
|
|
23
|
-
<Alert type="success">This is a success alert using a custom component!</Alert>
|
|
24
|
-
|
|
25
|
-
## ๐ฆ Importing Components
|
|
26
|
-
|
|
27
|
-
You can import components like `Note`, `FancyBox`, or even charts.
|
|
28
|
-
|
|
29
|
-
<Note>
|
|
30
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque feugiat.
|
|
31
|
-
</Note>
|
|
32
|
-
|
|
33
|
-
<FancyBox>
|
|
34
|
-
<h3>Fancy Box Title</h3>
|
|
35
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
|
36
|
-
</FancyBox>
|
|
37
|
-
|
|
38
|
-
## ๐ผ๏ธ Images
|
|
39
|
-
|
|
40
|
-

|
|
41
|
-
|
|
42
|
-
## ๐งฎ Code Blocks
|
|
43
|
-
|
|
44
|
-
### JavaScript
|
|
45
|
-
|
|
46
|
-
```js
|
|
47
|
-
const greet = name => `Hello, ${name}!`
|
|
48
|
-
|
|
49
|
-
greet('santi020k')
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### Bash
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
npm install @mdx-js/react
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
## ๐ Embedded Dynamic Chart
|
|
59
|
-
|
|
60
|
-
<Chart
|
|
61
|
-
title="Sample Chart"
|
|
62
|
-
data={[{ label: 'A', value: 10 }, { label: 'B', value: 20 }]}
|
|
63
|
-
/>
|
|
64
|
-
|
|
65
|
-
## ๐ Links
|
|
66
|
-
|
|
67
|
-
Check out the [official MDX docs](https://mdxjs.com).
|
|
68
|
-
|
|
69
|
-
## ๐๏ธ Lists and Tables
|
|
70
|
-
|
|
71
|
-
### Bullet List
|
|
72
|
-
|
|
73
|
-
- Lorem ipsum
|
|
74
|
-
- Dolor sit amet
|
|
75
|
-
- Consectetur adipiscing
|
|
76
|
-
|
|
77
|
-
### Numbered List
|
|
78
|
-
|
|
79
|
-
1. First item
|
|
80
|
-
2. Second item
|
|
81
|
-
3. Third item
|
|
82
|
-
|
|
83
|
-
### Table
|
|
84
|
-
|
|
85
|
-
| Feature | Supported |
|
|
86
|
-
|----------------|-----------|
|
|
87
|
-
| Markdown | โ
|
|
|
88
|
-
| JSX | โ
|
|
|
89
|
-
| Components | โ
|
|
|
90
|
-
| Frontmatter | โ
|
|
|
91
|
-
|
|
92
|
-
## ๐ Inline JSX
|
|
93
|
-
|
|
94
|
-
Hereโs some inline JSX: `<span style={{ color: 'tomato' }}>Hello inline JSX!</span>`
|
|
95
|
-
|
|
96
|
-
## ๐ Export Metadata
|
|
97
|
-
|
|
98
|
-
You can also export metadata if needed:
|
|
99
|
-
|
|
100
|
-
```js
|
|
101
|
-
export const meta = {
|
|
102
|
-
layout: 'docs',
|
|
103
|
-
requiresAuth: false
|
|
104
|
-
}
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
## ๐ง Conclusion
|
|
110
|
-
|
|
111
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque in odio vitae nunc luctus aliquet. MDX is powerful, flexible, and fun. Try it out in your next documentation or blog project!
|
|
112
|
-
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
---
|