@santi020k/eslint-config-santi020k 3.0.0 → 3.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/README.md +4 -0
- package/dist/index.d.ts +19 -3
- package/dist/index.js +40 -3
- package/package.json +23 -22
package/README.md
CHANGED
|
@@ -123,6 +123,10 @@ Additionally, there are some optional parameters that add support to other techn
|
|
|
123
123
|
OptionalOption.Vitest,
|
|
124
124
|
// I18next
|
|
125
125
|
OptionalOption.I18next
|
|
126
|
+
// Mdx
|
|
127
|
+
OptionalOption.Mdx
|
|
128
|
+
// Markdown
|
|
129
|
+
OptionalOption.Markdown
|
|
126
130
|
]
|
|
127
131
|
}),
|
|
128
132
|
// Your custom config
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { TSESLint } from '@typescript-eslint/utils';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Enum for configuration options in ESLint
|
|
5
|
+
*/
|
|
3
6
|
declare enum ConfigOption {
|
|
4
7
|
Ts = "ts",
|
|
5
8
|
React = "react",
|
|
@@ -7,21 +10,34 @@ declare enum ConfigOption {
|
|
|
7
10
|
Expo = "expo",
|
|
8
11
|
Astro = "astro"
|
|
9
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Enum for optional features that can be included in ESLint
|
|
15
|
+
*/
|
|
10
16
|
declare enum OptionalOption {
|
|
11
17
|
Cspell = "cspell",
|
|
12
18
|
Tailwind = "tailwind",
|
|
13
19
|
Vitest = "vitest",
|
|
14
20
|
I18next = "i18next",
|
|
15
|
-
Mdx = "mdx"
|
|
21
|
+
Mdx = "mdx",
|
|
22
|
+
Markdown = "markdown"
|
|
16
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Array of configurations that require React
|
|
26
|
+
*/
|
|
17
27
|
declare const ReactConfigs: ConfigOption[];
|
|
28
|
+
/**
|
|
29
|
+
* ESLint configuration interface
|
|
30
|
+
*/
|
|
18
31
|
interface EslintConfig {
|
|
19
32
|
config?: ConfigOption[];
|
|
20
33
|
optionals?: OptionalOption[];
|
|
21
34
|
}
|
|
22
35
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
36
|
+
* Generates the ESLint configuration array, applying configurations
|
|
37
|
+
* and optional settings based on the input configuration.
|
|
38
|
+
*
|
|
39
|
+
* @param {EslintConfig} options - Configuration and optional settings
|
|
40
|
+
* @returns {TSESLint.FlatConfig.ConfigArray} The final ESLint configuration array
|
|
25
41
|
*/
|
|
26
42
|
declare const eslintConfig: ({ config, optionals }?: EslintConfig) => TSESLint.FlatConfig.ConfigArray;
|
|
27
43
|
|
package/dist/index.js
CHANGED
|
@@ -488,16 +488,48 @@ var i18next = [
|
|
|
488
488
|
...fixupConfigRules4(flatCompat.plugins("i18next"))
|
|
489
489
|
];
|
|
490
490
|
|
|
491
|
+
// src/optionals/markdown.ts
|
|
492
|
+
import pluginMarkdown from "@eslint/markdown";
|
|
493
|
+
var markdown = [
|
|
494
|
+
{
|
|
495
|
+
name: "markdown",
|
|
496
|
+
files: ["**/*.md"],
|
|
497
|
+
plugins: {
|
|
498
|
+
markdown: pluginMarkdown
|
|
499
|
+
},
|
|
500
|
+
language: "markdown/commonmark",
|
|
501
|
+
rules: {
|
|
502
|
+
"markdown/fenced-code-language": "error",
|
|
503
|
+
"markdown/heading-increment": "error",
|
|
504
|
+
"markdown/no-duplicate-headings": "off",
|
|
505
|
+
"markdown/no-empty-links": "error",
|
|
506
|
+
"markdown/no-html": "off",
|
|
507
|
+
"markdown/no-invalid-label-refs": "error",
|
|
508
|
+
"markdown/no-missing-label-refs": "off",
|
|
509
|
+
// Disable js/ts Eslint rules, markdown issues
|
|
510
|
+
indent: "off",
|
|
511
|
+
"no-irregular-whitespace": "off",
|
|
512
|
+
"@stylistic/indent": "off"
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
];
|
|
516
|
+
|
|
491
517
|
// src/optionals/mdx.ts
|
|
492
518
|
import pluginMdx from "eslint-plugin-mdx";
|
|
493
519
|
var mdx = [
|
|
494
520
|
{
|
|
521
|
+
name: "mdx-flat",
|
|
495
522
|
...pluginMdx.flat
|
|
496
523
|
},
|
|
497
524
|
{
|
|
525
|
+
name: "mdx-blocks",
|
|
498
526
|
...pluginMdx.flatCodeBlocks,
|
|
499
527
|
rules: {
|
|
500
|
-
...pluginMdx.flatCodeBlocks.rules
|
|
528
|
+
...pluginMdx.flatCodeBlocks.rules,
|
|
529
|
+
// Disable js/ts Eslint rules, markdown issues
|
|
530
|
+
indent: "off",
|
|
531
|
+
"no-irregular-whitespace": "off",
|
|
532
|
+
"@stylistic/indent": "off"
|
|
501
533
|
}
|
|
502
534
|
}
|
|
503
535
|
];
|
|
@@ -548,6 +580,7 @@ var OptionalOption = /* @__PURE__ */ ((OptionalOption2) => {
|
|
|
548
580
|
OptionalOption2["Vitest"] = "vitest";
|
|
549
581
|
OptionalOption2["I18next"] = "i18next";
|
|
550
582
|
OptionalOption2["Mdx"] = "mdx";
|
|
583
|
+
OptionalOption2["Markdown"] = "markdown";
|
|
551
584
|
return OptionalOption2;
|
|
552
585
|
})(OptionalOption || {});
|
|
553
586
|
var ReactConfigs = [
|
|
@@ -556,7 +589,10 @@ var ReactConfigs = [
|
|
|
556
589
|
"next" /* Next */,
|
|
557
590
|
"expo" /* Expo */
|
|
558
591
|
];
|
|
559
|
-
var eslintConfig = ({
|
|
592
|
+
var eslintConfig = ({
|
|
593
|
+
config = [],
|
|
594
|
+
optionals = []
|
|
595
|
+
} = {}) => {
|
|
560
596
|
const hasReact = hasReactConfig(config);
|
|
561
597
|
return [
|
|
562
598
|
...jsConfig,
|
|
@@ -569,7 +605,8 @@ var eslintConfig = ({ config = [], optionals = [] } = {}) => {
|
|
|
569
605
|
...optionals.includes("tailwind" /* Tailwind */) ? tailwind : [],
|
|
570
606
|
...optionals.includes("vitest" /* Vitest */) ? vitest : [],
|
|
571
607
|
...optionals.includes("i18next" /* I18next */) ? i18next : [],
|
|
572
|
-
...optionals.includes("mdx" /* Mdx */) ? mdx : []
|
|
608
|
+
...optionals.includes("mdx" /* Mdx */) ? mdx : [],
|
|
609
|
+
...optionals.includes("markdown" /* Markdown */) ? markdown : []
|
|
573
610
|
];
|
|
574
611
|
};
|
|
575
612
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@santi020k/eslint-config-santi020k",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "A comprehensive ESLint configuration package for JavaScript, TypeScript, and React projects, including popular plugins and custom rules for consistent coding style.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -61,50 +61,51 @@
|
|
|
61
61
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@eslint/config-inspector": "^0.5.
|
|
64
|
+
"@eslint/config-inspector": "^0.5.6",
|
|
65
65
|
"@types/eslint__eslintrc": "^2.1.2",
|
|
66
|
-
"@types/node": "^22.
|
|
66
|
+
"@types/node": "^22.9.0",
|
|
67
67
|
"cz-conventional-changelog": "^3.3.0",
|
|
68
68
|
"esbuild": "^0.24.0",
|
|
69
69
|
"husky": "^9.1.6",
|
|
70
70
|
"lint-staged": "^15.2.10",
|
|
71
71
|
"react": "^18.3.1",
|
|
72
72
|
"react-dom": "^18.3.1",
|
|
73
|
-
"tslib": "^2.
|
|
74
|
-
"tsup": "^8.3.
|
|
73
|
+
"tslib": "^2.8.1",
|
|
74
|
+
"tsup": "^8.3.5",
|
|
75
75
|
"typescript": "^5.6.3",
|
|
76
76
|
"yalc": "^1.0.0-pre.53"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"eslint": "^9.
|
|
80
|
-
"@
|
|
81
|
-
"@eslint
|
|
82
|
-
"@eslint/
|
|
83
|
-
"@
|
|
84
|
-
"@
|
|
79
|
+
"eslint": "^9.14.0",
|
|
80
|
+
"@eslint/markdown": "^6.2.1",
|
|
81
|
+
"@cspell/eslint-plugin": "^8.16.0",
|
|
82
|
+
"@eslint/compat": "^1.2.2",
|
|
83
|
+
"@eslint/js": "^9.14.0",
|
|
84
|
+
"@next/eslint-plugin-next": "^15.0.3",
|
|
85
|
+
"@stylistic/eslint-plugin": "^2.10.1",
|
|
85
86
|
"@types/eslint__js": "^8.42.3",
|
|
86
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
87
|
-
"@typescript-eslint/type-utils": "^8.
|
|
87
|
+
"@typescript-eslint/eslint-plugin": "^8.13.0",
|
|
88
|
+
"@typescript-eslint/type-utils": "^8.13.0",
|
|
88
89
|
"cross-dirname": "^0.1.0",
|
|
89
90
|
"eslint-config-expo": "^7.1.2",
|
|
90
91
|
"eslint-config-standard": "^17.1.0",
|
|
91
|
-
"eslint-plugin-astro": "^1.
|
|
92
|
+
"eslint-plugin-astro": "^1.3.1",
|
|
92
93
|
"eslint-plugin-i18next": "^6.1.0",
|
|
93
94
|
"eslint-plugin-import": "^2.31.0",
|
|
94
|
-
"eslint-plugin-jsx-a11y": "^6.10.
|
|
95
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
95
96
|
"eslint-plugin-mdx": "^3.1.5",
|
|
96
|
-
"eslint-plugin-n": "^17.
|
|
97
|
+
"eslint-plugin-n": "^17.13.1",
|
|
97
98
|
"eslint-plugin-promise": "^7.1.0",
|
|
98
|
-
"eslint-plugin-react": "^7.37.
|
|
99
|
-
"eslint-plugin-react-hooks": "^
|
|
99
|
+
"eslint-plugin-react": "^7.37.2",
|
|
100
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
100
101
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
101
|
-
"eslint-plugin-sonarjs": "^2.0.
|
|
102
|
+
"eslint-plugin-sonarjs": "^2.0.4",
|
|
102
103
|
"eslint-plugin-tailwindcss": "^3.17.5",
|
|
103
|
-
"eslint-plugin-testing-library": "^6.
|
|
104
|
+
"eslint-plugin-testing-library": "^6.4.0",
|
|
104
105
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
105
106
|
"eslint-plugin-vitest": "^0.5.4",
|
|
106
|
-
"globals": "^15.
|
|
107
|
-
"typescript-eslint": "^8.
|
|
107
|
+
"globals": "^15.12.0",
|
|
108
|
+
"typescript-eslint": "^8.13.0"
|
|
108
109
|
},
|
|
109
110
|
"overrides": {
|
|
110
111
|
"eslint-config-standard": "$eslint-config-standard",
|